2 namespace TYPO3\CMS\Backend\View\BackendLayout;
40 public function add($identifier, $classNameOrObject)
42 if (strpos($identifier,
'__') !==
false) {
43 throw new \UnexpectedValueException(
44 'Identifier "' . $identifier .
'" must not contain "__"',
49 if (is_object($classNameOrObject)) {
50 $className = get_class($classNameOrObject);
51 $dataProvider = $classNameOrObject;
53 $className = $classNameOrObject;
54 $dataProvider = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($classNameOrObject);
58 throw new \LogicException(
59 $className .
' must implement interface ' . \TYPO3\CMS\Backend\View\
BackendLayout\DataProviderInterface::class,
64 $this->dataProviders[$identifier] = $dataProvider;
79 foreach ($this->dataProviders as $identifier => $dataProvider) {
81 $dataProvider->addBackendLayouts($dataProviderContext, $backendLayoutCollection);
82 $result[$identifier] = $backendLayoutCollection;
100 $backendLayout = null;
102 if (strpos($combinedIdentifier,
'__') ===
false) {
103 $dataProviderIdentifier =
'default';
104 $backendLayoutIdentifier = $combinedIdentifier;
106 list($dataProviderIdentifier, $backendLayoutIdentifier) = explode(
'__', $combinedIdentifier, 2);
109 if (isset($this->dataProviders[$dataProviderIdentifier])) {
110 $backendLayout = $this->dataProviders[$dataProviderIdentifier]->getBackendLayout($backendLayoutIdentifier, $pageId);
113 return $backendLayout;
124 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
125 BackendLayoutCollection::class, $identifier