| 1 | <?php |
||
| 20 | final class ObjectToIdentifierTransformer implements ParameterTransformerInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var ObjectRepository |
||
| 24 | */ |
||
| 25 | private $repository; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $identifier; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param ObjectRepository $repository |
||
| 34 | * @param string $identifier |
||
| 35 | */ |
||
| 36 | public function __construct(ObjectRepository $repository, $identifier = 'id') |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | public function transform($value) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | public function reverseTransform($value) |
||
| 71 | } |
||
| 72 |