| 1 | <?php |
||
| 14 | class UserStrategy implements StrategyInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var UserRepositoryInterface |
||
| 18 | */ |
||
| 19 | protected $userRepository; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param UserRepositoryInterface $userRepository |
||
| 23 | */ |
||
| 24 | public function __construct(UserRepositoryInterface $userRepository) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Convert the User object to it's ID |
||
| 31 | * |
||
| 32 | * @param UserInterface $value |
||
| 33 | * @return int User ID |
||
| 34 | */ |
||
| 35 | public function extract($value) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Convert the User Id to a User object |
||
| 46 | * |
||
| 47 | * @param mixed $value The original value. |
||
| 48 | * @return UserInterface |
||
| 49 | */ |
||
| 50 | public function hydrate($value) |
||
| 54 | } |
||
| 55 |