getAll() публичный Метод

You can also limit the number of Notifications if you don't, it will get all.
public getAll ( $toId, $entity, null $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$entity
$limit null
$paginate integer | null
$orderDate string
$filterScope Closur\Closure
Результат mixed
 /**
  * Get All notifications
  *
  * @param           $to_id
  * @param           $limit
  * @param  int|null $paginate
  * @param  string   $orderDate
  * @param Closure   $filterScope
  * @return mixed
  */
 public function getAll($to_id, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null)
 {
     $notifications = $this->notifynderRepo->getAll($to_id, $this->entity, $limit, $paginate, $orderDate, $filterScope);
     if (is_int(intval($paginate)) && $paginate) {
         return new LengthAwarePaginator($notifications->parse(), $notifications->total(), $limit, $paginate, ['path' => LengthAwarePaginator::resolveCurrentPath()]);
     }
     return $notifications->parse();
 }
Пример #2
0
 /**
  * Get All notifications
  *
  * @param         $to_id
  * @param         $limit
  * @param  int|null $paginate
  * @param  string $orderDate
  * @return mixed
  */
 public function getAll($to_id, $limit = null, $paginate = null, $orderDate = 'desc')
 {
     $notifications = $this->notifynderRepo->getAll($to_id, $this->entity, $limit, $paginate, $orderDate);
     if (is_int(intval($paginate)) && !is_null($paginate)) {
         return new Paginator($notifications->parse(), $limit, $paginate, ['path' => Paginator::resolveCurrentPath()]);
     }
     return $notifications->parse();
 }
 /**
  * Get All notifications
  *
  * @param         $to_id
  * @param         $limit
  * @param         $paginate
  * @param  string $orderDate
  * @return mixed
  */
 public function getAll($to_id, $limit = null, $paginate = false, $orderDate = 'desc')
 {
     $notifications = $this->notifynderRepo->getAll($to_id, $this->entity, $limit, $paginate, $orderDate);
     if ($paginate) {
         return (new Paginator($notifications->parse()->toArray(), $limit))->toArray();
     }
     return $notifications->parse();
 }
Пример #4
0
 /**
  * Get All notifications.
  *
  * @param           $toId
  * @param           $limit
  * @param  int|null $paginate
  * @param  string   $orderDate
  * @param Closure   $filterScope
  * @return mixed
  */
 public function getAll($toId, $limit = null, $paginate = null, $orderDate = 'desc', Closure $filterScope = null)
 {
     $queryLimit = $limit;
     if ($this->isPaginated($paginate)) {
         $queryLimit = null;
     }
     $notifications = $this->notifynderRepo->getAll($toId, $this->entity, $queryLimit, null, $orderDate, $filterScope);
     return $this->getPaginatedIfNeeded($notifications, $limit, $paginate);
 }
Пример #5
0
 /** @test */
 public function it_get_all_notifications_of_the_given_entity(NotificationDB $notificationRepo, NotifynderCollection $collection)
 {
     $entity_id = 1;
     $limit = 10;
     $paginate = null;
     $notificationRepo->getAll($entity_id, null, $limit, $paginate, 'desc', null)->shouldBeCalled()->willReturn($collection);
     $collection->parse()->shouldBeCalled()->willReturn([]);
     $this->getAll($entity_id, $limit, $paginate)->shouldReturn([]);
 }