當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。