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


PHP ClassMethods::setUnderscoreSeparatedKeys方法代码示例

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


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

示例1: fromArray

 public function fromArray($values)
 {
     $hydrator = new Hydrator\ClassMethods();
     $hydrator->setUnderscoreSeparatedKeys(false);
     $res = $hydrator->hydrate($values, $this);
     return $res;
 }
开发者ID:fuca,项目名称:sportsclub,代码行数:7,代码来源:EntityMapperTrait.php

示例2: __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

示例3: getHydrator

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

示例4: __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

示例5: hydrateToArray

 private function hydrateToArray($data)
 {
     $hydrator = new ClassMethods(false);
     $hydrator->setUnderscoreSeparatedKeys('_');
     //$obiekt = $hydrator->hydrate($tablica, $user);//
     $array = $hydrator->extract($data);
     if ($array['id'] == null) {
         unset($array['id']);
     }
     return $array;
 }
开发者ID:herrkolacki,项目名称:User,代码行数:11,代码来源:UserService.php

示例6: __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

示例7: hydrateObject

 /**
  * Hydrates a Database Object using provided data
  *
  * @param $data
  * @param DatabaseObjectInterface $object
  * @return DatabaseObjectInterface
  */
 protected function hydrateObject($data, DatabaseObjectInterface $object)
 {
     $classMethodHydrator = new ClassMethods();
     $classMethodHydrator->setUnderscoreSeparatedKeys(true);
     $object = $classMethodHydrator->hydrate($data, $object);
     return $object;
 }
开发者ID:parrotcage,项目名称:aves,代码行数:14,代码来源:AbstractBackend.php

示例8: testHydratorClassMethodsOptions

 public function testHydratorClassMethodsOptions()
 {
     $hydrator = new ClassMethods();
     $this->assertTrue($hydrator->getUnderscoreSeparatedKeys());
     $hydrator->setOptions(array('underscoreSeparatedKeys' => false));
     $this->assertFalse($hydrator->getUnderscoreSeparatedKeys());
     $hydrator->setUnderscoreSeparatedKeys(true);
     $this->assertTrue($hydrator->getUnderscoreSeparatedKeys());
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:9,代码来源:HydratorTest.php

示例9: toArray

 public function toArray()
 {
     $hydrator = new Hydrator\ClassMethods();
     $hydrator->setUnderscoreSeparatedKeys(false);
     return $hydrator->extract($this);
 }
开发者ID:ualisonaguiar,项目名称:shome2,代码行数:6,代码来源:Entity.php

示例10: hydrateToArray

 /**
  *  Change object to array
  * @param type $object
  * @return type
  */
 private function hydrateToArray($object)
 {
     $hydrator = new ClassMethods(false);
     $hydrator->setUnderscoreSeparatedKeys('_');
     $array = $hydrator->extract($object);
     if ($array['id'] == null) {
         unset($array['id']);
     }
     return $array;
 }
开发者ID:herrkolacki,项目名称:User,代码行数:15,代码来源:UserMapper.php


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