| 1 | <?php |
||
| 8 | class ZfcUserIdentity extends AbstractHelper |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var AuthenticationService |
||
| 12 | */ |
||
| 13 | protected $authService; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * __invoke |
||
| 17 | * |
||
| 18 | * @access public |
||
| 19 | * @return \ZfcUser\Entity\UserInterface |
||
| 20 | */ |
||
| 21 | public function __invoke() |
||
| 22 | { |
||
| 23 | if ($this->getAuthService()->hasIdentity()) { |
||
| 24 | return $this->getAuthService()->getIdentity(); |
||
| 25 | } else { |
||
| 26 | return false; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get authService. |
||
| 32 | * |
||
| 33 | * @return AuthenticationService |
||
| 34 | */ |
||
| 35 | public function getAuthService() |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Set authService. |
||
| 42 | * |
||
| 43 | * @param AuthenticationService $authService |
||
| 44 | * @return \ZfcUser\View\Helper\ZfcUserIdentity |
||
| 45 | */ |
||
| 46 | public function setAuthService(AuthenticationService $authService) |
||
| 51 | } |
||
| 52 |