Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class MyUserStorage {
- ...
- public function setIdentity(IIdentity $identity = NULL) {
- // ukladma pouze id
- $this->getSessionSection(TRUE)->identityId = $identity ? $identity->getId() : null;
- return $this;
- }
- public function getIdentity() {
- if(!$session = $this->getSessionSection(FALSE)) return NULL;
- if(!$id = $session->identityId) return NULL;
- // nactu z doctrine
- return $this->em->getRepository(IdentityEntity::getClassName())->find($id);
- }
Advertisement
Add Comment
Please, Sign In to add comment