コード例 #1
0
ファイル: notificationtest.php プロジェクト: farukuzun/core-1
 /**
  * @dataProvider dataSetParsedMessage
  * @param string $message
  */
 public function testSetParsedMessage($message)
 {
     $this->assertSame('', $this->notification->getParsedMessage());
     $this->assertSame($this->notification, $this->notification->setParsedMessage($message));
     $this->assertSame($message, $this->notification->getParsedMessage());
 }
コード例 #2
0
 /**
  * @param int $notificationId
  * @param INotification $notification
  * @return array
  */
 protected function notificationToArray($notificationId, INotification $notification)
 {
     $data = ['notification_id' => $notificationId, 'app' => $notification->getApp(), 'user' => $notification->getUser(), 'datetime' => $notification->getDateTime()->format('c'), 'object_type' => $notification->getObjectType(), 'object_id' => $notification->getObjectId(), 'subject' => $notification->getParsedSubject(), 'message' => $notification->getParsedMessage(), 'link' => $notification->getLink(), 'actions' => []];
     foreach ($notification->getParsedActions() as $action) {
         $data['actions'][] = $this->actionToArray($action);
     }
     return $data;
 }