Lines Matching refs:metadata

90     public function set(Metadata $metadata)  argument
92 if ($metadata instanceof MetadataTabular) {
94 $this->syncTabular($metadata);
98 …throw new ExceptionRuntime("The metadata ($metadata) is not yet supported on set", self::CANONICAL…
102 public function get(Metadata $metadata, $default = null) argument
105 $resource = $metadata->getResource();
110 if ($metadata instanceof MetadataTabular) {
112 return $this->getDbTabularData($metadata);
124 return $database->getFromRow($metadata->getName());
132 private function syncTabular(MetadataTabular $metadata) argument
136 $uid = $metadata->getUidObject();
138 …throw new ExceptionRuntimeInternal("The uid class should be defined for the metadata ($metadata)");
141 $sourceRows = $metadata->toStoreValue();
146 $targetRows = $this->getDbTabularData($metadata);
152 $this->deleteRow($targetRow, $metadata);
157 $this->addRow($sourceRow, $metadata);
165 * @param Metadata $metadata
168 private function addRow(array $row, Metadata $metadata): void argument
174 $resourceCombo = $metadata->getResource();
185 $tableName = $this->getTableName($metadata);
202 * @param Metadata $metadata
204 private function deleteRow(array $row, Metadata $metadata): void argument
206 $tableName = $this->getTableName($metadata);
207 $resourceIdAttribute = $metadata->getResource()->getUidObject()::getPersistentName();
208 $metadataIdAttribute = $metadata->getUidObject()::getPersistentName();
237 private function getDbTabularData(Metadata $metadata): array argument
248 $children = $metadata->getChildrenObject();
250 …throw new ExceptionRuntimeInternal("The children of the tabular metadata ($metadata) should be set…
256 $tableName = $this->getTableName($metadata);
268 …eptionRuntimeInternal("An exception has occurred with the $tableName ({$metadata->getResource()}) …
313 private function getTableName(Metadata $metadata): string argument
315 return $metadata->getResource()->getType() . "_" . $metadata::getPersistentName();