Definition at line 33 of file Filter.php.
◆ addDefaultNamespaces()
static addDefaultNamespaces |
( |
|
$namespace | ) |
|
|
static |
Adds a new default namespace
- Parameters
-
- Returns
- null
Definition at line 150 of file Filter.php.
152 if (!is_array($namespace)) {
153 $namespace = array((
string) $namespace);
156 self::$_defaultNamespaces = array_unique(array_merge(self::$_defaultNamespaces, $namespace));
◆ addFilter()
Adds a filter to the chain
- Parameters
-
- Returns
- Zend_Filter Provides a fluent interface
Definition at line 60 of file Filter.php.
62 if ($placement == self::CHAIN_PREPEND) {
63 array_unshift($this->_filters, $filter);
65 $this->_filters[] = $filter;
◆ appendFilter()
Add a filter to the end of the chain
- Parameters
-
- Returns
- Zend_Filter Provides a fluent interface
Definition at line 76 of file Filter.php.
78 return $this->
addFilter($filter, self::CHAIN_APPEND);
addFilter(Zend_Filter_Interface $filter, $placement=self::CHAIN_APPEND)
◆ filter()
Returns $value filtered through each filter in the chain
Filters are run in the order in which they were added to the chain (FIFO)
- Parameters
-
- Returns
- mixed
Implements Zend_Filter_Interface.
Definition at line 110 of file Filter.php.
113 foreach ($this->_filters as $filter) {
114 $valueFiltered = $filter->filter($valueFiltered);
116 return $valueFiltered;
◆ filterStatic()
static filterStatic |
( |
|
$value, |
|
|
|
$classBaseName, |
|
|
array |
$args = array() , |
|
|
|
$namespaces = array() |
|
) |
| |
|
static |
Returns a value filtered through a specified filter class, without requiring separate instantiation of the filter object.
The first argument of this method is a data input value, that you would have filtered. The second argument is a string, which corresponds to the basename of the filter class, relative to the Zend_Filter namespace. This method automatically loads the class, creates an instance, and applies the filter() method to the data input. You can also pass an array of constructor arguments, if they are needed for the filter class.
- Parameters
-
mixed | $value | |
string | $classBaseName | |
array | $args | OPTIONAL |
array | string | $namespaces | OPTIONAL |
- Returns
- mixed
- Exceptions
-
Definition at line 207 of file Filter.php.
209 #require_once 'Zend/Loader.php'; 210 $namespaces = array_merge((array) $namespaces, self::$_defaultNamespaces, array(
'Zend_Filter'));
211 foreach ($namespaces as $namespace) {
212 $className = $namespace .
'_' . ucfirst($classBaseName);
215 $file = str_replace(
'_', DIRECTORY_SEPARATOR,
$className) .
'.php';
227 if (
$class->implementsInterface(
'Zend_Filter_Interface')) {
228 if (
$class->hasMethod(
'__construct')) {
229 $object =
$class->newInstanceArgs($args);
231 $object =
$class->newInstance();
233 return $object->filter(
$value);
236 #require_once 'Zend/Filter/Exception.php';
static loadClass($class, $dirs=null)
static isReadable($filename)
$_option $_optionId $class
◆ get()
static get |
( |
|
$value, |
|
|
|
$classBaseName, |
|
|
array |
$args = array() , |
|
|
|
$namespaces = array() |
|
) |
| |
|
static |
- Deprecated:
- See also
- Zend_Filter::filterStatic()
- Parameters
-
mixed | $value | |
string | $classBaseName | |
array | $args | OPTIONAL |
array | string | $namespaces | OPTIONAL |
- Returns
- mixed
- Exceptions
-
Definition at line 180 of file Filter.php.
183 'Zend_Filter::get() is deprecated as of 1.9.0; please update your code to utilize Zend_Filter::filterStatic()',
static filterStatic($value, $classBaseName, array $args=array(), $namespaces=array())
◆ getDefaultNamespaces()
static getDefaultNamespaces |
( |
| ) |
|
|
static |
Returns the set default namespaces
- Returns
- array
Definition at line 124 of file Filter.php.
static $_defaultNamespaces
◆ getFilters()
Get all the filters
- Returns
- array
Definition at line 97 of file Filter.php.
◆ hasDefaultNamespaces()
static hasDefaultNamespaces |
( |
| ) |
|
|
static |
Returns true when defaultNamespaces are set
- Returns
- boolean
Definition at line 164 of file Filter.php.
166 return (!empty(self::$_defaultNamespaces));
◆ prependFilter()
Add a filter to the start of the chain
- Parameters
-
- Returns
- Zend_Filter Provides a fluent interface
Definition at line 87 of file Filter.php.
89 return $this->
addFilter($filter, self::CHAIN_PREPEND);
addFilter(Zend_Filter_Interface $filter, $placement=self::CHAIN_APPEND)
◆ setDefaultNamespaces()
static setDefaultNamespaces |
( |
|
$namespace | ) |
|
|
static |
Sets new default namespaces
- Parameters
-
- Returns
- null
Definition at line 135 of file Filter.php.
137 if (!is_array($namespace)) {
138 $namespace = array((
string) $namespace);
141 self::$_defaultNamespaces = $namespace;
◆ $_defaultNamespaces
$_defaultNamespaces = array() |
|
staticprotected |
◆ $_filters
◆ CHAIN_APPEND
const CHAIN_APPEND = 'append' |
◆ CHAIN_PREPEND
const CHAIN_PREPEND = 'prepend' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Filter.php