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

Public Member Functions

 __construct (ContextInterface $context, DataProviderInterface $dataProvider, array $components=[], array $data=[])
 
 getComponentName ()
 
 prepare ()
 
 getDataProvider ()
 
- 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)
 

Data Fields

const NAME = 'dataSource'
 

Protected Attributes

 $dataProvider
 
- Protected Attributes inherited from AbstractComponent
 $context
 
 $components
 
 $componentData = []
 
 $dataSources = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 

Additional Inherited Members

- 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

@api

Since
100.0.2

Definition at line 16 of file DataSource.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ContextInterface  $context,
DataProviderInterface  $dataProvider,
array  $components = [],
array  $data = [] 
)

Constructor

Parameters
ContextInterface$context
DataProviderInterface$dataProvider
array$components
array$data

Definition at line 33 of file DataSource.php.

Member Function Documentation

◆ getComponentName()

getComponentName ( )

Get component name

Returns
string

Implements UiComponentInterface.

Definition at line 49 of file DataSource.php.

50  {
51  return static::NAME;
52  }

◆ getDataProvider()

getDataProvider ( )
Returns
DataProviderInterface

Implements DataSourceInterface.

Definition at line 69 of file DataSource.php.

70  {
71  return $this->dataProvider;
72  }

◆ prepare()

prepare ( )

Prepare component configuration

Returns
void

Implements UiComponentInterface.

Definition at line 59 of file DataSource.php.

60  {
61  $jsConfig = $this->getJsConfig($this);
62  unset($jsConfig['extends']);
63  $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
64  }
getJsConfig(UiComponentInterface $component)

Field Documentation

◆ $dataProvider

$dataProvider
protected

Definition at line 23 of file DataSource.php.

◆ NAME

const NAME = 'dataSource'

Definition at line 18 of file DataSource.php.


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