コード例 #1
0
ファイル: Message.php プロジェクト: miteshchavada/clubmaster
 private function processUsers(\Club\MessageBundle\Entity\Message $message, $users)
 {
     foreach ($users as $user) {
         if ($message->getType() == 'mail') {
             $this->addRecipient($message, $user);
         }
     }
 }
コード例 #2
0
 /**
  * @Route("/message/add/{id}")
  * @Template()
  */
 public function messageAddAction(\Club\MessageBundle\Entity\Message $message)
 {
     $em = $this->getDoctrine()->getManager();
     $filter = $em->getRepository('ClubUserBundle:Filter')->findActive($this->getUser());
     $users = $em->getRepository('ClubUserBundle:User')->getUsersListWithPagination($filter);
     foreach ($users as $u) {
         $message->addUser($u);
     }
     $em->persist($message);
     $em->flush();
     $this->get('session')->getFlashBag()->add('notice', $this->get('translator')->trans('Your changes are saved.'));
     return $this->redirect($this->generateUrl('club_message_adminmessage_edit', array('id' => $message->getId())));
 }
コード例 #3
0
 /**
  * @Route("/recipients/{id}")
  * @Template()
  */
 public function recipientsAction(\Club\MessageBundle\Entity\Message $message)
 {
     return array('message' => $message, 'recipients' => $message->getMessageRecipients());
 }