Properties

$id

$id : int

Type

int

$parent_id

$parent_id : int

Type

int

$clang_id

$clang_id : int

Type

int

$name

$name : string

Type

string

$catname

$catname : string

Type

string

$template_id

$template_id : int

Type

int

$path

$path

$priority

$priority : int

Type

int

$catpriority

$catpriority : int

Type

int

$startarticle

$startarticle : bool

Type

bool

$status

$status : int

Type

int

$updatedate

$updatedate : int

Type

int

$createdate

$createdate : int

Type

int

$updateuser

$updateuser : string

Type

string

$createuser

$createuser : string

Type

string

$classVars

$classVars

Methods

getValue()

getValue(string  $value) : string|int|null

Returns Object Value.

Parameters

string $value

Returns

string|int|null —

getClassVars()

getClassVars() : string[]

Returns an Array containing article field names.

Returns

string[] —

resetClassVars()

resetClassVars() : mixed

Returns

mixed —

get()

get(int  $id, int  $clang = null) : static|null

Return an rex_structure_element object based on an id.

The instance will be cached in an instance-pool and therefore re-used by a later call.

Parameters

int $id

the article id

int $clang

the clang id

Returns

static|null —

A rex_structure_element instance typed to the late-static binding type of the caller

getClang()

getClang() : int

Returns the clang of the category.

Returns

int —

getClangId()

getClangId() : int

Returns the clang of the category.

Returns

int —

getUrl()

getUrl(array  $params = [], string  $divider = '&') : string

Returns a url for linking to this article.

Parameters

array $params
string $divider

Returns

string —

getId()

getId() : int

Returns the id of the article.

Returns

int —

getParentId()

getParentId() : int

Returns the parent_id of the article.

Returns

int —

getPath()

getPath() : string

Returns the path of the category.

Returns

string —

getPathAsArray()

getPathAsArray() : int[]

Returns the path ids of the category/article as an array.

Returns

int[] —

getParent()

getParent() : static|null

Returns the parent category.

Returns

static|null —

getName()

getName() : string

Returns the name of the category.

Returns

string —

getPriority()

getPriority() : int

Returns the article priority.

Returns

int —

getUpdateUser()

getUpdateUser() : string

Returns the last update user.

Returns

string —

getUpdateDate()

getUpdateDate() : int

Returns the last update date.

Returns

int —

getCreateUser()

getCreateUser() : string

Returns the creator.

Returns

string —

getCreateDate()

getCreateDate() : int

Returns the creation date.

Returns

int —

isOnline()

isOnline() : bool

Returns true if article is online.

Returns

bool —

getTemplateId()

getTemplateId() : int

Returns the template id.

Returns

int —

hasTemplate()

hasTemplate() : bool

Returns true if article has a template.

Returns

bool —

isPermitted()

isPermitted() : bool

Returns whether the element is permitted.

Returns

bool —

toLink()

toLink(array  $params = [], array  $attributes = [], string  $sorroundTag = null, array  $sorroundAttributes = []) : string

Returns a link to this article.

Parameters

array $params

Parameter für den Link

array $attributes

Attribute die dem Link hinzugefügt werden sollen. Default: array

string $sorroundTag

HTML-Tag-Name mit dem der Link umgeben werden soll, z.b. 'li', 'div'. Default: null

array $sorroundAttributes

Attribute die Umgebenden-Element hinzugefügt werden sollen. Default: array

Returns

string —

getParentTree()

getParentTree() : \list<\rex_category>

Get an array of all parentCategories.

Returns an array of rex_structure_element objects.

Returns

\list<\rex_category> —

inParentTree()

inParentTree(self  $anObj) : bool

Checks if $anObj is in the parent tree of the object.

Parameters

self $anObj

Returns

bool —

getClosest()

getClosest(callable  $callback) : ?self

Returns the closest element from parent tree (including itself) where the callback returns true.

Parameters

callable $callback

Returns

?self —

getClosestValue()

getClosestValue(string  $key) : string|int|null

Returns the value from this element or from the closest parent where the value is set.

Parameters

string $key

Returns

string|int|null —

isOnlineIncludingParents()

isOnlineIncludingParents() : bool

Returns true if this element and all parents are online.

Returns

bool —

isStartArticle()

isStartArticle() : bool

Returns true if this Article is the Startpage for the category.

Returns

bool —

isSiteStartArticle()

isSiteStartArticle() : bool

Returns true if this Article is the Startpage for the entire site.

Returns

bool —

isNotFoundArticle()

isNotFoundArticle() : bool

Returns true if this Article is the not found article.

Returns

bool —

clearInstanceList()

clearInstanceList(mixed  $key) : mixed

Clears the instance list of the given key.

Parameters

mixed $key

Key

Returns

mixed —

clearInstanceListPool()

clearInstanceListPool() : mixed

Clears the instance list pool.

Returns

mixed —

clearInstance()

clearInstance(mixed  $key) : mixed

Removes the instance of the given key.

Parameters

mixed $key

Key

Returns

mixed —

clearInstancePool()

clearInstancePool() : mixed

Clears the instance pool.

Returns

mixed —

getCurrent()

getCurrent(int  $clang = null) : null|self

Return the current category.

Parameters

int $clang

Returns

null|self —

getRootCategories()

getRootCategories(bool  $ignoreOfflines = false, int  $clang = null) : self[]

Return a list of top level categories, ie.

categories that have no parent. Returns an array of rex_category objects sorted by $priority.

If $ignore_offlines is set to TRUE, all categories with status 0 will be excempt from this list!

Parameters

bool $ignoreOfflines
int $clang

Returns

self[] —

getChildren()

getChildren(bool  $ignoreOfflines = false) : self[]

Return a list of all subcategories.

Returns an array of rex_category objects sorted by $priority.

If $ignore_offlines is set to TRUE, all categories with status 0 will be excempt from this list!

Parameters

bool $ignoreOfflines

Returns

self[] —

isParent()

isParent(self  $otherCat) : bool

Returns TRUE if this category is the direct parent of the other category.

Parameters

self $otherCat

Returns

bool —

getArticles()

getArticles(bool  $ignoreOfflines = false) : \rex_article[]

Return a list of articles in this category Returns an array of rex_article objects sorted by $priority.

If $ignore_offlines is set to TRUE, all articles with status 0 will be excempt from this list!

Parameters

bool $ignoreOfflines

Returns

\rex_article[] —

getStartArticle()

getStartArticle() : \rex_article

Return the start article for this category.

Returns

\rex_article —

hasValue()

hasValue(string  $value) : bool

Parameters

string $value

Returns

bool —

__construct()

__construct(array  $params) : mixed

Constructor.

Parameters

array $params

Returns

mixed —

_hasValue()

_hasValue(string  $value, array  $prefixes = []) : bool

Parameters

string $value
array $prefixes

Returns

bool —

getChildElements()

getChildElements(int  $parentId, string  $listType, bool  $ignoreOfflines = false, int  $clang = null) : static[]

Parameters

int $parentId
string $listType
bool $ignoreOfflines
int $clang

Returns

static[] —

_toAttributeString()

_toAttributeString(array  $attributes) : string

Parameters

array $attributes

Returns

string —

addInstanceList()

addInstanceList(mixed  $key, array  $instanceKeyList) : mixed

Adds an instance list.

Parameters

mixed $key

Key

array $instanceKeyList

Array of instance keys

Returns

mixed —

hasInstanceList()

hasInstanceList(mixed  $key) : bool

Checks whether an instance list exists for the given key.

Parameters

mixed $key

Key

Returns

bool —

getInstanceList()

getInstanceList(mixed  $key, callable  $getInstanceCallback, callable|null  $createListCallback = null) : array

Returns the instance list for the given key.

If the instance list does not exist it will be created by calling the $createListCallback

Parameters

mixed $key

Key

callable $getInstanceCallback

Callback, will be called for every list item to get the instance

callable|null $createListCallback

Callback, will be called to create the list of instance keys

Returns

array —

addInstance()

addInstance(mixed  $key, self  $instance) : mixed

Adds an instance.

Parameters

mixed $key

Key

self $instance

Instance

Returns

mixed —

hasInstance()

hasInstance(mixed  $key) : bool

Checks whether an instance exists for the given key.

Parameters

mixed $key

Key

Returns

bool —

getInstance()

getInstance(mixed  $key, callable  $createCallback = null) : null|static

Returns the instance for the given key.

If the instance does not exist it will be created by calling the $createCallback

Parameters

mixed $key

Key

callable $createCallback

Callback, will be called to create a new instance

Returns

null|static —