Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
State Class Reference
Inheritance diagram for State:
Column AbstractComponent ColumnInterface DataObject UiComponentInterface UiComponentInterface BlockInterface BlockInterface

Public Member Functions

 __construct (ContextInterface $context, UiComponentFactory $uiComponentFactory, CreditmemoRepositoryInterface $creditmemoRepository, array $components=[], array $data=[])
 
 prepareDataSource (array $dataSource)
 
- Public Member Functions inherited from Column
 __construct (ContextInterface $context, UiComponentFactory $uiComponentFactory, array $components=[], array $data=[])
 
 getComponentName ()
 
 prepare ()
 
 prepareItems (array & $items)
 
- Public Member Functions inherited from AbstractComponent
 __construct (ContextInterface $context, array $components=[], array $data=[])
 
 getContext ()
 
 getName ()
 
 prepare ()
 
 toHtml ()
 
 render ()
 
 addComponent ($name, UiComponentInterface $component)
 
 getComponent ($name)
 
 getChildComponents ()
 
 renderChildComponent ($name)
 
 getTemplate ()
 
 getConfiguration ()
 
 getJsConfig (UiComponentInterface $component)
 
 setData ($key, $value=null)
 
 getData ($key='', $index=null)
 
 prepareDataSource (array $dataSource)
 
 getDataSourceData ()
 
- 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

 $states
 
- Protected Attributes inherited from Column
 $wrappedComponent
 
 $uiComponentFactory
 
- Protected Attributes inherited from AbstractComponent
 $context
 
 $components
 
 $componentData = []
 
 $dataSources = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- Data Fields inherited from Column
const NAME = 'column'
 
- Protected Member Functions inherited from Column
 addFieldToSelect ()
 
 applySorting ()
 
- Protected Member Functions inherited from AbstractComponent
 prepareChildComponent (UiComponentInterface $component)
 
 initObservers (array & $data=[])
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Class State

Definition at line 16 of file State.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ContextInterface  $context,
UiComponentFactory  $uiComponentFactory,
CreditmemoRepositoryInterface  $creditmemoRepository,
array  $components = [],
array  $data = [] 
)

Constructor

Parameters
ContextInterface$context
UiComponentFactory$uiComponentFactory
CreditmemoRepositoryInterface$creditmemoRepository
array$components
array$data

Definition at line 32 of file State.php.

38  {
39  $this->states = $creditmemoRepository->create()->getStates();
40  parent::__construct($context, $uiComponentFactory, $components, $data);
41  }

Member Function Documentation

◆ prepareDataSource()

prepareDataSource ( array  $dataSource)

Prepare Data Source

Parameters
array$dataSource
Returns
array

Implements UiComponentInterface.

Definition at line 49 of file State.php.

50  {
51  if (isset($dataSource['data']['items'])) {
52  foreach ($dataSource['data']['items'] as & $item) {
53  $item[$this->getData('name')] = isset($this->states[$item[$this->getData('name')]])
54  ? $this->states[$item[$this->getData('name')]]
55  : $item[$this->getData('name')];
56  }
57  }
58 
59  return $dataSource;
60  }

Field Documentation

◆ $states

$states
protected

Definition at line 21 of file State.php.


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