Skip to content

Instantly share code, notes, and snippets.

@bakura10 bakura10/foo.php
Created May 15, 2014

Embed
What would you like to do?
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
You can’t perform that action at this time.