Sets an array of submitted data
@param string|array|null $key
@param mixed $value
@param boolean|string $filter
@return array
519191
public function setSubmitted($key = null, $value = null, $filter = true)
    {
        if (!isset($key)) {

            if (isset($value)) {
                return $this->submitted = (array) $value;
            }

            $this->submitted = (array) $this->request->post(null, array(), $filter, 'array');
            return $this->submitted;
        }

        if (!isset($value) && empty($this->submitted)) {
            $this->post_key = (string) $key;
            $this->submitted = (array) $this->request->post($key, array(), $filter, 'array');
            return $this->submitted;
        }

        gplcart_array_set($this->submitted, $key, $value);
        return $this->submitted;
    }
861077
function setDefaults($defaultValues = null, $filter = null)
    {
        if (is_array($defaultValues)) {
            if (isset($filter)) {
                if (is_array($filter) && (2 != count($filter) || !is_callable($filter))) {
                    foreach ($filter as $val) {
                        if (!is_callable($val)) {
                            return self::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm::setDefaults()", 'HTML_QuickForm_Error', true);
                        } else {
                            $defaultValues = $this->_recursiveFilter($val, $defaultValues);
                        }
                    }
                } elseif (!is_callable($filter)) {
                    return self::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm::setDefaults()", 'HTML_QuickForm_Error', true);
                } else {
                    $defaultValues = $this->_recursiveFilter($filter, $defaultValues);
                }
            }
            $this->_defaultValues = HTML_QuickForm::arrayMerge($this->_defaultValues, $defaultValues);
            foreach (array_keys($this->_elements) as $key) {
                $this->_elements[$key]->onQuickFormEvent('updateValue', null, $this);
            }
        }
    }
616549
protected function setJavascriptData($key, $value = null)
    {
        if (is_array($key)) {
            JavaScriptFacade::put($key);
        } else {
            JavaScriptFacade::put([$key => $value]);
        }
    }
776999
protected function value($value, $default = null, $filter = null) {
        if ($this->valueFilter == null) {
            $this->valueFilter = Ioc::get(ValueFilter::class);
        }
        if (is_array($value)) {
            $data = array();
            foreach ($value as $key => $val) {
                $data[ $key ] = $this->valueFilter->filter($val);
            }
            return $data;
        }
        if (!isset($value)) {
            $value = $default;
        }
        $value = $this->valueFilter->filter($value, $filter);
        return $value;
    }
49453
public function withFilter(Filter $filter)
    {
        if ($this->value->isNull()) {
            return null;
        }

        return $this->applyFilter($filter);
    }
633827
public function SetData($Key, $Value = NULL, $AddProperty = FALSE) {
      if (is_array($Key)) {
         $this->Data = array_merge($this->Data, $Key);

         if ($AddProperty === TRUE) {
            foreach ($Key as $Name => $Value) {
               $this->$Name = $Value;
            }
         }
         return;
      }

      $this->Data[$Key] = $Value;
      if($AddProperty === TRUE) {
         $this->$Key = $Value;
      }
      return $Value;
   }
1320297
public function put($key, $value = null)
    {
        if (! is_array($key)) {
            $key = [$key => $value];
        }

        foreach ($key as $arrayKey => $arrayValue) {
            Arr::set($this->attributes, $arrayKey, $arrayValue);
        }
    }
119938
public function set($key, $value = null) {
        if (strpos($key, '.') === false) {
            $this->_data[$key] = $value;
        } else {
            $this->_data = Hash::set($this->_data, $key, $value);
        }

        return $this;
    }
1365503
public function set($key, $value = null)
    {
        if (is_array($key))
        {
            foreach ($key as $name => $value)
            {
                $this->_data[$name] = $value;
            }
        }
        else
        {
            $this->_data[$key] = $value;
        }

        return $this;
    }
311864
public function filter($key, $filter=null, $option=null) {
		if (is_int(strpos($key,'.'))) {
			list($key,$fkey) = explode('.',$key,2);
			if (!isset($this->relFilter[$key.'.']))
				$this->relFilter[$key.'.'] = array();
			$this->relFilter[$key.'.'][$fkey] = array($filter,$option);
		} else
			$this->relFilter[$key] = array($filter,$option);
		return $this;
	}
519018
public function has($key, $filter, $options = null) {
		if (is_string($filter))
			$filter=array($filter);
		if (is_int(strpos($key,'.'))) {
			list($key,$fkey) = explode('.',$key,2);
			if (!isset($this->hasCond[$key.'.']))
				$this->hasCond[$key.'.'] = array();
			$this->hasCond[$key.'.'][$fkey] = array($filter,$options);
		} else {
			if (!isset($this->fieldConf[$key]))
				trigger_error(sprintf(self::E_UNKNOWN_FIELD,$key,get_called_class()),E_USER_ERROR);
			if (!isset($this->fieldConf[$key]['relType']))
				trigger_error(self::E_HAS_COND,E_USER_ERROR);
			$this->hasCond[$key] = array($filter,$options);
		}
		return $this;
	}
1267080
public function post($key = null, $value = null)
    {
        if (!is_null($this->except)) {
            $this->skip();
        }

        if (!is_null($key) && !string_has($key, '.') && is_null($value)) {
            $postValue = '';
            $key = $this->security->sanitize($key);
            $postValue = $this->security->sanitize($this->request['post'][$key]);
            $this->request['post'][$key] = $postValue;

            if (array_key_exists($key, $this->request['post'])) {
                return $this->request['post'][$key];
            }

            throw new InvalidArgumentException("Invalid key $key passed to ".__METHOD__);
        }

        /*
         | User can access post array element by passing
         | key as dot separator with index
         | ['user' => ['name' => 'foo']]
         |
         | $input->post('user.name'); // output: foo
         */
        if (!is_null($key) && string_has($key, '.') && is_null($value)) {
            $arr = ArrayAccessor::make($this->request['post']);

            return $arr->toString($this->security->sanitize($key));
        }

        $this->setPostValue($key, $value);

        if (is_null($key)) {
            $postArr = $this->security->sanitize($this->request['post']);

            return (!empty($postArr)) ? $postArr : null;
        }
    }
970149
public static function filter(array $data, $filter): array
    {
        if (!$filter) {
            return $data;
        }

        if (is_callable($filter)) {
            return array_filter($data, $filter);
        }

        if ($filter & self::FILTER_NULL) {
            return array_filter(
                $data,
                function ($value) {
                    return $value !== null;
                }
            );
        } elseif ($filter & self::FILTER_EMPTY) {
            return array_filter(
                $data,
                function ($value) {
                    return isset($value[0]);
                }
            );
        } elseif ($filter & self::FILTER_PHP) {
            return array_filter($data);
        }

        return $data;
    }
623155
public function setParam($key, $value = null)
    {

        return null !== $this->getDraft() ? $this->getDraft()->setParam($key, $value) : parent::setParam($key, $value);
    }
331514
public function set($filters)
    {
        $filters = (array) $filters;

        foreach ($this->map as $attribute => $key) {
            if (!isset($filters[$attribute])) {
                continue;
            }

            $value = $filters[$attribute];
            $this->setByKey($key, $value);
        }
    }
295533
public function filter($key, $value=null)
    {

        $this->parseInputOnce();

        if (!is_array($key)) {
            $this->filters[$key] = $value;
            return $this;
        }

        foreach ($key as $filter=>$needle) {
            $this->filter($filter, $needle);
        }

        return $this;
    }
362842
function set ($filters)
  {
    // On objects, all methods named `filter_xxx` (where xxx is a filter name) are registered as filters (with the
    // `filter_` prefix stripped).
    if (is_object ($filters)) {
      $keys    = mapAndFilter (array_diff (get_class_methods ($filters), ['__construct']), function ($f) {
        return substr ($f, 0, 7) == 'filter_' ? substr ($f, 7) : null;
      });
      $values  = array_map (function ($v) use ($filters) { return [$filters, "filter_$v"]; }, $keys);
      $filters = array_combine ($keys, $values);
    };
    if (is_array ($filters))
      array_mergeInto ($this->filters, $filters);
    else throw new \InvalidArgumentException("<kbd>filters</kbd> argument is invalid");
  }