src/Filterer/Filterer.php
public function setFilters($filters)
    {

        if (!is_array($filters)) {

            $this->clearFilters();
            foreach(explode('|', $filters) as $filter) {
                // searching for optional params
                $params = [];
                if (strpos($filter, ':')) {
                    list($filter, $params) = explode(':', $filter);
                    $params = (array) explode(',', $params);
                }

                $this->addFilter($filter, null, ...$params);
            }
        } else {
            $this->filters = $filters;
        }

        return $this;
    }
public function setFilters($filters)
    {

        if (!is_array($filters)) {

            $this->clearFilters();
            foreach(explode('|', $filters) as $filter) {
                // searching for optional params
                $params = [];
                if (strpos($filter, ':')) {
                    list($filter, $params) = explode(':', $filter);
                    $params = (array) explode(',', $params);
                }

                $this->addFilter($filter, null, ...$params);
            }
        } else {
            $this->filters = $filters;
        }

        return $this;
    }
public function setFilters ( $ filters ) { if ( ! is_array ( $ filters ) ) { $ this -> clearFilters ( ) ; foreach ( explode ( '|' , $ filters ) as $ filter ) { // searching for optional params $ params = [ ] ; if ( strpos ( $ filter , ':' ) ) { list ( $ filter , $ params ) = explode ( ':' , $ filter ) ; $ params = ( array ) explode ( ',' , $ params ) ; } $ this -> addFilter ( $ filter , null , ... $ params ) ; } } else { $ this -> filters = $ filters ; } return $ this ; }
Set all filter as an array

@param $filters
@return $this
Set all filter as an array