Saves the filters inside the session.

@param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
@param array $filters
514806
protected function saveFilters(SessionInterface $session, array $filters)
    {
        $this->saveValues($filters, $this->getFilterPrefix(), $session);
    }
496006
public function release(Session $session)
    {
        $this->config['lock']->synchronize(function () use ($session) {
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = $item->get();
            $name = $session->name();

            if (isset($data['inUse'][$name])) {
                unset($data['inUse'][$name]);
                array_push($data['queue'], [
                    'name' => $name,
                    'expiration' => $session->expiration()
                        ?: $this->time() + SessionPoolInterface::SESSION_EXPIRATION_SECONDS
                ]);
                $this->cacheItemPool->save($item->set($data));
            }
        });
    }
714657
private function storeFilterValues(array $data)
    {
        $this->filterValues = $data;

        $session = new Session();

        foreach($this->filters as $datagridFilter) {
            if ($datagridFilter->getType() instanceof DatagridFilterTypeEntity) {
                if (!empty($this->filterValues[$datagridFilter->getName()])) {
                    $this->filterValues[$datagridFilter->getName()] = $this->filterValues[$datagridFilter->getName()]->getId();
                }
            }
        }

        $session->set($this->getStorageNamespace(), $this->filterValues);
    }
890138
public function setFilters(array $filters)
    {
        $this->filters = $filters;

        $this->updateInternalState();

        $this->handleChangedParameters();

        return $this;
    }
333989
private function prepareFilters(array $filters = [])
    {
        /** @var \common_session_Session $session */
        $session  = common_session_SessionManager::getSession();
        $timeZone = new DateTimeZone($session->getTimeZone());
        $utc      = new DateTimeZone('UTC');

        $result = [];

        foreach ($filters as $name => $value) {
            if (!empty($value)) {
                switch ($name) {
                    case 'from':
                        $from     = new DateTimeImmutable($filters['from'], $timeZone);
                        $result[] = ['occurred', '>', $from->setTimezone($utc)->format(DateTime::ISO8601)];
                        break;
                    case 'to':
                        $to       = new DateTimeImmutable($filters['to'], $timeZone);
                        $result[] = ['occurred', '<=', $to->setTimezone($utc)->format(DateTime::ISO8601)];
                        break;
                    default:
                        $result[] = [$name, 'LIKE', "%$value%"];
                }
            }
        }

        return $result;
    }
97314
public function addFilter(Filter $filter)
    {
        $key = $filter->getKey();
        $this->filters[$key] = $filter;
    }
18947
protected static function actionFilters($om, $action, array $filters): void
    {
        if ($om instanceof EntityManagerInterface) {
            $sqlFilters = $om->getFilters();

            foreach ($filters as $name) {
                if ($sqlFilters->isEnabled($name)
                        && ($filter = $sqlFilters->getFilter($name)) instanceof EnableFilterInterface) {
                    $filter->{$action}();
                } else {
                    $sqlFilters->{$action}($name);
                }
            }
        }
    }
383896
protected function collectGarbage( SessionInterface $session )
	{
		// Here we will see if this request hits the garbage collection lottery by hitting
		// the odds needed to perform garbage collection on any given request. If we do
		// hit it, we'll call this handler to let it delete all the expired sessions.
		if ( $this->configHitsLottery() )
			$session->getHandler()->gc( $this->getSessionLifetimeInSeconds() );
	}
715799
public function setFilters($filters)
    {
        if ($filters === null)
            $filters = [];
        else if (!is_array($filters))
            throw new \Exception('Filters should be null or array');

        foreach ($filters as $column => $filter) {
            $found = [];
            foreach ($this->getColumns() as $id => $params) {
                if ($id == $column) {
                    foreach ($filter as $name => $value) {
                        if (in_array($name, $params['filters']))
                            $found[$name] = $value;
                    }
                    break;
                }
            }

            if (count($found) > 0)
                $filters[$column] = $found;
            else
                unset($filters[$column]);
        }

        $this->filters = $filters;
        return $this;
    }
1033261
public function addFilter(FilterInterface $filter) : Reader
    {
        foreach ($this->parsers as $parser) {
            $parser->addFilter($filter);
        }

        return $this;
    }
203414
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;
    }
404238
public function leave(Session $session)
    {
        // remove all registrations that belong to this session
        /* @var $registration \Thruway\Registration */
        foreach ($this->registrations as $i => $registration) {
            if ($registration->getSession() === $session) {
                // if this session is the callee on pending calls - error them out
                $registration->errorAllPendingCalls();
                array_splice($this->registrations, $i, 1);
            }
        }
    }
1336107
public function removeFilter(FilterInterface $filter)
    {

        $this->filters = array_filter($this->filters, function (FilterInterface $f) use ($filter) {

            return $f !== $filter;
        });

        return $this;
    }
500263
public function withFilters(array $filters = null)
    {
        if ($filters) {
            foreach ($filters as $filter) {
                switch ($filter['type']) {
                    case 'select':
                        $this->select($filter['fields']);
                        break;
                    case 'andWhere':
                        $this->andWhere($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'orWhere':
                        $this->orWhere($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'andHaving':
                        $this->andHaving($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'orHaving':
                        $this->orHaving($filter['field'], $filter['operation'], $filter['value']);
                        break;
                    case 'addGroupBy':
                        $this->addGroupBy($filter['field']);
                        break;
                    case 'addOrderBy':
                        $this->addOrderBy($filter['field'], $filter['order']);
                        break;
                    case 'fkAddOrderBy':
                        $this->fkAddOrderBy($filter['field'], $filter['fkField'], $filter['order']);
                        break;
                    case 'paginate':
                        if (isset($filter['page'])) {
                            $this->paginate($filter['limit'], $filter['page']);
                        } else {
                            $this->paginate($filter['limit']);
                        }
                        break;
                }
            }
        }

        return $this;
    }
178573
public function setFilters($filters)
    {
        $this->filters = Collection::make($filters);
        foreach ($this->filters as $filterConfig) {
            $filterConfig->attach($this);
        }

        return $this;
    }
856732
public static function initialize(Session $session) : void
    {
        static::$_session = $session;

        if(!static::$_session->keyExists("_RESULTS")) {
            static::$_session->set("_RESULTS", []);
        }
    }
1287990
public function save(EntityInterface $entity)
    {
        $entity = $this->beforeSave($entity);

        $this->getEntityManager()->persist($entity);
        $this->getEntityManager()->flush($entity);

        $this->afterSave($entity);
    }