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));
     }
 }
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Highlight', [new TextAttribute('title', $this, ['mandatory' => true, 'min_length' => 2], $parent_attribute), new TextAttribute('description', $this, [], $parent_attribute), new TextAttribute('ignored', $this, [], $parent_attribute)], new Options([]), $parent, $parent_attribute);
 }
Beispiel #3
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Badge', [new Text('award', $this, [], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }
Beispiel #4
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);
 }
Beispiel #5
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Profile', [new Text('alias', $this, [], $parent_attribute), new TextListAttribute('tags', $this, [], $parent_attribute), new EntityReferenceListAttribute('teams', $this, ['entity_types' => [EntityType::NAMESPACE_PREFIX . 'Player\\Reference\\TeamType']], $parent_attribute), new EmbeddedEntityListAttribute('badges', $this, ['entity_types' => [EntityType::NAMESPACE_PREFIX . 'Player\\Embed\\BadgeType']], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }
Beispiel #6
0
 public function __construct(EntityTypeInterface $parent = null, AttributeInterface $parent_attribute = null)
 {
     parent::__construct('Profile', [new Text('nickname', $this, [], $parent_attribute), new Text('alias', $this, [], $parent_attribute), new TextListAttribute('tags', $this, [], $parent_attribute), new EmbeddedEntityListAttribute('badges', $this, ['entity_types' => ['\\Honeybee\\Tests\\Fixture\\GameSchema\\Model\\Game\\Embed\\BadgeType']], $parent_attribute), new EntityReferenceListAttribute('memberships', $this, ['entity_types' => ['\\Honeybee\\Tests\\Fixture\\GameSchema\\Model\\Game\\Reference\\MembershipType']], $parent_attribute)], new Options(), $parent, $parent_attribute);
 }