コード例 #1
0
ファイル: RoleSearch.php プロジェクト: kamaroly/shift
 /**
  * Setup the required filters necessary for executing a role search request, based on the $input provided.
  *
  * @param $input
  * @return mixed
  */
 public function fromInput(array $input = [])
 {
     $filterCollection = new SearchFilterCollection();
     if (isset($input['keywords'])) {
         $filterCollection->add(KeywordFilter::fromKeywords($input['keywords']));
     }
     $filterCollection->add(OrderFilter::byInput($input));
     $roles = $this->roleRepository->getByFilters($filterCollection);
     return $roles;
 }
コード例 #2
0
ファイル: AccountSearch.php プロジェクト: kamaroly/shift
 /**
  * Setup the required filters necessary for executing a role search request, based on the $input provided.
  *
  * @param array $input
  * @return mixed
  */
 public function fromInput(array $input = [])
 {
     $filterCollection = new SearchFilterCollection();
     $filterCollection->add(new IncludeFilter('owner', 'domains'));
     if (isset($input['keywords'])) {
         $filterCollection->add(KeywordFilter::fromKeywords($input['keywords']));
     }
     $filterCollection->add(OrderFilter::byInput($input));
     $accounts = $this->accountRepository->getByFilters($filterCollection);
     return $accounts;
 }
コード例 #3
0
ファイル: UserSearch.php プロジェクト: kamaroly/shift
 /**
  * Setup the required filters necessary for executing a role search request, based on the $input provided.
  *
  * @param $input
  * @return mixed
  */
 public function fromInput(array $input = [])
 {
     $filterCollection = new SearchFilterCollection();
     if (isset($input['keywords'])) {
         $filterCollection->add(KeywordFilter::fromKeywords($input['keywords']));
     }
     $orderFilter = OrderFilter::byInput($input);
     $orderFilter->setDefaultField('users.id');
     $filterCollection->add($orderFilter);
     // @TODO: Only apply this if the user cannot manage accounts (aka, not a tectician)
     $filterCollection->add(new UserAccountFilter());
     $roles = $this->userRepository->getByFilters($filterCollection);
     return $roles;
 }
コード例 #4
0
ファイル: OrderFilterTest.php プロジェクト: kamaroly/shift
 /**
  * @expectedException \Exception
  */
 public function testInvalidSortDirection()
 {
     $filter = OrderFilter::byFieldAndDirection('field', 'invalid direction');
     $filter->applyToEloquent($this->query);
 }