当前位置: 首页>>代码示例>>PHP>>正文


PHP ClassMethods::addFilter方法代码示例

本文整理汇总了PHP中Zend\Stdlib\Hydrator\ClassMethods::addFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassMethods::addFilter方法的具体用法?PHP ClassMethods::addFilter怎么用?PHP ClassMethods::addFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Stdlib\Hydrator\ClassMethods的用法示例。


在下文中一共展示了ClassMethods::addFilter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createService

 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $classmethod = new ClassMethods(false);
     $classmethod->addFilter("arraycoppy", new MethodMatchFilter("getArrayCopy"), FilterComposite::CONDITION_AND);
     $classmethod->addFilter("inputFilter", new MethodMatchFilter("getInputFilter"), FilterComposite::CONDITION_AND);
     return new UserService($serviceLocator->get('Zend\\Db\\Adapter\\Adapter'), $classmethod);
 }
开发者ID:summerandelf,项目名称:CotestWeb_,代码行数:13,代码来源:UserServiceFactory.php

示例2: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $classmethod = new ClassMethods(false);
     $classmethod->addFilter("arraycoppy", new MethodMatchFilter("getArrayCopy"), FilterComposite::CONDITION_AND);
     $classmethod->addFilter("user", new MethodMatchFilter("getUser"), FilterComposite::CONDITION_AND);
     $prototypeArr = new \ArrayObject();
     $prototypeArr->append(new User());
     return new ZendDbSqlMapper($serviceLocator->get('Zend\\Db\\Adapter\\Adapter'), $classmethod, new Page(), $prototypeArr);
 }
开发者ID:summerandelf,项目名称:CotestWeb_,代码行数:9,代码来源:ZendDbSqlMapperFactory.php

示例3: getHydrator

 public function getHydrator()
 {
     if (!$this->hydrator) {
         $hydrator = new ClassMethods();
         $hydrator->setUnderscoreSeparatedKeys(false);
         $hydrator->addFilter('getQuery', new Filter\MethodMatchFilter('getQuery'), Filter\FilterComposite::CONDITION_AND);
         $hydrator->addFilter('getHydrator', new Filter\MethodMatchFilter('getHydrator'), Filter\FilterComposite::CONDITION_AND);
         $this->hydrator = $hydrator;
     }
     return $this->hydrator;
 }
开发者ID:vmalinovskiy,项目名称:CallFire-PHP-SDK,代码行数:11,代码来源:Request.php

示例4: getHydrator

 public function getHydrator()
 {
     if (!$this->hydrator) {
         $hydrator = new ClassMethods();
         $hydrator->addFilter('getHydrator', new Filter\MethodMatchFilter('getHydrator'), Filter\FilterComposite::CONDITION_AND);
         foreach (get_class_methods(get_parent_class()) as $parentMethod) {
             if (!preg_match('/^get/', $parentMethod) && !preg_match('/^has/', $parentMethod)) {
                 continue;
             }
             $hydrator->addFilter($parentMethod, new Filter\MethodMatchFilter($parentMethod), Filter\FilterComposite::CONDITION_AND);
         }
         $this->hydrator = $hydrator;
     }
     return $this->hydrator;
 }
开发者ID:vmalinovskiy,项目名称:CallFire-PHP-SDK,代码行数:15,代码来源:AbstractTag.php

示例5: __construct

 public function __construct()
 {
     $hydrator = new ClassMethods();
     $hydrator->setUnderscoreSeparatedKeys(false);
     foreach (array('getHydrator') as $method) {
         $hydrator->addFilter($method, new Filter\MethodMatchFilter($method), Filter\FilterComposite::CONDITION_AND);
     }
     $this->setHydrator($hydrator);
 }
开发者ID:Shkeats,项目名称:FireText-PHP-SDK,代码行数:9,代码来源:AbstractResource.php

示例6: __construct

 public function __construct(ResourceNS\Status $status)
 {
     $this->setStatus($status);
     $hydrator = new ClassMethods();
     $hydrator->setUnderscoreSeparatedKeys(false);
     foreach (array('getHydrator', 'isSuccessful') as $method) {
         $hydrator->addFilter($method, new Filter\MethodMatchFilter($method), Filter\FilterComposite::CONDITION_AND);
     }
     $this->setHydrator($hydrator);
 }
开发者ID:Shkeats,项目名称:FireText-PHP-SDK,代码行数:10,代码来源:AbstractResponse.php

示例7: __construct

 public function __construct(Credentials\CredentialsInterface $credentials)
 {
     $this->setCredentials($credentials);
     $hydrator = new ClassMethods();
     $hydrator->setUnderscoreSeparatedKeys(false);
     foreach (array('getRequestPath', 'getRequestParams', 'getResponseType', 'getBasePath', 'getPath', 'getFormat', 'getCredentials', 'getHydrator') as $method) {
         $hydrator->addFilter($method, new Filter\MethodMatchFilter($method), Filter\FilterComposite::CONDITION_AND);
     }
     $this->setHydrator($hydrator);
     $this->setFormat(ResponseInterface::FORMAT_XML);
 }
开发者ID:Shkeats,项目名称:FireText-PHP-SDK,代码行数:11,代码来源:AbstractRequest.php

示例8: testHydratorClassMethodsWithCustomFilter

 public function testHydratorClassMethodsWithCustomFilter()
 {
     $hydrator = new ClassMethods(false);
     $datas = $hydrator->extract($this->classMethodsCamelCase);
     $hydrator->addFilter("exclude", function ($property) {
         list($class, $method) = explode('::', $property);
         if ($method == 'getHasFoo') {
             return false;
         }
         return true;
     }, FilterComposite::CONDITION_AND);
     $datas = $hydrator->extract($this->classMethodsCamelCase);
     $this->assertFalse(isset($datas['hasFoo']));
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:14,代码来源:HydratorTest.php


注:本文中的Zend\Stdlib\Hydrator\ClassMethods::addFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。