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]; }
/** * 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); }
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); }
/** * {@inheritdoc} */ public function __construct($definition) { parent::__construct($definition); $this->handlers += array('storage' => 'Drupal\\Core\\Entity\\Sql\\SqlContentEntityStorage', 'view_builder' => 'Drupal\\Core\\Entity\\EntityViewBuilder'); }
/** * @test */ public function it_allows_a_valid_type() { $type = new EntityType('production'); $this->assertEquals('production', $type->getType()); }
/** * {@inheritdoc} */ public function get() { $this->definition['group_label'] = $this->t('Content', array(), array('context' => 'Entity type group')); return parent::get(); }
/** * {@inheritdoc} */ public function __construct($definition) { parent::__construct($definition); $this->controllers += array('storage' => 'Drupal\\Core\\Entity\\ContentEntityDatabaseStorage'); }
function GetAllAttachnmentsByEntityId($entityId) { include_once CLASSFOLDER . "/attachments.php"; $attachment = new attachmentclass($this->internalDB); $entitytype = new EntityType(); return $attachment->getallattachments($entityId, $entitytype->getkey("Event")); }
/** * 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); }