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