コード例 #1
0
 private function createNotificationsForEachToWhom()
 {
     try {
         foreach ($this->getToWhom() as $who) {
             $uuid = $this->generateNewId()->toString();
             $notify_builder = new NoticeCreateBuilder($to_id = $who, $to_type = $this->getToType(), $from_id = $this->getFrom(), $from_type = $this->getFromType(), $message_id = $this->getMessageId(), $category_id = $this->getCategory());
             $notify_builder->setId($uuid);
             $notice_made = Notify::create($notify_builder);
             $this->setNotificationsMade($notice_made);
         }
     } catch (\Exception $e) {
         throw new \Exception(sprintf("Error making notice for each person %s", $e->getMessage()));
     }
 }