Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Item Class Reference
Inheritance diagram for Item:
DataObject

Public Member Functions

 setIsEmpty ($flag=true)
 
 getIsEmpty ()
 
 hasIsEmpty ()
 
 getChildren ()
 
 setChildren ($children)
 
 hasChildren ()
 
 addChild ($child)
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 

Protected Attributes

 $_isEmpty = false
 
 $_children = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

@api

Since
100.0.2

Definition at line 12 of file Item.php.

Member Function Documentation

◆ addChild()

addChild (   $child)

Add child to array of items

Parameters
array$child
Returns
$this

Definition at line 96 of file Item.php.

97  {
98  $this->_children[] = $child;
99  return $this;
100  }

◆ getChildren()

getChildren ( )

Get children @codeCoverageIgnore

Returns
array

Definition at line 62 of file Item.php.

63  {
64  return $this->_children;
65  }

◆ getIsEmpty()

getIsEmpty ( )

Get is empty indicator @codeCoverageIgnore

Returns
bool @SuppressWarnings(PHPMD.BooleanGetMethodName)

Definition at line 44 of file Item.php.

45  {
46  return $this->_isEmpty;
47  }

◆ hasChildren()

hasChildren ( )

Indicator of whether or not children are present

Returns
bool

Definition at line 85 of file Item.php.

86  {
87  return count($this->_children) > 0 ? true : false;
88  }

◆ hasIsEmpty()

hasIsEmpty ( )
Returns
void

Definition at line 52 of file Item.php.

53  {
54  }

◆ setChildren()

setChildren (   $children)

Set children @codeCoverageIgnore

Parameters
array$children
Returns
$this

Definition at line 74 of file Item.php.

75  {
76  $this->_children = $children;
77  return $this;
78  }
$children
Definition: actions.phtml:11

◆ setIsEmpty()

setIsEmpty (   $flag = true)

Set is empty indicator @codeCoverageIgnore

Parameters
bool$flag
Returns
$this

Definition at line 31 of file Item.php.

32  {
33  $this->_isEmpty = $flag;
34  return $this;
35  }

Field Documentation

◆ $_children

$_children = []
protected

Definition at line 22 of file Item.php.

◆ $_isEmpty

$_isEmpty = false
protected

Definition at line 17 of file Item.php.


The documentation for this class was generated from the following file: