‪TYPO3CMS  9.5
ModuleDataStorageCollection.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
22 class ‪ModuleDataStorageCollection extends \SplObjectStorage
23 {
24  public function ‪addModuleData(‪DataProviderInterface $module, ‪ModuleData $moduleData): void
25  {
26  $this->attach($module, $moduleData);
27  }
28 
29  public function ‪getHash($object)
30  {
31  if ($object instanceof ‪ModuleInterface) {
32  return $object->getIdentifier();
33  }
34  throw new \InvalidArgumentException(
35  'Only modules implementing ' . ModuleInterface::class . ' are allowed to be stored',
36  1535301628
37  );
38  }
39 }
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleDataStorageCollection\addModuleData
‪addModuleData(DataProviderInterface $module, ModuleData $moduleData)
Definition: ModuleDataStorageCollection.php:24
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleDataStorageCollection
Definition: ModuleDataStorageCollection.php:23
‪TYPO3\CMS\Adminpanel\ModuleApi
Definition: AbstractModule.php:4
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleDataStorageCollection\getHash
‪getHash($object)
Definition: ModuleDataStorageCollection.php:29
‪TYPO3\CMS\Adminpanel\ModuleApi\DataProviderInterface
Definition: DataProviderInterface.php:29
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleInterface
Definition: ModuleInterface.php:25
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleData
Definition: ModuleData.php:26