Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created May 15, 2014 14:06
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/3efc807d8ec12e17bcb4 to your computer and use it in GitHub Desktop.
Save bakura10/3efc807d8ec12e17bcb4 to your computer and use it in GitHub Desktop.
class UserService
{
public function __construct(ObjectManager $manager, UserRepository $repo, EmailService $email, PaymentService $payment, SmsService $sms)
{
//
}
public function register(User $user)
{
$manager->persist($user);
$manager->flush();
$this->sendRegistrationEmail($user);
$this->sendSmsNotification($user);
$this->subscribeToPayment($user);
}
}
class UserService
{
public function __construct(ObjectManager $manager, UserRepository $repo)
{
//
}
public function register(User $user)
{
$manager->persist($user);
$manager->flush();
$this->evm->trigger('registered', new UserEvent($user))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment