getLastNotificationByCategory() public method

Get last notification of the current entity of a specific category.
public getLastNotificationByCategory ( $category, $toId, $entity, Closur\Closure $filterScope = null ) : mixed
$category
$toId
$entity
$filterScope Closur\Closure
return mixed
 /**
  * Get last notification of the
  * given entity of the specific category
  *
  * @param         $category
  * @param         $to_id
  * @param Closure $filterScope
  * @return mixed
  */
 public function getLastNotificationByCategory($category, $to_id, Closure $filterScope = null)
 {
     return $this->notifynderRepo->getLastNotificationByCategory($category, $to_id, $this->entity, $filterScope);
 }
Ejemplo n.º 2
0
 /** @test */
 public function it_get_last_notification_of_the_current_entity_filtering_by_category(NotificationDB $notificationRepo)
 {
     $id = 1;
     $category = 'notifynder.category';
     $notificationRepo->getLastNotificationByCategory($category, $id, null, null)->shouldBeCalled()->willReturn(new Notification());
     $this->getLastNotificationByCategory($category, $id)->shouldReturnAnInstanceOf(Notification::class);
 }
Ejemplo n.º 3
0
 /**
  * Get last notification of the
  * given entity of the specific category
  *
  * @param $category
  * @param $to_id
  * @return mixed
  */
 public function getLastNotificationByCategory($category, $to_id)
 {
     return $this->notifynderRepo->getLastNotificationByCategory($category, $to_id, $this->entity);
 }