Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Stdlib / Hydrator / Filter / MethodMatchFilter.php
bloba61cd5a3d614ea86b0227abf86957b0d937147ca
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
9 namespace Zend\Stdlib\Hydrator\Filter;
11 class MethodMatchFilter implements FilterInterface
13 /**
14 * The method to exclude
15 * @var string
17 protected $method = null;
19 /**
20 * Either an exclude or an include
21 * @var bool
23 protected $exclude = null;
25 /**
26 * @param string $method The method to exclude or include
27 * @param bool $exclude If the method should be excluded
29 public function __construct($method, $exclude = true)
31 $this->method = $method;
32 $this->exclude = $exclude;
35 public function filter($property)
37 $pos = strpos($property, '::');
38 if ($pos !== false) {
39 $pos += 2;
40 } else {
41 $pos = 0;
43 if (substr($property, $pos) === $this->method) {
44 return $this->exclude ? false : true;
46 return $this->exclude ? true : false;