Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cCategoryHelper
  • cFrontendHelper
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cCategoryHelper

This class contains functions for the category helper class in CONTENIDO.

Package: Core\Frontend\Util
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Dominik Ziegler
Located at classes/class.category.helper.php
Methods summary
public static cCategoryHelper
# getInstance( )

Returns the instance of this class.

Returns the instance of this class.

Returns

cCategoryHelper
protected
# __construct( )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

public
# setAuth( cAuth $auth )

Sets an auth object to use on category access check.

Sets an auth object to use on category access check.

Parameters

$auth
cAuth
$auth auth object

Throws

cException
public integer
# getClientId( )

Returns the local stored client ID

Returns the local stored client ID

Returns

integer
client ID

Throws

cInvalidArgumentException
if no active client ID specified or found
public
# setClientId( integer $clientId = 0 )

Sets the client ID to store it locally in the class.

Sets the client ID to store it locally in the class.

Parameters

$clientId
integer
$clientId [optional] client ID
public integer
# getLanguageId( )

Returns the local stored language ID

Returns the local stored language ID

Returns

integer
language ID

Throws

cInvalidArgumentException
if no active language ID specified or found
public
# setLanguageId( integer $languageId = 0 )

Sets the language ID to store it locally in the class.

Sets the language ID to store it locally in the class.

Parameters

$languageId
integer
$languageId [optional] language ID
public integer
# getTopMostCategoryId( integer $categoryId )

Return the ID of the top most category based on a given category ID.

Return the ID of the top most category based on a given category ID.

Parameters

$categoryId
integer
$categoryId Base category ID to search on

Returns

integer
Top most category ID
public array
# getCategoryPath( integer $categoryId, integer $startingLevel = 1, integer $maxDepth = 20 )

Returns an array with ordered cApiCategoryLanguage objects e.g. for a breadcrumb.

Returns an array with ordered cApiCategoryLanguage objects e.g. for a breadcrumb.

Parameters

$categoryId
integer
$categoryId Last category ID in list.
$startingLevel
integer
$startingLevel [optional, default: 1] Define here, at which level the list should start.
$maxDepth
integer
$maxDepth [optional, default: 20] Amount of the max depth of categories.

Returns

array
Array with cApiCategoryLanguage objects

Throws

cException
cInvalidArgumentException
public array
# getParentCategoryIds( integer $categoryId, integer $maxDepth = 20 )

Fetch all parent category IDs of a given category.

Fetch all parent category IDs of a given category.

Parameters

$categoryId
integer
$categoryId Base category to search on.
$maxDepth
integer
$maxDepth [optional, default: 20] Amount of the max depth of categories.

Returns

array
Array with parent category IDs.
public integer
# getCategoryLevel( integer $categoryId )

Fetchs the level of a category by a given category ID.

Fetchs the level of a category by a given category ID.

Parameters

$categoryId
integer
$categoryId Category ID to fetch the level of.

Returns

integer
category level

Throws

cDbException
cException
public array
# getSubCategories( integer $categoryId, integer $depth )

Return the subcategories of the given category ID. TODO: Use Generic DB instead of SQL queries

Return the subcategories of the given category ID. TODO: Use Generic DB instead of SQL queries

Parameters

$categoryId
integer
$categoryId ID of the category to load
$depth
integer
$depth the maximum depth

Returns

array
array with subcategories

Throws

cDbException
cException
cInvalidArgumentException
public boolean
# hasCategoryAccess( cApiCategoryLanguage $categoryLanguage )

Checks if set auth object has access to the specific category.

Checks if set auth object has access to the specific category.

Parameters

$categoryLanguage
cApiCategoryLanguage
$categoryLanguage category language object

Returns

boolean
result of access check

Throws

cDbException
cException
cInvalidArgumentException
Properties summary
private static cCategoryHelper $_instance NULL
#

Instance of the helper class.

Instance of the helper class.

protected integer $_languageId 0
#

Local stored language ID

Local stored language ID

protected integer $_clientId 0
#

Local stored client ID

Local stored client ID

protected array $_levelCache array()
#

Local cache of category levels.

Local cache of category levels.

protected cAuth $_auth NULL
#

Auth object to use.

Auth object to use.

protected array $_feGroups array()
#

Array with current frontend user groups.

Array with current frontend user groups.

protected cApiFrontendPermissionCollection $_fePermColl NULL
#

Object for frontend permission collection.

Object for frontend permission collection.

CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0