class MethodMatchFilter in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-hydrator/src/Filter/MethodMatchFilter.php \Zend\Hydrator\Filter\MethodMatchFilter
- 8 vendor/zendframework/zend-stdlib/src/Hydrator/Filter/MethodMatchFilter.php \Zend\Stdlib\Hydrator\Filter\MethodMatchFilter
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-hydrator/src/Filter/MethodMatchFilter.php \Zend\Hydrator\Filter\MethodMatchFilter
Hierarchy
- class \Zend\Hydrator\Filter\MethodMatchFilter implements FilterInterface
Expanded class hierarchy of MethodMatchFilter
1 file declares its use of MethodMatchFilter
- MethodMatchFilter.php in vendor/
zendframework/ zend-stdlib/ src/ Hydrator/ Filter/ MethodMatchFilter.php
File
- vendor/
zendframework/ zend-hydrator/ src/ Filter/ MethodMatchFilter.php, line 12
Namespace
Zend\Hydrator\FilterView source
class MethodMatchFilter implements FilterInterface {
/**
* The method to exclude
* @var string
*/
protected $method = null;
/**
* Either an exclude or an include
* @var bool
*/
protected $exclude = null;
/**
* @param string $method The method to exclude or include
* @param bool $exclude If the method should be excluded
*/
public function __construct($method, $exclude = true) {
$this->method = $method;
$this->exclude = $exclude;
}
public function filter($property) {
$pos = strpos($property, '::');
if ($pos !== false) {
$pos += 2;
}
else {
$pos = 0;
}
if (substr($property, $pos) === $this->method) {
return !$this->exclude;
}
return $this->exclude;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MethodMatchFilter:: |
protected | property | Either an exclude or an include | |
MethodMatchFilter:: |
protected | property | The method to exclude | |
MethodMatchFilter:: |
public | function |
Should return true, if the given filter
does not match Overrides FilterInterface:: |
|
MethodMatchFilter:: |
public | function |