Class luya\cms\menu\Item
| Inheritance | luya\cms\menu\Item » yii\base\BaseObject |
|---|---|
| Implements | luya\web\LinkInterface, yii\base\Arrayable, yii\base\Configurable |
| Uses Traits | luya\web\LinkTrait, yii\base\ArrayableTrait |
| Available since version | 1.0.0 |
| Source Code | https://github.com/luyadev/luya-module-cms/blob/master/src/menu/Item.php |
Menu item Object.
Each menu itaration will return in an Item-Object. The Item-Object contains several methods like returning title, url and ids or retrieve depending item iterations like parents or childs. As the Item Object extends the {{yii\base\BaseObject}} all getter methods can be access as property.
Read more in the [[app-menu.md]] Guide.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $absoluteLink | string | The link path with prepand website host https://luya.io/home/about-us. |
luya\cms\menu\Item |
| $alias | string | Returns the alias name of this page. | luya\cms\menu\Item |
| $children | luya\cms\menu\QueryIteratorFilter | Get all children of the current item. | luya\cms\menu\Item |
| $container | string | Returns the container name. | luya\cms\menu\Item |
| $dateCreated | integer | Returns an unix timestamp when the page was created. | luya\cms\menu\Item |
| $dateUpdated | integer | Returns an unix timestamp when the page was last time updated. | luya\cms\menu\Item |
| $depth | integer | Returns the depth of the navigation tree start with 1. | luya\cms\menu\Item |
| $descendants | luya\cms\menu\QueryIteratorFilter | Get all childrens with childrens children. | luya\cms\menu\Item |
| $description | string | Returns the page description (used for making meta key description). | luya\cms\menu\Item |
| $hasChildren | boolean | Check whether an item has childrens or not returning a boolean value. | luya\cms\menu\Item |
| $hasParent | boolean | Check whether the parent has items or not. | luya\cms\menu\Item |
| $href | string | Returns the href string which can be either with or without domain. | luya\cms\menu\Item |
| $id | integer | Returns Unique identifier of item, represents data record of cms_nav_item table. | luya\cms\menu\Item |
| $image | luya\admin\image\Item|boolean | The Image object or false if no image has been uploaded | luya\cms\menu\Item |
| $is404Page | boolean | This property indicates whether the item is the 404 page item or not. | luya\cms\menu\Item |
| $isActive | boolean | Returns a boolean value whether the current item is an active link or not, this is also for all parent elements. | luya\cms\menu\Item |
| $isHidden | boolean | Returns boolean state of visbility. | luya\cms\menu\Item |
| $isHome | boolean | Returns true if the item is the home item, otherwise false. | luya\cms\menu\Item |
| $isStrictParsing | boolean | luya\cms\menu\Item | |
| $itemArray | array | The item property containing the informations with key value parinings. | luya\cms\menu\Item |
| $keywords | array | Returns an array of user defined keywords for this page (user to generate meta keywords) | luya\cms\menu\Item |
| $lang | string|null | Can contain the language context, so the sub querys for this item will be the same language context as the parent object which created this object. | luya\cms\menu\Item |
| $link | string | Returns the current item link relative path with composition (language). | luya\cms\menu\Item |
| $model | luya\cms\models\Nav|boolean | Returns the {{\luya\cms\models\Nav}} object for the current navigation item. | luya\cms\menu\Item |
| $moduleName | string | Returns the name of the module if its of type module(2) | luya\cms\menu\Item |
| $navId | integer | Returns the Navigation Id which is not unique but is used for the menu tree | luya\cms\menu\Item |
| $nextSibling | luya\cms\menu\Item|boolean | Returns the next sibling based on the current sibling, if not found false is returned. | luya\cms\menu\Item |
| $parent | luya\cms\menu\Item | Returns a Item-Object of the parent element, if no parent element exists returns false. | luya\cms\menu\Item |
| $parentNavId | integer | Returns the parent navigation id of this item (0 = root level). | luya\cms\menu\Item |
| $parents | luya\cms\menu\QueryIteratorFilter | Return all parent elements without the current item. | luya\cms\menu\Item |
| $prevSibling | luya\cms\menu\Item|boolean | Returns the previous sibling based on the current sibling, if not found false is returned. | luya\cms\menu\Item |
| $seoTitle | string | Returns the Alternative SEO-Title. | luya\cms\menu\Item |
| $sibilings | luya\cms\menu\QueryIteratorFilter | Get all sibilings for the current item, this also includes the current item iteself. | luya\cms\menu\Item |
| $siblings | luya\cms\menu\QueryIteratorFilter | An array with all item-object siblings | luya\cms\menu\Item |
| $sortIndex | integer | Sort index position for the current siblings list. | luya\cms\menu\Item |
| $target | string | Returns the target string value for the link resource. | luya\cms\menu\Item |
| $teardown | luya\cms\menu\QueryIteratorFilter | Return all parent elemtns with the current item. | luya\cms\menu\Item |
| $title | string | Returns the title of this page | luya\cms\menu\Item |
| $type | integer | Returns the type of page 1=Page with blocks, 2=Module, 3=Redirect | luya\cms\menu\Item |
| $userCreated | luya\admin\models\User | Returns an active record object for the admin user who created this page. | luya\cms\menu\Item |
| $userUpdated | luya\admin\models\User | Returns an active record object for the admin user who last time updated this page. | luya\cms\menu\Item |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __call() | Calls the named method which is not a class method. | yii\base\BaseObject |
| __construct() | Constructor. | yii\base\BaseObject |
| __get() | Returns the value of an object property. | yii\base\BaseObject |
| __isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
| __set() | Sets value of an object property. | yii\base\BaseObject |
| __toString() | Return the href string from getHref() when echoing the object. | luya\web\LinkTrait |
| __unset() | Sets an object property to null. | yii\base\BaseObject |
| canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
| canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
| className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
| down() | Go down to a given element which is evalutaed trough a callable. | luya\cms\menu\Item |
| extraFields() | Returns the list of fields that can be expanded further and returned by toArray(). | yii\base\ArrayableTrait |
| fields() | Returns the list of fields that should be returned by default by toArray() when no specific fields are specified. | luya\cms\menu\Item |
| getAbsoluteLink() | Returns the link with an absolute scheme. | luya\cms\menu\Item |
| getAlias() | Returns the current alias name of the item (identifier for the url) also (& previous) called rewrite. | luya\cms\menu\Item |
| getChildren() | Get all children of the current item. Children means going the depth/menulevel down e.g. from 1 to 2. | luya\cms\menu\Item |
| getContainer() | Return the current container name of this item. | luya\cms\menu\Item |
| getDateCreated() | Returns an unix timestamp when the page was created. | luya\cms\menu\Item |
| getDateUpdated() | Returns an unix timestamp when the page was last time updated. | luya\cms\menu\Item |
| getDepth() | Returns the depth of the navigation tree start with 1. Also known as menu level. | luya\cms\menu\Item |
| getDescendants() | Returns all children and childrens-children. | luya\cms\menu\Item |
| getDescription() | Returns the description provided by the cms admin, if any. | luya\cms\menu\Item |
| getHasChildren() | Check whether an item has childrens or not returning a boolean value. | luya\cms\menu\Item |
| getHasParent() | Check whether the parent has items or not. | luya\cms\menu\Item |
| getHref() | Get the href attribute value inside the Link tag. | luya\cms\menu\Item |
| getId() | Get the Id of the Item, the Id is an unique identifiere an represents the id column in the cms_nav_item table. | luya\cms\menu\Item |
| getImage() | Returns the image object if an object is uploaded. | luya\cms\menu\Item |
| getIsActive() | Returns a boolean value whether the current item is an active link or not, this is also for all parent elements. If a child item is active, the parent element is activ as well. | luya\cms\menu\Item |
| getIsHidden() | Whether the item is hidden or not if hidden items can be retreived (with/without settings). | luya\cms\menu\Item |
| getIsHome() | Whether current item is home or not. | luya\cms\menu\Item |
| getIsStrictParsing() | Returns whether the current page has strict parsing mode disabled or not. | luya\cms\menu\Item |
| getKeywords() | luya\cms\menu\Item | |
| getLink() | Returns the current item link relative path with composition (language). The path is always relativ to the host. | luya\cms\menu\Item |
| getModel() | Get the ActiveRecord Model for the current Nav Model. | luya\cms\menu\Item |
| getModuleName() | If the type of the item is equals 2 we can detect the module name and returns this information. | luya\cms\menu\Item |
| getNavId() | Get the Nav-id of the Item, the Nav-Id is not unique but in case of the language container the nav id is unique. The Nav-Id identifier repersents the id coluumn of the cms_nav table. | luya\cms\menu\Item |
| getNextSibling() | Get the next sibling in the current siblings list. | luya\cms\menu\Item |
| getParent() | Returns a Item-Object of the parent element, if no parent element exists returns false. | luya\cms\menu\Item |
| getParentNavId() | Get the parent_nav_id of the current item. If the current Item-Object belongs to a parent navigation item, the getParentNavId() method returns the getNavId() of the parent item. | luya\cms\menu\Item |
| getParents() | Return all parent elements without the current item. | luya\cms\menu\Item |
| getPrevSibling() | Get the previous sibling in the current siblings list. | luya\cms\menu\Item |
| getProperty() | Get Property Object. | luya\cms\menu\Item |
| getPropertyValue() | Get the value of a Property Object. | luya\cms\menu\Item |
| getSeoTitle() | Returns the Alternative SEO-Title. | luya\cms\menu\Item |
| getSiblings() | Get all sibilings for the current item, this also includes the current item iteself. | luya\cms\menu\Item |
| getSortIndex() | Get the sorting index position for the item on the current siblings. | luya\cms\menu\Item |
| getTarget() | Get the target attribute value inside the Link tag. | luya\cms\menu\Item |
| getTeardown() | Return all parent elements with the current item. | luya\cms\menu\Item |
| getTitle() | Returns the current Title of the Menu Item. | luya\cms\menu\Item |
| getType() | Return the current nav item type by number. | luya\cms\menu\Item |
| getUserCreated() | Returns an active record object for the admin user who created this page. | luya\cms\menu\Item |
| getUserUpdated() | Returns an active record object for the admin user who last time updated this page. | luya\cms\menu\Item |
| hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
| hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
| init() | Item-Object initiliazer, verify if the itemArray property is empty. | luya\cms\menu\Item |
| setIsHidden() | Override the default hidden state of an item. | luya\cms\menu\Item |
| setModel() | Setter method for the Model. | luya\cms\menu\Item |
| setTarget() | Setter method for the link target. | luya\cms\menu\Item |
| setTitle() | Override the current title of item. | luya\cms\menu\Item |
| toArray() | Converts the model into an array. | yii\base\ArrayableTrait |
| with() | You can use with() before the following methods: | luya\cms\menu\Item |
| without() | Unset a value from the with() method. |
luya\cms\menu\Item |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| extractFieldsFor() | Extract nested fields from a fields collection for a given root field Nested fields are separated with dots (.). e.g: "item.id" The previous example would extract "id". | yii\base\ArrayableTrait |
| extractRootFields() | Extracts the root field names from nested fields. | yii\base\ArrayableTrait |
| getInternalDescendants() | luya\cms\menu\Item | |
| redirectMapData() | Internal used to retriev redirect data. | luya\cms\menu\Item |
| resolveFields() | Determines which fields can be returned by toArray(). | yii\base\ArrayableTrait |
Property Details
The link path with prepand website host https://luya.io/home/about-us.
Get all children of the current item. Children means going the depth/menulevel down e.g. from 1 to 2.
Returns an unix timestamp when the page was created.
Returns an unix timestamp when the page was last time updated.
Returns the depth of the navigation tree start with 1. Also known as menu level.
Get all childrens with childrens children.
Returns the page description (used for making meta key description).
Check whether an item has childrens or not returning a boolean value.
Check whether the parent has items or not.
Returns the href string which can be either with or without domain.
Returns Unique identifier of item, represents data record of cms_nav_item table.
The Image object or false if no image has been uploaded
This property indicates whether the item is the 404 page item or not. This status is set by {{luya\cms\Menu::resolveCurrent()}} method and retrieved in the {{luya\cms\frontend\controllers\DefaultController::actionIndex()}} in order to send 404 response header.
Returns a boolean value whether the current item is an active link or not, this is also for all parent elements. If a child item is active, the parent element is activ as well.
Returns true if the item is the home item, otherwise false.
The item property containing the informations with key value parinings. This property will be assigned when creating the Item-Object.
Returns an array of user defined keywords for this page (user to generate meta keywords)
Can contain the language context, so the sub querys for this item will be the same language context as the parent object which created this object.
Returns the current item link relative path with composition (language). The path is always relativ to the host.
Returns the {{\luya\cms\models\Nav}} object for the current navigation item.
Returns the name of the module if its of type module(2)
Returns the next sibling based on the current sibling, if not found false is returned.
Returns a Item-Object of the parent element, if no parent element exists returns false.
Return all parent elements without the current item.
Returns the previous sibling based on the current sibling, if not found false is returned.
Returns the Alternative SEO-Title. If entry is empty, the $title will returned instead.
Get all sibilings for the current item, this also includes the current item iteself.
An array with all item-object siblings
Sort index position for the current siblings list.
Returns the target string value for the link resource.
Return all parent elemtns with the current item.
Returns the type of page 1=Page with blocks, 2=Module, 3=Redirect
Returns an active record object for the admin user who created this page.
Returns an active record object for the admin user who last time updated this page.
Method Details
Defined in: yii\base\BaseObject::__call()
Calls the named method which is not a class method.
Do not call this method directly as it is a PHP magic method that will be implicitly called when an unknown method is being invoked.
| public mixed __call ( $name, $params ) | ||
| $name | string |
The method name |
| $params | array |
Method parameters |
| return | mixed |
The method return value |
|---|---|---|
| throws | yii\base\UnknownMethodException |
when calling unknown method |
public function __call($name, $params)
{
throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
}
Defined in: yii\base\BaseObject::__construct()
Constructor.
The default implementation does two things:
- Initializes the object with the given configuration
$config. - Call init().
If this method is overridden in a child class, it is recommended that
- the last parameter of the constructor is a configuration array, like
$confighere. - call the parent implementation at the end of the constructor.
| public void __construct ( $config = [] ) | ||
| $config | array |
Name-value pairs that will be used to initialize the object properties |
public function __construct($config = [])
{
if (!empty($config)) {
Yii::configure($this, $config);
}
$this->init();
}
Defined in: yii\base\BaseObject::__get()
Returns the value of an object property.
Do not call this method directly as it is a PHP magic method that
will be implicitly called when executing $value = $object->property;.
See also __set().
| public mixed __get ( $name ) | ||
| $name | string |
The property name |
| return | mixed |
The property value |
|---|---|---|
| throws | yii\base\UnknownPropertyException |
if the property is not defined |
| throws | yii\base\InvalidCallException |
if the property is write-only |
public function __get($name)
{
$getter = 'get' . $name;
if (method_exists($this, $getter)) {
return $this->$getter();
} elseif (method_exists($this, 'set' . $name)) {
throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
}
throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}
Defined in: yii\base\BaseObject::__isset()
Checks if a property is set, i.e. defined and not null.
Do not call this method directly as it is a PHP magic method that
will be implicitly called when executing isset($object->property).
Note that if the property is not defined, false will be returned.
| public boolean __isset ( $name ) | ||
| $name | string |
The property name or the event name |
| return | boolean |
Whether the named property is set (not null). |
|---|---|---|
public function __isset($name)
{
$getter = 'get' . $name;
if (method_exists($this, $getter)) {
return $this->$getter() !== null;
}
return false;
}
Defined in: yii\base\BaseObject::__set()
Sets value of an object property.
Do not call this method directly as it is a PHP magic method that
will be implicitly called when executing $object->property = $value;.
See also __get().
| public void __set ( $name, $value ) | ||
| $name | string |
The property name or the event name |
| $value | mixed |
The property value |
| throws | yii\base\UnknownPropertyException |
if the property is not defined |
|---|---|---|
| throws | yii\base\InvalidCallException |
if the property is read-only |
public function __set($name, $value)
{
$setter = 'set' . $name;
if (method_exists($this, $setter)) {
$this->$setter($value);
} elseif (method_exists($this, 'get' . $name)) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
} else {
throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
}
}
Defined in: luya\web\LinkTrait::__toString()
Return the href string from getHref() when echoing the object.
| public void __toString ( ) |
public function __toString()
{
return $this->getHref();
}
Defined in: yii\base\BaseObject::__unset()
Sets an object property to null.
Do not call this method directly as it is a PHP magic method that
will be implicitly called when executing unset($object->property).
Note that if the property is not defined, this method will do nothing. If the property is read-only, it will throw an exception.
| public void __unset ( $name ) | ||
| $name | string |
The property name |
| throws | yii\base\InvalidCallException |
if the property is read only. |
|---|---|---|
public function __unset($name)
{
$setter = 'set' . $name;
if (method_exists($this, $setter)) {
$this->$setter(null);
} elseif (method_exists($this, 'get' . $name)) {
throw new InvalidCallException('Unsetting read-only property: ' . get_class($this) . '::' . $name);
}
}
Defined in: yii\base\BaseObject::canGetProperty()
Returns a value indicating whether a property can be read.
A property is readable if:
- the class has a getter method associated with the specified name (in this case, property name is case-insensitive);
- the class has a member variable with the specified name (when
$checkVarsis true);
See also canSetProperty().
| public boolean canGetProperty ( $name, $checkVars = true ) | ||
| $name | string |
The property name |
| $checkVars | boolean |
Whether to treat member variables as properties |
| return | boolean |
Whether the property can be read |
|---|---|---|
public function canGetProperty($name, $checkVars = true)
{
return method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name);
}
Defined in: yii\base\BaseObject::canSetProperty()
Returns a value indicating whether a property can be set.
A property is writable if:
- the class has a setter method associated with the specified name (in this case, property name is case-insensitive);
- the class has a member variable with the specified name (when
$checkVarsis true);
See also canGetProperty().
| public boolean canSetProperty ( $name, $checkVars = true ) | ||
| $name | string |
The property name |
| $checkVars | boolean |
Whether to treat member variables as properties |
| return | boolean |
Whether the property can be written |
|---|---|---|
public function canSetProperty($name, $checkVars = true)
{
return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);
}
::class instead.
Defined in: yii\base\BaseObject::className()
Returns the fully qualified name of this class.
| public static string className ( ) | ||
| return | string |
The fully qualified name of this class. |
|---|---|---|
public static function className()
{
return get_called_class();
}
Go down to a given element which is evalutaed trough a callable.
Iterate trough parent elements until the last.
$item = Yii::$app->menu->current->down(function(Item $item) {
if ($item->depth == 1) {
return $item;
}
});
| public luya\cms\menu\Item|mixed|boolean down ( callable $fn ) | ||
| $fn | callable |
A function which holds the current iterated item. |
| return | luya\cms\menu\Item|mixed|boolean |
If no item has been picked, false is returned otherwise the picked item or any other callable response. |
|---|---|---|
public function down(callable $fn)
{
$parent = $this->with($this->_with)->getParent();
while ($parent) {
$response = call_user_func_array($fn, [$parent]);
if ($response) {
return $response;
}
$parent = $parent->with($this->_with)->getParent();
}
return false;
}
Defined in: yii\base\ArrayableTrait::extraFields()
Returns the list of fields that can be expanded further and returned by toArray().
This method is similar to fields() except that the list of fields returned by this method are not returned by default by toArray(). Only when field names to be expanded are explicitly specified when calling toArray(), will their values be exported.
The default implementation returns an empty array.
You may override this method to return a list of expandable fields based on some context information (e.g. the current application user).
See also:
| public array extraFields ( ) | ||
| return | array |
The list of expandable field names or field definitions. Please refer to fields() on the format of the return value. |
|---|---|---|
public function extraFields()
{
return [];
}
Defined in: yii\base\ArrayableTrait::extractFieldsFor()
Extract nested fields from a fields collection for a given root field Nested fields are separated with dots (.). e.g: "item.id" The previous example would extract "id".
| protected array extractFieldsFor ( array $fields, $rootField ) | ||
| $fields | array |
The fields requested for extraction |
| $rootField | string |
The root field for which we want to extract the nested fields |
| return | array |
Nested fields extracted for the given field |
|---|---|---|
protected function extractFieldsFor(array $fields, $rootField)
{
$result = [];
foreach ($fields as $field) {
if (0 === strpos($field, "{$rootField}.")) {
$result[] = preg_replace('/^' . preg_quote($rootField, '/') . '\./i', '', $field);
}
}
return array_unique($result);
}
Defined in: yii\base\ArrayableTrait::extractRootFields()
Extracts the root field names from nested fields.
Nested fields are separated with dots (.). e.g: "item.id" The previous example would extract "item".
| protected array extractRootFields ( array $fields ) | ||
| $fields | array |
The fields requested for extraction |
| return | array |
Root fields extracted from the given nested fields |
|---|---|---|
protected function extractRootFields(array $fields)
{
$result = [];
foreach ($fields as $field) {
$result[] = current(explode('.', $field, 2));
}
if (in_array('*', $result, true)) {
$result = [];
}
return array_unique($result);
}
Returns the list of fields that should be returned by default by toArray() when no specific fields are specified.
A field is a named element in the returned array by toArray().
This method should return an array of field names or field definitions. If the former, the field name will be treated as an object property name whose value will be used as the field value. If the latter, the array key should be the field name while the array value should be the corresponding field definition which can be either an object property name or a PHP callable returning the corresponding field value. The signature of the callable should be:
function ($model, $field) {
// return field value
}
For example, the following code declares four fields:
email: the field name is the same as the property nameemail;firstNameandlastName: the field names arefirstNameandlastName, and their values are obtained from thefirst_nameandlast_nameproperties;fullName: the field name isfullName. Its value is obtained by concatenatingfirst_nameandlast_name.
return [
'email',
'firstName' => 'first_name',
'lastName' => 'last_name',
'fullName' => function ($model) {
return $model->first_name . ' ' . $model->last_name;
},
];
| public array fields ( ) | ||
| return | array |
The list of field names or field definitions. |
|---|---|---|
public function fields()
{
return ['href', 'target'];
}
Returns the link with an absolute scheme.
The link with an absolute scheme path example https://luya.io/link where link is the output
from the {{luya\cms\menu\item::getLink}} method.
| public string getAbsoluteLink ( ) | ||
| return | string |
The link path with prepand website host |
|---|---|---|
public function getAbsoluteLink()
{
return Yii::$app->request->hostInfo . $this->getLink();
}
Returns the current alias name of the item (identifier for the url) also (& previous) called rewrite.
| public string getAlias ( ) | ||
| return | string |
E.g. "hello-word" |
|---|---|---|
public function getAlias()
{
return $this->itemArray['alias'];
}
Get all children of the current item. Children means going the depth/menulevel down e.g. from 1 to 2.
| public luya\cms\menu\QueryIteratorFilter getChildren ( ) | ||
| return | luya\cms\menu\QueryIteratorFilter |
Returns all children |
|---|---|---|
public function getChildren()
{
return (new Query())
->where(['parent_nav_id' => $this->navId, 'container' => $this->getContainer()])
->with($this->_with)
->lang($this->lang)
->all();
}
Return the current container name of this item.
| public string getContainer ( ) | ||
| return | string |
Return alias name of the container |
|---|---|---|
public function getContainer()
{
return $this->itemArray['container'];
}
Returns an unix timestamp when the page was created.
| public integer getDateCreated ( ) | ||
| return | integer |
Unix timestamp |
|---|---|---|
public function getDateCreated()
{
return $this->itemArray['timestamp_create'];
}
Returns an unix timestamp when the page was last time updated.
| public integer getDateUpdated ( ) | ||
| return | integer |
Unix timestamp |
|---|---|---|
public function getDateUpdated()
{
return $this->itemArray['timestamp_update'];
}
Returns the depth of the navigation tree start with 1. Also known as menu level.
| public integer getDepth ( ) |
public function getDepth()
{
return $this->itemArray['depth'];
}
Returns all children and childrens-children.
| public luya\cms\menu\QueryIteratorFilter getDescendants ( ) |
public function getDescendants()
{
return Query::createArrayIterator($this->getInternalDescendants(), $this->lang, array_flip($this->_with), false);
}
Returns the description provided by the cms admin, if any.
| public string getDescription ( ) | ||
| return | string |
The description string for this page. |
|---|---|---|
public function getDescription()
{
return $this->itemArray['description'];
}
Check whether an item has childrens or not returning a boolean value.
| public boolean getHasChildren ( ) | ||
| return | boolean |
If there are childrens the method returns true, otherwhise false. |
|---|---|---|
public function getHasChildren()
{
return count($this->getChildren()) > 0 ? true : false;
}
Check whether the parent has items or not.
| public boolean getHasParent ( ) |
public function getHasParent()
{
return (bool) $this->getParent();
}