| 1 | <?php |
||
| 13 | class RigidIdentifierHandler implements IdentifierHandlerInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Getter-method |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $getter; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Setter-method |
||
| 24 | * |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $setter; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * RigidIdentifierHandler constructor. |
||
| 31 | * |
||
| 32 | * @param string $getter |
||
| 33 | * @param string $setter Optional. Should not be set if "setIdentifier" have to be ignored |
||
| 34 | */ |
||
| 35 | 2 | public function __construct(string $getter, string $setter = null) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | 1 | public function getIdentifier($object, MappingContext $context): string |
|
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 1 | public function setIdentifier($object, string $identifier, MappingContext $context) |
|
| 60 | } |