Created
September 17, 2012 15:50
-
-
Save Swader/3738136 to your computer and use it in GitHub Desktop.
MyRole Teamleader Return sample
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
// usersRoles ima polje teamLeaderId. To je accountId od nekog accounta. | |
// Ako ja uradim $user->getRoles(), i dobijem array MyRoles instanci, onda mogu ovo | |
// Slanje maila teamleaderu nekog korisnika : | |
$user->setId(10); // Neki korisnik čijem teamleaderu želimo poslati mail | |
foreach ($user->getRoles() as $myRole) { | |
if ($myRole->getRole()->getSlug() == 'author') { | |
$oTeamLeader = $myRole->getTeamLeader(); | |
$mailer->( /* ... bla bla šalji mail ... */ ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment