public function FilterComposite::__construct in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-hydrator/src/Filter/FilterComposite.php \Zend\Hydrator\Filter\FilterComposite::__construct()
Define default Filter
Parameters
array $orFilter:
array $andFilter:
Throws
File
- vendor/
zendframework/ zend-hydrator/ src/ Filter/ FilterComposite.php, line 44
Class
Namespace
Zend\Hydrator\FilterCode
public function __construct($orFilter = [], $andFilter = []) {
array_walk($orFilter, function ($value, $key) {
if (!is_callable($value) && !$value instanceof FilterInterface) {
throw new InvalidArgumentException('The value of ' . $key . ' should be either a callable or ' . 'an instance of Zend\\Stdlib\\Hydrator\\Filter\\FilterInterface');
}
});
array_walk($andFilter, function ($value, $key) {
if (!is_callable($value) && !$value instanceof FilterInterface) {
throw new InvalidArgumentException('The value of ' . $key . ' should be either a callable or ' . 'an instance of Zend\\Stdlib\\Hydrator\\Filter\\FilterInterface');
}
});
$this->orFilter = new ArrayObject($orFilter);
$this->andFilter = new ArrayObject($andFilter);
}