| @@ 385-394 (lines=10) @@ | ||
| 382 | * @return mixed |
|
| 383 | * @throws \Nnx\JmsSerializerModule\DoctrineObjectEngine\Exception\RuntimeException |
|
| 384 | */ |
|
| 385 | public function getDoctrineEntityByDataContainer(DataContainer\EntityInterface $dataItem) |
|
| 386 | { |
|
| 387 | $dataItemId = $dataItem->getId(); |
|
| 388 | if (!array_key_exists($dataItemId, $this->dataContainerIdToDoctrineEntity)) { |
|
| 389 | $errMsg = sprintf('Doctrine entity not found for data container: id# %s', $dataItemId); |
|
| 390 | throw new Exception\RuntimeException($errMsg); |
|
| 391 | } |
|
| 392 | ||
| 393 | return $this->dataContainerIdToDoctrineEntity[$dataItemId]; |
|
| 394 | } |
|
| 395 | ||
| 396 | /** |
|
| 397 | * Подготовка критериев для поиска в базе данных |
|
| @@ 127-136 (lines=10) @@ | ||
| 124 | * @return string |
|
| 125 | * @throws \Nnx\JmsSerializerModule\DoctrineObjectEngine\Exception\RuntimeException |
|
| 126 | */ |
|
| 127 | public function getEntityClassNameByDataContainer(DataContainer\EntityInterface $dataItem) |
|
| 128 | { |
|
| 129 | $dataItemId = $dataItem->getId(); |
|
| 130 | if (!array_key_exists($dataItemId, $this->dataContainerIdToEntityClassName)) { |
|
| 131 | $errMsg = sprintf('Entity class name not found for data container:#id %s', $dataItemId); |
|
| 132 | throw new Exception\RuntimeException($errMsg); |
|
| 133 | } |
|
| 134 | ||
| 135 | return $this->dataContainerIdToEntityClassName[$dataItemId]; |
|
| 136 | } |
|
| 137 | ||
| 138 | ||
| 139 | /** |
|
| @@ 147-156 (lines=10) @@ | ||
| 144 | * @return array |
|
| 145 | * @throws \Nnx\JmsSerializerModule\DoctrineObjectEngine\Exception\RuntimeException |
|
| 146 | */ |
|
| 147 | public function getAssociationsForEntity(DataContainer\EntityInterface $dataItem) |
|
| 148 | { |
|
| 149 | $dataItemId = $dataItem->getId(); |
|
| 150 | if (!array_key_exists($dataItemId, $this->associationMap)) { |
|
| 151 | $errMsg = sprintf('Associations for data container id: %s not found', $dataItemId); |
|
| 152 | throw new Exception\RuntimeException($errMsg); |
|
| 153 | } |
|
| 154 | ||
| 155 | return $this->associationMap[$dataItemId]; |
|
| 156 | } |
|
| 157 | ||
| 158 | /** |
|
| 159 | * Проверяет есть ли для контейнера с данными связанная ассоциация |
|