findByUserAndContextAndLocale() public method

Searches for all filters of a user by context and locale includes filters without a user which were e.g. created by fixtures.
public findByUserAndContextAndLocale ( string $locale, string $context, string | integer $userId ) : mixed
$locale string
$context string
$userId string | integer
return mixed
Example #1
0
 /**
  * Finds all filters filtered by context and user and
  * for the given locale.
  *
  * @param string $context
  * @param $userId
  * @param string $locale
  *
  * @return \Sulu\Bundle\ResourceBundle\Api\Filter[]
  */
 public function findFiltersForUserAndContext($context, $userId, $locale)
 {
     $filters = $this->filterRepository->findByUserAndContextAndLocale($locale, $context, $userId);
     array_walk($filters, function (&$filter) use($locale) {
         $filter = new Filter($filter, $locale);
     });
     return $filters;
 }