Documentation

rex_category extends rex_structure_element
in package

Object Oriented Framework: Bildet eine Kategorie der Struktur ab.

Table of Contents

Properties

$catname  : string
$catpriority  : int
$clang_id  : int
$classVars  : array<int, string>|null
$createdate  : int
$createuser  : string
$id  : int
$name  : string
$parent_id  : int
$path  : string
$priority  : int
$startarticle  : bool
$status  : int
$template_id  : int
$updatedate  : int
$updateuser  : string

Methods

clearInstance()  : void
Removes the instance of the given key.
clearInstanceList()  : void
Clears the instance list of the given key.
clearInstanceListPool()  : void
Clears the instance list pool.
clearInstancePool()  : void
Clears the instance pool.
get()  : static|null
Return an rex_structure_element object based on an id.
getArticles()  : array<string|int, rex_article>
Return a list of articles in this category Returns an array of rex_article objects sorted by $priority.
getChildren()  : array<string|int, self>
Return a list of all subcategories.
getClang()  : int
Returns the clang of the category.
getClangId()  : int
Returns the clang of the category.
getClassVars()  : array<int, string>
Returns an Array containing article field names.
getClosest()  : self|null
Returns the closest element from parent tree (including itself) where the callback returns true.
getClosestValue()  : string|int|null
Returns the value from this element or from the closest parent where the value is set.
getCreateDate()  : int
Returns the creation date.
getCreateUser()  : string
Returns the creator.
getCurrent()  : self|null
Return the current category.
getId()  : int
Returns the id of the article.
getName()  : string
Returns the name of the category.
getParent()  : static|null
Returns the parent category.
getParentId()  : int
Returns the parent_id of the article.
getParentTree()  : array<int, rex_category>
Get an array of all parentCategories.
getPath()  : string
Returns the path of the category.
getPathAsArray()  : array<string|int, int>
Returns the path ids of the category/article as an array.
getPriority()  : int
Returns the article priority.
getRootCategories()  : array<string|int, self>
Return a list of top level categories, ie.
getStartArticle()  : rex_article
Return the start article for this category.
getTemplateId()  : int
Returns the template id.
getUpdateDate()  : int
Returns the last update date.
getUpdateUser()  : string
Returns the last update user.
getUrl()  : string
Returns a url for linking to this article.
getValue()  : string|int|null
Returns Object Value.
hasTemplate()  : bool
Returns true if article has a template.
hasValue()  : bool
inParentTree()  : bool
Checks if $anObj is in the parent tree of the object.
isNotFoundArticle()  : bool
Returns true if this Article is the not found article.
isOnline()  : bool
Returns true if article is online.
isOnlineIncludingParents()  : bool
Returns true if this element and all parents are online.
isParent()  : bool
Returns TRUE if this category is the direct parent of the other category.
isPermitted()  : bool
Returns whether the element is permitted.
isSiteStartArticle()  : bool
Returns true if this Article is the Startpage for the entire site.
isStartArticle()  : bool
Returns true if this Article is the Startpage for the category.
resetClassVars()  : void
toLink()  : string
Returns a link to this article.
__construct()  : mixed
_hasValue()  : bool
_toAttributeString()  : string
addInstance()  : void
Adds an instance.
addInstanceList()  : void
Adds an instance list.
getChildElements()  : array<string|int, static>
getInstance()  : static|null
Returns the instance for the given key.
getInstanceList()  : array<string|int, mixed>
Returns the instance list for the given key.
hasInstance()  : bool
Checks whether an instance exists for the given key.
hasInstanceList()  : bool
Checks whether an instance list exists for the given key.

Properties

Methods

clearInstance()

Removes the instance of the given key.

public static clearInstance(mixed $key) : void
Parameters
$key : mixed

Key

clearInstanceList()

Clears the instance list of the given key.

public static clearInstanceList(mixed $key) : void
Parameters
$key : mixed

Key

clearInstancePool()

Clears the instance pool.

public static clearInstancePool() : void

get()

Return an rex_structure_element object based on an id.

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

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

Parameters
$id : int

the article id

$clang : int = null

the clang id

Return values
static|null

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

getArticles()

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

public getArticles([bool $ignoreOfflines = false ]) : array<string|int, rex_article>

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

Parameters
$ignoreOfflines : bool = false
Return values
array<string|int, rex_article>

getChildren()

Return a list of all subcategories.

public getChildren([bool $ignoreOfflines = false ]) : array<string|int, self>

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
$ignoreOfflines : bool = false
Return values
array<string|int, self>

getClang()

Returns the clang of the category.

public getClang() : int
Tags
deprecated

since redaxo 5.6, use getClangId() instead

Return values
int

getClangId()

Returns the clang of the category.

public getClangId() : int
Return values
int

getClassVars()

Returns an Array containing article field names.

public static getClassVars() : array<int, string>
Return values
array<int, string>

getClosest()

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

public getClosest(callable(self): bool $callback) : self|null
Parameters
$callback : callable(self): bool
Return values
self|null

getClosestValue()

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

public getClosestValue(string $key) : string|int|null
Parameters
$key : string
Return values
string|int|null

getCreateDate()

Returns the creation date.

public getCreateDate() : int
Return values
int

getCreateUser()

Returns the creator.

public getCreateUser() : string
Return values
string

getCurrent()

Return the current category.

public static getCurrent([int $clang = null ]) : self|null
Parameters
$clang : int = null
Return values
self|null

getId()

Returns the id of the article.

public getId() : int
Return values
int

getName()

Returns the name of the category.

public getName() : string
Return values
string

getParent()

Returns the parent category.

public getParent() : static|null
Return values
static|null

getParentId()

Returns the parent_id of the article.

public getParentId() : int
Return values
int

getPath()

Returns the path of the category.

public getPath() : string
Return values
string

getPathAsArray()

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

public getPathAsArray() : array<string|int, int>
Return values
array<string|int, int>

getPriority()

Returns the article priority.

public getPriority() : int
Return values
int

getRootCategories()

Return a list of top level categories, ie.

public static getRootCategories([bool $ignoreOfflines = false ][, int $clang = null ]) : array<string|int, self>

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
$ignoreOfflines : bool = false
$clang : int = null
Return values
array<string|int, self>

getTemplateId()

Returns the template id.

public getTemplateId() : int
Return values
int

getUpdateDate()

Returns the last update date.

public getUpdateDate() : int
Return values
int

getUpdateUser()

Returns the last update user.

public getUpdateUser() : string
Return values
string

getUrl()

Returns a url for linking to this article.

public getUrl([array<string|int, mixed> $params = [] ][, string $divider = '&amp;' ]) : string
Parameters
$params : array<string|int, mixed> = []
$divider : string = '&amp;'
Return values
string

getValue()

Returns Object Value.

public getValue(string $value) : string|int|null
Parameters
$value : string
Return values
string|int|null

hasTemplate()

Returns true if article has a template.

public hasTemplate() : bool
Return values
bool

hasValue()

public static hasValue(string $value) : bool
Parameters
$value : string
Return values
bool

inParentTree()

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

public inParentTree(self $anObj) : bool
Parameters
$anObj : self
Return values
bool

isNotFoundArticle()

Returns true if this Article is the not found article.

public isNotFoundArticle() : bool
Return values
bool

isOnline()

Returns true if article is online.

public isOnline() : bool
Return values
bool

isOnlineIncludingParents()

Returns true if this element and all parents are online.

public isOnlineIncludingParents() : bool
Return values
bool

isParent()

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

public isParent(self $otherCat) : bool
Parameters
$otherCat : self
Return values
bool

isPermitted()

Returns whether the element is permitted.

public isPermitted() : bool
Return values
bool

isSiteStartArticle()

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

public isSiteStartArticle() : bool
Return values
bool

isStartArticle()

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

public isStartArticle() : bool
Return values
bool

Returns a link to this article.

public toLink([array<string|int, mixed> $params = [] ][, array<string|int, mixed> $attributes = [] ][, string $sorroundTag = null ][, array<string|int, mixed> $sorroundAttributes = [] ]) : string
Parameters
$params : array<string|int, mixed> = []

Parameter für den Link

$attributes : array<string|int, mixed> = []

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

$sorroundTag : string = null

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

$sorroundAttributes : array<string|int, mixed> = []

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

Return values
string

__construct()

protected __construct(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

_hasValue()

protected static _hasValue(string $value[, array<string|int, mixed> $prefixes = [] ]) : bool
Parameters
$value : string
$prefixes : array<string|int, mixed> = []
Return values
bool

_toAttributeString()

protected _toAttributeString(array<string|int, mixed> $attributes) : string
Parameters
$attributes : array<string|int, mixed>
Return values
string

addInstance()

Adds an instance.

protected static addInstance(mixed $key, self $instance) : void
Parameters
$key : mixed

Key

$instance : self

Instance

addInstanceList()

Adds an instance list.

protected static addInstanceList(mixed $key, array<string|int, mixed> $instanceKeyList) : void
Parameters
$key : mixed

Key

$instanceKeyList : array<string|int, mixed>

Array of instance keys

getChildElements()

protected static getChildElements(int $parentId, string $listType[, bool $ignoreOfflines = false ][, int $clang = null ]) : array<string|int, static>
Parameters
$parentId : int
$listType : string
$ignoreOfflines : bool = false
$clang : int = null
Return values
array<string|int, static>

getInstance()

Returns the instance for the given key.

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

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

Parameters
$key : mixed

Key

$createCallback : callable = null

Callback, will be called to create a new instance

Tags
psalm-param

callable(mixed...):?static $createCallback

Return values
static|null

getInstanceList()

Returns the instance list for the given key.

protected static getInstanceList(mixed $key, callable $getInstanceCallback[, callable|null $createListCallback = null ]) : array<string|int, mixed>

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

Parameters
$key : mixed

Key

$getInstanceCallback : callable

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

$createListCallback : callable|null = null

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

Tags
template

T as object

psalm-param

callable(mixed...):?T $getInstanceCallback

psalm-param

callable(mixed...):mixed[]|null $createListCallback

psalm-return

T[]

Return values
array<string|int, mixed>

hasInstance()

Checks whether an instance exists for the given key.

protected static hasInstance(mixed $key) : bool
Parameters
$key : mixed

Key

Return values
bool

hasInstanceList()

Checks whether an instance list exists for the given key.

protected static hasInstanceList(mixed $key) : bool
Parameters
$key : mixed

Key

Return values
bool

        
On this page

Search results