stores filter data in session

@return type
186397
public function store()
    {
        $inputs    = Input::all();
        $params    = array_get($inputs, 'params');
        $column    = $params['column'];
        $route     = uri();
        $session   = $this->request->session();
        $classname = array_get($inputs, 'classname');
        $data      = $this->prepareToSave($classname, $params, $session->get($route));

        $session->put($route, $data);
        $session->save();
        $data   = $this->prepareToSave($classname, $params, $session->get($route));
        $string = app($classname)->sidebar($data);
        if (strlen($string) > 0) {
            return response($string, 200);
        }

        $sidebar = $this->adapter->sidebar($column, $data[$column], $params['value']);
        return response($sidebar, 200);
    }
791681
private function persist()
    {
        $sessionBag = $this->session->getBag($this->getSessionBagKey());
        $sessionBag->set($this->getScope(), $this->filterAttributes());

        $databaseSessionBag = $this->session->getBag($this->getDatabaseSessionBagKey());
        $databaseSessionBag->set($this->getScope(), $this->filterAttributes(true));
    }
1335424
public function store() {

		$rules    = [];
		$nicename = [];
		foreach (\L::all() as $l) {
			$nicename['name_'.$l] = trans('admin.name_'.$l);
			$rules['name_'.$l]    = 'required';
		}
		$data = $this->validate(request(), $rules, [], $nicename);
		//$data            = request()->except(['_token', 'method']);
		$data['admin_id'] = admin()->user()->id;
		if (request('parent') == null) {
			$data['parent'] = null;
		}
		if (request()->hasFile('icon')) {
			$data['icon'] = it()->upload(request()->file('icon'), 'departments/'.time(), 'icon');
		}

		if (request()->has('color')) {
			$data['color'] = request('color');
		}
		if (request()->has('parent')) {
			$data['parent'] = request('parent');
		}
		Dep::create($data);
		session()->flash('success', trans('admin.added'));
		return back();
	}
558138
public function data()
    {
        $userService = $this->getServiceLocator()->get(tao_models_classes_UserService::class);
        $userLangService = $this->getServiceLocator()->get(UserLanguageServiceInterface::class);
        $page = $this->getRequestParameter('page');
        $limit = $this->getRequestParameter('rows');
        $sortBy = $this->getRequestParameter('sortby');
        $sortOrder = $this->getRequestParameter('sortorder');
        $filterQuery = $this->getRequestParameter('filterquery');
        $filterColumns = $this->getRequestParameter('filtercolumns');
        $start = $limit * $page - $limit;

        $fieldsMap = [
            'login' => GenerisRdf::PROPERTY_USER_LOGIN,
            'firstname' => GenerisRdf::PROPERTY_USER_FIRSTNAME,
            'lastname' => GenerisRdf::PROPERTY_USER_LASTNAME,
            'email' => GenerisRdf::PROPERTY_USER_MAIL,
            'guiLg' => GenerisRdf::PROPERTY_USER_UILG,
            'roles' => GenerisRdf::PROPERTY_USER_ROLES
        ];
        if ($userLangService->isDataLanguageEnabled()) {
            $fieldsMap['dataLg'] = GenerisRdf::PROPERTY_USER_DEFLG;
        }

        // sorting
        $order = array_key_exists($sortBy, $fieldsMap) ? $fieldsMap[$sortBy] : $fieldsMap['login'];

        // filtering
        $filters = [
            GenerisRdf::PROPERTY_USER_LOGIN => '*',
        ];

        if ($filterQuery) {
            if (!$filterColumns) {
                // if filter columns not set, search by all columns
                $filterColumns = array_keys($fieldsMap);
            }
            $filters = array_flip(array_intersect_key($fieldsMap, array_flip($filterColumns)));
            array_walk($filters, function (&$row, $key) use($filterQuery) {
                $row = $filterQuery;
            });
        }

        $options = array(
            'recursive' => true,
            'like' => true,
            'chaining' => count($filters) > 1 ? 'or' : 'and',
            'order' => $order,
            'orderdir' => strtoupper($sortOrder),
        );

        // get total user count...
        $total = $userService->getCountUsers($options, $filters);

        // get the users using requested paging...
        $users = $userService->getAllUsers(array_merge($options, [
            'offset' => $start,
            'limit' => $limit
        ]), $filters);

        $rolesProperty = $this->getProperty(GenerisRdf::PROPERTY_USER_ROLES);

        $response = new stdClass();
        $readonly = [];
        $index = 0;

        /** @var core_kernel_classes_Resource $user */
        foreach ($users as $user) {

            $propValues = $user->getPropertiesValues(array_values($fieldsMap));

            $roles = $user->getPropertyValues($rolesProperty);
            $labels = [];

            foreach ($roles as $uri) {
                $labels[] = $this->getResource($uri)->getLabel();
            }

            $id = tao_helpers_Uri::encode($user->getUri());
            $login = (string)current($propValues[GenerisRdf::PROPERTY_USER_LOGIN]);
            $firstName = empty($propValues[GenerisRdf::PROPERTY_USER_FIRSTNAME]) ? '' : (string)current($propValues[GenerisRdf::PROPERTY_USER_FIRSTNAME]);
            $lastName = empty($propValues[GenerisRdf::PROPERTY_USER_LASTNAME]) ? '' : (string)current($propValues[GenerisRdf::PROPERTY_USER_LASTNAME]);
            $uiRes = empty($propValues[GenerisRdf::PROPERTY_USER_UILG]) ? null : current($propValues[GenerisRdf::PROPERTY_USER_UILG]);
            if ($userLangService->isDataLanguageEnabled()) {
                $dataRes = empty($propValues[GenerisRdf::PROPERTY_USER_DEFLG]) ? null : current($propValues[GenerisRdf::PROPERTY_USER_DEFLG]);
                $response->data[$index]['dataLg'] = is_null($dataRes) ? '' : $dataRes->getLabel();
            }

            $response->data[$index]['id'] = $id;
            $response->data[$index]['login'] = $login;
            $response->data[$index]['firstname'] = $firstName;
            $response->data[$index]['lastname'] = $lastName;
            $response->data[$index]['email'] = (string)current($propValues[GenerisRdf::PROPERTY_USER_MAIL]);
            $response->data[$index]['roles'] = implode(', ', $labels);
            $response->data[$index]['guiLg'] = is_null($uiRes) ? '' : $uiRes->getLabel();

            $statusInfo = $this->getUserLocksService()->getStatusDetails($login);
            $response->data[$index]['lockable'] = $statusInfo['lockable'];
            $response->data[$index]['locked'] = $statusInfo['locked'];
            $response->data[$index]['status'] = $statusInfo['status'];

            if ($user->getUri() == LOCAL_NAMESPACE . TaoOntology::DEFAULT_USER_URI_SUFFIX) {
                $readonly[$id] = true;
            }

            $index++;
        }

        $response->page = floor($start / $limit) + 1;
        $response->total = ceil($total / $limit);
        $response->records = count($users);
        $response->readonly = $readonly;

        $this->returnJson($response, 200);
    }
146205
public function addAllFilters()
    {
        $fields = array_keys($this->getDataObjectInstance()->searchableFields());
        foreach ($fields as $fieldName) {
            $this->addDefaultFilters($fieldName);
        }

        return $this;
    }
422416
public function store()
    {
        try {
            $schedule = execute(new CreateScheduleCommand(
                Binput::get('name'),
                Binput::get('message', null, false, false),
                Binput::get('status'),
                Binput::get('scheduled_at'),
                Binput::get('completed_at'),
                Binput::get('components', [])
            ));
        } catch (QueryException $e) {
            throw new BadRequestHttpException();
        }

        return $this->item($schedule);
    }
158291
public function store()
    {
        $input      = Input::all();
        $user       = auth()->user();
        $attributes = [
            'user_id' => $user->hasRoles('member') ? $user->id : array_get($input, 'user'),
            'name'    => array_get($input, 'name'),
            'value'   => array_only($input, ['field_1', 'field_2'])
        ];

        $model = new ModuleRow($attributes);
        $form  = $this->form($model);
        if (!$form->isValid()) {
            return redirect_with_errors(handles('antares::sample_module/index/create'), $form->getMessageBag());
        }
        if (!$model->save()) {
            event('notifications.item_has_not_been_created', ['variables' => ['user' => $user, 'item' => $model]]);
            return redirect_with_message(handles('antares::sample_module/index'), trans('antares/sample_module::messages.save_error'), 'error');
        }
        event('notifications.item_has_been_created', ['variables' => ['user' => $user, 'item' => $model]]);
        return redirect_with_message(handles('antares::sample_module/index'), trans('antares/sample_module::messages.save_success'), 'success');
    }
15945
final private function __setDataFromFilter()
    {
        if ($this->template === 'app') {
            // Merge all incoming data from app to allow Sage add_filter support
            $this->data = array_merge($this->data, $this->incomingData);
        }
    }
839069
public function store(Request $request)
    {
        $query = $this->getQuery();

        try {
            if ($request->input('query')) {
                $filter = new Filter($this->manager->newEntity()->getTable(), $this->queryable);
                $filter->build($query, $request->input('query'));
            }
        } catch (QuerySyntaxException $e) {
            return $this->error(['code' => 'QUERY_SYNTAX_ERROR', 'message' => 'Syntax error']);
        }

        $params = $request->only($this->fillable);

        DB::beginTransaction();

        $result = new Result();

        $query->chunk(100, function ($resources) use ($params, &$result) {
            foreach ($resources as $resource) {
                $result->addErrors($this->getManager()->update($resource, $params)->getErrors());
            }
        });

        if (!$result->ok()) {
            DB::rollBack();

            return $this->response(['errors' => $result->getSimpleErrors()], Response::HTTP_BAD_REQUEST);
        }

        DB::commit();

        return $this->response(null, Response::HTTP_OK);
    }
835404
protected function _prepare_filter() {
		$post = \get_queried_object();

		if ( ! empty( $post->post_name ) ) {
			$this->slug = $post->post_name;
		}

		if ( ! empty( $post->post_type ) ) {
			$post_type       = \get_post_type_object( $post->post_type );
			$this->post_type = $post_type->name;
		}
	}
854093
protected function getFiltersType()
    {
        // var_dump($this->get('request')->query->all());exit;
        $form = $this->get('form.factory')->createNamed('filters', 'form', null, array(
            'action'          => $this->generateUrl($this->getRoutePrefix(), array(
                'sort'  => $this->get('request')->get('sort'),
                'order' => $this->get('request')->get('order'),
            )),
            'method'          => 'GET',
            'csrf_protection' => false,
            'attr'            => array(
                'class'    => 'form-inline',
            ),
        ));

        return $form;
    }
175286
public function getFiltering(): array
    {
        if ($this->filtering === null) {
            $this->filtering = $this->setFiltering();
        }

        return $this->filtering;
    }
514806
protected function saveFilters(SessionInterface $session, array $filters)
    {
        $this->saveValues($filters, $this->getFilterPrefix(), $session);
    }
1219266
public static function save_filter(stdclass $data, stdclass $persistant) {
        if (!isset($persistant->tool_customlang_filter)) {
            $persistant->tool_customlang_filter = array();
        }
        foreach ($data as $key => $value) {
            if ($key !== 'submit') {
                $persistant->tool_customlang_filter[$key] = serialize($value);
            }
        }
    }
783360
public function findSessionValues()
	{
		if (!ArraysHelper::testEmpty($this->filter) || ($this->page != 1) || !empty($this->sort)) {
			return;
		}

		if (!$this->remember_state) {
			return;
		}

		if ($page = $this->getSessionData('_grid_page')) {
			$this->page = $page;
		}

		if ($per_page = $this->getSessionData('_grid_per_page')) {
			$this->per_page = $per_page;
		}

		if ($sort = $this->getSessionData('_grid_sort')) {
			$this->sort = $sort;
		}

		foreach ($this->getSessionData() as $key => $value) {
			$other_session_keys = [
				'_grid_per_page',
				'_grid_sort',
				'_grid_page',
				'_grid_has_sorted',
				'_grid_has_filtered',
				'_grid_hidden_columns',
				'_grid_hidden_columns_manipulated',
			];

			if (!in_array($key, $other_session_keys, true)) {
				try {
					$this->getFilter($key);

					$this->filter[$key] = $value;

				} catch (DataGridException $e) {
					if ($this->strict_session_filter_values) {
						throw new DataGridFilterNotFoundException("Session filter: Filter [$key] not found");
					}
				}
			}
		}

		/**
		 * When column is sorted via custom callback, apply it
		 */
		if (empty($this->sort_callback) && !empty($this->sort)) {
			foreach ($this->sort as $key => $order) {
				try {
					$column = $this->getColumn($key);

				} catch (DataGridColumnNotFoundException $e) {
					$this->deleteSessionData('_grid_sort');
					$this->sort = [];

					return;
				}

				if ($column && $column->isSortable() && is_callable($column->getSortableCallback())) {
					$this->sort_callback = $column->getSortableCallback();
				}
			}
		}
	}
213640
protected function loadData()
    {
        if (is_null($this->filteredData)) {
            $this->filteredData = $this->filterHelper->filterData(
                $this->data,
                $this->filters,
                FilterInterface::FILTER_LOGIC_OR
            );

            if (!is_null($this->sort)) {
                $sort = $this->sort;
                uasort($this->filteredData, function ($a, $b) use ($sort) {
                    if (is_numeric($a[$sort[0]])) {
                        $comp = ($a[$sort[0]] < $b[$sort[0]]) ? -1 : 1;
                    } else {
                        $comp = (strcmp($a[$sort[0]], $b[$sort[0]]));
                    }

                    if ($sort[1] == "DESC") {
                        return -1 * $comp;
                    } else {
                        return $comp;
                    }

                });
            }
        }
    }
586421
public function session($name = '', $default = null, $filter = '')
    {
        if (empty($this->session)) {
            $this->session = Session::get();
        }
        if (is_array($name)) {
            return $this->session = array_merge($this->session, $name);
        }
        return $this->input($this->session, $name, $default, $filter);
    }