Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // src/BlogBundle/Service/PostTest
- namespace BlogBundle\Service;
- use BlogBundle\Entity\Post;
- use BlogBundle\Repository\PostRepository;
- class PostTest
- {
- /** @var PostRepository */
- private $repository;
- /** @var SubscriberNotifier */
- private $notifier;
- function __construct(PostRepository $repository, SubscriberNotifier $notifier)
- {
- $this->repository = $repository;
- $this->notifier = $notifier;
- }
- public function create(Post $post)
- {
- $this->repository->persist($post);
- $this->notifier->notifyCreate($post);
- }
- }
- https://github.com/shfx17
Add Comment
Please, Sign In to add comment