Exemplo n.º 1
0
 public function __construct($name, array $attributes = [], OptionsInterface $options = null, EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct($name, $attributes, $options, $parent, $parent_attribute);
     if (!$this->hasOption(self::OPTION_IDENTIFYING_ATTRIBUTE_NAME)) {
         throw new RuntimeException(sprintf('Missing expected option "%s"', self::OPTION_IDENTIFYING_ATTRIBUTE_NAME));
     }
     if (!$this->hasOption(self::OPTION_REFERENCED_TYPE_CLASS)) {
         throw new RuntimeException(sprintf('Missing expected option "%s"', self::OPTION_REFERENCED_TYPE_CLASS));
     }
 }
Exemplo n.º 2
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Highlight', [new TextAttribute('title', $this, ['mandatory' => true], $parent_attribute), new TextAttribute('description', $this, [], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }
Exemplo n.º 3
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Challenge', [new IntegerAttribute('attempts', $this, [], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }
Exemplo n.º 4
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Badge', [new Text('award', $this, ['mirrored' => true], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }
Exemplo n.º 5
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Profile', [new Text('nickname', $this, [], $parent_attribute), new Text('alias', $this, ['mirrored' => true], $parent_attribute), new TextListAttribute('tags', $this, ['mirrored' => true], $parent_attribute), new EmbeddedEntityListAttribute('badges', $this, ['entity_types' => ['\\Honeybee\\Tests\\Fixture\\GameSchema\\Projection\\Game\\Embed\\BadgeType']], $parent_attribute), new EntityReferenceListAttribute('memberships', $this, ['attribute_alias' => 'teams', 'entity_types' => ['\\Honeybee\\Tests\\Fixture\\GameSchema\\Projection\\Game\\Reference\\MembershipType']], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }