Form/DataTransformer/RestCollectionTransformer.php 1 location
|
@@ 126-133 (lines=8) @@
|
| 123 |
|
* |
| 124 |
|
* @return mixed |
| 125 |
|
*/ |
| 126 |
|
protected function getEntityIdentifier(ClassMetadata $metadata, $entity) |
| 127 |
|
{ |
| 128 |
|
if (count($metadata->getIdentifierFieldNames()) !== 1) { |
| 129 |
|
throw new \RuntimeException('Only one identifier allowed at this time.'); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
return $metadata->getIdentifierValues($entity)[$metadata->getIdentifierFieldNames()[0]]; |
| 133 |
|
} |
| 134 |
|
} |
| 135 |
|
|
Form/DataTransformer/RestEntityTransformer.php 1 location
|
@@ 94-101 (lines=8) @@
|
| 91 |
|
* |
| 92 |
|
* @return mixed |
| 93 |
|
*/ |
| 94 |
|
protected function getEntityIdentifier(ClassMetadata $metadata, $entity) |
| 95 |
|
{ |
| 96 |
|
if (count($metadata->getIdentifierFieldNames()) !== 1) { |
| 97 |
|
throw new RuntimeException('Only one identifier allowed at this time.'); |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
return $metadata->getIdentifierValues($entity)[$metadata->getIdentifierFieldNames()[0]]; |
| 101 |
|
} |
| 102 |
|
} |
| 103 |
|
|