Created
September 12, 2012 09:55
-
-
Save Swader/3705658 to your computer and use it in GitHub Desktop.
Fetching roles for a user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use case for StaffHandler -> fetching roles for a user | |
/* This is only valid if you're doing it | |
* in the IntechController - and ONLY if you have previously | |
* defined $this->oRegistry as | |
* $this->oRegistry = $this->getRegistry(); | |
*/ | |
$oStaffHandler = new StaffHandler($this->oRegistry->get('StaffMapper')); | |
$oEntity = new Entity(Entity::SELF, 0); // <-- looking for roles 'on himself' (HIS roles) | |
$oUser = new User($this->oRegistry->get('UserMapper')); | |
$oUser->setId($iAccountId); | |
$aRoles = $oStaffHandler->setEntity($oEntity)->setUser($oUser)->fetchRelationships(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment