Section pool
@api
- Since
- 100.0.2
Definition at line 17 of file SectionPool.php.
◆ __construct()
Construct
- Parameters
-
ObjectManagerInterface | $objectManager | |
\Magento\Customer\CustomerData\Section\Identifier | $identifier | |
array | $sectionSourceMap | |
Definition at line 45 of file SectionPool.php.
◆ get()
Get section source by name
- Parameters
-
- Returns
- SectionSourceInterface
- Exceptions
-
Definition at line 105 of file SectionPool.php.
107 $sectionSource = $this->objectManager->get(
$name);
109 if (!$sectionSource instanceof SectionSourceInterface) {
110 throw new LocalizedException(
111 __(
'%1 doesn\'t extend \Magento\Customer\CustomerData\SectionSourceInterface',
$name)
114 return $sectionSource;
if(!isset($_GET['name'])) $name
◆ getAllSectionData()
Get all section sources
- Returns
- array
Definition at line 89 of file SectionPool.php.
92 foreach ($this->sectionSourceMap as $sectionName => $sectionClass) {
93 $data[$sectionName] = $this->
get($sectionClass)->getSectionData();
◆ getSectionDataByNames()
getSectionDataByNames |
( |
|
$sectionNames | ) |
|
|
protected |
Get section sources by section names
- Parameters
-
- Returns
- array
- Exceptions
-
Definition at line 72 of file SectionPool.php.
75 foreach ($sectionNames as $sectionName) {
76 if (!isset($this->sectionSourceMap[$sectionName])) {
77 throw new LocalizedException(
__(
'The "%1" section source isn\'t supported.', $sectionName));
79 $data[$sectionName] = $this->
get($this->sectionSourceMap[$sectionName])->getSectionData();
◆ getSectionsData()
getSectionsData |
( |
array |
$sectionNames = null , |
|
|
|
$updateIds = false |
|
) |
| |
{Get section data by section names. If $sectionNames is null then return all sections data
- Parameters
-
array | $sectionNames | |
bool | $updateIds | |
- Returns
- array
}
Implements SectionPoolInterface.
Definition at line 58 of file SectionPool.php.
61 $sectionsData = $this->identifier->markSections($sectionsData, $sectionNames, $updateIds);
getSectionDataByNames($sectionNames)
◆ $identifier
◆ $objectManager
◆ $sectionSourceMap
The documentation for this class was generated from the following file: