protected function getFiltersAsArray()
    {
        $filters = $this->getSession('filters');

        foreach ($filters as $key => $value) {
            if ($value instanceof ArrayCollection) {
                $filters[$key] = $filters[$key]->map(
                    function ($entity) {
                        return $entity->getId();
                    }
                )->toArray();

            } else if (is_array($value)) {
                foreach ($value as $_key => $_value) {
                    if ($this->filterIsEntity($_value)) {
                        $filters[$key][$_key] = $_value->getId();
                    }
                }

            } else if ($this->filterIsEntity($value)) {
                $filters[$key] = $value->getId();
            }
        }

        return $filters;
    }
protected function getFiltersAsArray()
    {
        $filters = $this->getSession('filters');

        foreach ($filters as $key => $value) {
            if ($value instanceof ArrayCollection) {
                $filters[$key] = $filters[$key]->map(
                    function ($entity) {
                        return $entity->getId();
                    }
                )->toArray();

            } else if (is_array($value)) {
                foreach ($value as $_key => $_value) {
                    if ($this->filterIsEntity($_value)) {
                        $filters[$key][$_key] = $_value->getId();
                    }
                }

            } else if ($this->filterIsEntity($value)) {
                $filters[$key] = $value->getId();
            }
        }

        return $filters;
    }
protected function getFiltersAsArray ( ) { $ filters = $ this -> getSession ( 'filters' ) ; foreach ( $ filters as $ key => $ value ) { if ( $ value instanceof ArrayCollection ) { $ filters [ $ key ] = $ filters [ $ key ] -> map ( function ( $ entity ) { return $ entity -> getId ( ) ; } ) -> toArray ( ) ; } else if ( is_array ( $ value ) ) { foreach ( $ value as $ _key => $ _value ) { if ( $ this -> filterIsEntity ( $ _value ) ) { $ filters [ $ key ] [ $ _key ] = $ _value -> getId ( ) ; } } } else if ( $ this -> filterIsEntity ( $ value ) ) { $ filters [ $ key ] = $ value -> getId ( ) ; } } return $ filters ; }
Retrieves the filters from the session as an array,
possibly multi dimensional.
It will try to

@return array
Retrieves the filters from the session as an array possibly multi dimensional . It will try to