Ejemplo n.º 1
0
 public static function getTypeName($typeId)
 {
     if (!isset(self::$id_or_name_mapping[$typeId])) {
         $type = EntityType::get($typeId);
         self::$id_or_name_mapping["_id_" . $typeId] = $type != null ? $type->typeName : null;
     }
     return self::$id_or_name_mapping["_id_" . $typeId];
 }
Ejemplo n.º 2
0
 /**
  * Returns the default attributes that are initially added to a aggregate_root_type upon creation.
  *
  * @return array A list of AttributeInterface implementations.
  */
 public function getDefaultAttributes()
 {
     $default_attributes = [new TextAttribute('identifier', $this), new IntegerAttribute('revision', $this, ['default_value' => 0]), new UuidAttribute('uuid', $this, ['default_value' => 'auto_gen']), new TextAttribute('language', $this, ['default_value' => 'de_DE']), new IntegerAttribute('version', $this, ['default_value' => 1]), new TextAttribute('workflow_state', $this), new KeyValueListAttribute('workflow_parameters', $this)];
     if ($this->isHierarchical()) {
         $default_attributes[] = new TextAttribute('parent_node_id', $this);
     }
     $default_attributes_map = new AttributeMap($default_attributes);
     return parent::getDefaultAttributes()->append($default_attributes_map);
 }
Ejemplo n.º 3
0
 function removeAttachments($entityId, $fileNames)
 {
     include_once CLASSFOLDER . "/enums/commonenums.php";
     $entityType = new EntityType();
     include_once CLASSFOLDER . "/attachments.php";
     $attachment = new attachmentclass($this->internalDB);
     return $attachment->removeEntityFilesNotExistsInGivenList($entityId, $entityType->getkey(EVENT), $fileNames);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function __construct($definition)
 {
     parent::__construct($definition);
     $this->handlers += array('storage' => 'Drupal\\Core\\Entity\\Sql\\SqlContentEntityStorage', 'view_builder' => 'Drupal\\Core\\Entity\\EntityViewBuilder');
 }
Ejemplo n.º 5
0
 /**
  * @test
  */
 public function it_allows_a_valid_type()
 {
     $type = new EntityType('production');
     $this->assertEquals('production', $type->getType());
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function get()
 {
     $this->definition['group_label'] = $this->t('Content', array(), array('context' => 'Entity type group'));
     return parent::get();
 }
Ejemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function __construct($definition)
 {
     parent::__construct($definition);
     $this->controllers += array('storage' => 'Drupal\\Core\\Entity\\ContentEntityDatabaseStorage');
 }
Ejemplo n.º 8
0
 function GetAllAttachnmentsByEntityId($entityId)
 {
     include_once CLASSFOLDER . "/attachments.php";
     $attachment = new attachmentclass($this->internalDB);
     $entitytype = new EntityType();
     return $attachment->getallattachments($entityId, $entitytype->getkey("Event"));
 }
Ejemplo n.º 9
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);
 }