Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2.  
  3. class EntityListener {
  4.     public function onFlush(OnFlushEventArgs $event)
  5.     {
  6.         $this->emailActivityUpdates->processCreatedEntities($uow->getScheduledEntityInsertions());
  7.     }
  8.  
  9.     protected function addAssociationWithEmailActivity(PostFlushEventArgs $event) {
  10.         $jobs = $this->emailActivityUpdates->createJobs();
  11.         if (!$jobs) {
  12.             return;
  13.         }
  14.  
  15.         $em = $event->getEntityManager();
  16.         array_map([$em, 'persist'], $jobs);
  17.         $em->flush();
  18.     }
  19. }
  20.  
  21. class EmailActivityUpdates {
  22.     public function processCreatedEntities(array $entities) {}
  23.     public function createJobs() {}
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement