vendor/ibexa/user/src/lib/UserSetting/ValueDefinitionGroupRegistryEntry.php line 44

Open in your IDE?
  1. <?php
  2. /**
  3.  * @copyright Copyright (C) Ibexa AS. All rights reserved.
  4.  * @license For full copyright and license information view LICENSE file distributed with this source code.
  5.  */
  6. declare(strict_types=1);
  7. namespace Ibexa\User\UserSetting;
  8. use Ibexa\Contracts\User\UserSetting\ValueDefinitionGroupInterface;
  9. use Ibexa\Contracts\User\UserSetting\ValueDefinitionInterface;
  10. /**
  11.  * @internal
  12.  */
  13. final class ValueDefinitionGroupRegistryEntry implements \IteratorAggregate
  14. {
  15.     private ValueDefinitionGroupInterface $definition;
  16.     private array $valueDefinitions;
  17.     public function __construct(ValueDefinitionGroupInterface $definition, array $valueDefinitions = [])
  18.     {
  19.         $this->definition $definition;
  20.         $this->valueDefinitions $valueDefinitions;
  21.     }
  22.     public function addToValueDefinitions(string $identifierValueDefinitionInterface $valueDefinition): void
  23.     {
  24.         $this->valueDefinitions[$identifier] = $valueDefinition;
  25.     }
  26.     public function getValueDefinitions(): array
  27.     {
  28.         return $this->valueDefinitions;
  29.     }
  30.     public function getDefinition(): ValueDefinitionGroupInterface
  31.     {
  32.         return $this->definition;
  33.     }
  34.     public function getIterator()
  35.     {
  36.         return new \ArrayIterator($this->valueDefinitions);
  37.     }
  38. }