Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created July 27, 2012 12:19
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 bakura10/3187633 to your computer and use it in GitHub Desktop.
Save bakura10/3187633 to your computer and use it in GitHub Desktop.
class Thread extends AbstractService
{
/**
* @param ThreadEntity $thread
*/
public function create(ThreadEntity $thread)
{
// I'm in a module, it does not have idea of what the specific application needs... but in my application, I need to add // another specific participant...
$user = $this->getAuthenticationService()->getIdentity();
$thread->addParticipant($user);
$this->getEntityManager()->persist($thread);
$this->getEntityManager()->flush();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment