Ejemplo n.º 1
0
 /**
  * Returns the default attributes that are initially added to a aggregate_root_type upon creation.
  *
  * @return AttributeMap A map of AttributeInterface implementations.
  */
 public function getDefaultAttributes()
 {
     $default_attributes = [new TextAttribute('identifier', $this), new IntegerAttribute('revision', $this, ['default_value' => 0]), new UuidAttribute('uuid', $this), new TextAttribute('language', $this, ['default_value' => 'de_DE']), new IntegerAttribute('version', $this, ['default_value' => 1]), new TimestampAttribute('created_at', $this), new TimestampAttribute('modified_at', $this), new TextAttribute('workflow_state', $this), new KeyValueListAttribute('workflow_parameters', $this), new KeyValueListAttribute('metadata', $this)];
     if ($this->isHierarchical()) {
         $default_attributes[] = new TextAttribute('parent_node_id', $this);
         $default_attributes[] = new TextAttribute('materialized_path', $this);
     }
     $default_attributes_map = new AttributeMap($default_attributes);
     return parent::getDefaultAttributes()->append($default_attributes_map);
 }
Ejemplo n.º 2
0
 /**
  * Returns the default attributes that are initially added to a aggregate_type upon creation.
  *
  * @return AttributeMap A map of AttributeInterface implementations.
  */
 public function getDefaultAttributes()
 {
     $default_attributes = [new UuidAttribute('identifier', $this, [], $this->getParentAttribute())];
     $default_attributes_map = new AttributeMap($default_attributes);
     return parent::getDefaultAttributes()->append($default_attributes_map);
 }