Skip to content

Instantly share code, notes, and snippets.

@Swader
Created September 17, 2012 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Swader/3738136 to your computer and use it in GitHub Desktop.
Save Swader/3738136 to your computer and use it in GitHub Desktop.
MyRole Teamleader Return sample
// 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