src/Phlexible/Bundle/MessageBundle/Entity/Repository/FilterRepository.php
public function findApplicableFiltersByMessage(Message $message, $handler = null)
    {
        if ($handler) {
            $filters = $this->findByHandler($handler);
        } else {
            $filters = $this->findAll();
        }

        $applicableFilters = [];

        $checker = new MessageChecker();
        foreach ($filters as $filter) {
            if (!$checker->checkByFilter($filter, $message)) {
                continue;
            }

            $applicableFilters[] = $filter;
        }

        return $applicableFilters;
    }
public function findApplicableFiltersByMessage(Message $message, $handler = null)
    {
        if ($handler) {
            $filters = $this->findByHandler($handler);
        } else {
            $filters = $this->findAll();
        }

        $applicableFilters = [];

        $checker = new MessageChecker();
        foreach ($filters as $filter) {
            if (!$checker->checkByFilter($filter, $message)) {
                continue;
            }

            $applicableFilters[] = $filter;
        }

        return $applicableFilters;
    }
public function findApplicableFiltersByMessage ( Message $ message , $ handler = null ) { if ( $ handler ) { $ filters = $ this -> findByHandler ( $ handler ) ; } else { $ filters = $ this -> findAll ( ) ; } $ applicableFilters = [ ] ; $ checker = new MessageChecker ( ) ; foreach ( $ filters as $ filter ) { if ( ! $ checker -> checkByFilter ( $ filter , $ message ) ) { continue ; } $ applicableFilters [ ] = $ filter ; } return $ applicableFilters ; }
Return all filters applicable for a message.

@param Message $message
@param string  $handler

@return Filter[]
Return all filters applicable for a message .