FileBag (Component\HttpFoundation)
Symfony\Component\HttpFoundation\FileBag
class FileBag extends ParameterBag
FileBag is a container for uploaded files.
Methods
__construct(array $parameters = array()) Constructor. | ||
array | all() Returns the parameters. | from ParameterBag |
array | keys() Returns the parameter keys. | from ParameterBag |
replace(array $files = array()) Replaces the current parameters by a new set. | ||
add(array $files = array()) Adds parameters. | ||
mixed | get(string $key, mixed $default = null, bool $deep = false) Returns a parameter by name. | from ParameterBag |
set(string $key, mixed $value) Sets a parameter by name. | ||
bool | has(string $key) Returns true if the parameter is defined. | from ParameterBag |
remove(string $key) Removes a parameter. | from ParameterBag | |
string | getAlpha(string $key, string $default = '', bool $deep = false) Returns the alphabetic characters of the parameter value. | from ParameterBag |
string | getAlnum(string $key, string $default = '', bool $deep = false) Returns the alphabetic characters and digits of the parameter value. | from ParameterBag |
string | getDigits(string $key, string $default = '', bool $deep = false) Returns the digits of the parameter value. | from ParameterBag |
int | getInt(string $key, int $default, bool $deep = false) Returns the parameter value converted to integer. | from ParameterBag |
bool | getBoolean(string $key, mixed $default = false, bool $deep = false) Returns the parameter value converted to boolean. | from ParameterBag |
mixed | filter(string $key, mixed $default = null, int $filter = FILTER_DEFAULT, mixed $options = array(), bool $deep = false) Filter key. | from ParameterBag |
ArrayIterator | getIterator() Returns an iterator for parameters. | from ParameterBag |
int | count() Returns the number of parameters. | from ParameterBag |
Details
public __construct(array $parameters = array())
Constructor.
public array all()
Returns the parameters.
public array keys()
Returns the parameter keys.
public replace(array $files = array())
Replaces the current parameters by a new set.
public add(array $files = array())
Adds parameters.
public mixed get(string $key, mixed $default = null, bool $deep = false)
Returns a parameter by name.
Note: Finding deep items is deprecated since version 2.8, to be removed in 3.0.
public set(string $key, mixed $value)
Sets a parameter by name.
public bool has(string $key)
Returns true if the parameter is defined.
public remove(string $key)
Removes a parameter.
public string getAlpha(string $key, string $default = '', bool $deep = false)
Returns the alphabetic characters of the parameter value.
public string getAlnum(string $key, string $default = '', bool $deep = false)
Returns the alphabetic characters and digits of the parameter value.
public string getDigits(string $key, string $default = '', bool $deep = false)
Returns the digits of the parameter value.
public int getInt(string $key, int $default, bool $deep = false)
Returns the parameter value converted to integer.
public bool getBoolean(string $key, mixed $default = false, bool $deep = false)
Returns the parameter value converted to boolean.
public mixed filter(string $key, mixed $default = null, int $filter = FILTER_DEFAULT, mixed $options = array(), bool $deep = false)
Filter key.
public ArrayIterator getIterator()
Returns an iterator for parameters.
public int count()
Returns the number of parameters.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/HttpFoundation/FileBag.html