當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ResultSet\HydratingResultSet類代碼示例

本文整理匯總了PHP中Zend\Db\ResultSet\HydratingResultSet的典型用法代碼示例。如果您正苦於以下問題:PHP HydratingResultSet類的具體用法?PHP HydratingResultSet怎麽用?PHP HydratingResultSet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了HydratingResultSet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testToArray

 /**
  * @covers Zend\Db\ResultSet\HydratingResultSet::toArray
  * @todo   Implement testToArray().
  */
 public function testToArray()
 {
     $hydratingRs = new HydratingResultSet();
     $hydratingRs->initialize(array(array('id' => 1, 'name' => 'one')));
     $obj = $hydratingRs->toArray();
     $this->assertInternalType('array', $obj);
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:11,代碼來源:HydratingResultSetTest.php

示例2: getPagesList

 public function getPagesList()
 {
     $stmt = $this->_dbAdapter->createStatement();
     $stmt->prepare('CALL `pages/get_slist`()');
     $result = $stmt->execute();
     $resultSet = new HydratingResultSet(new Reflection(), new Page());
     $resultSet->initialize($result);
     return $resultSet;
 }
開發者ID:KukaBazuka,項目名稱:zendy,代碼行數:9,代碼來源:PageTable.php

示例3: __construct

 public function __construct($table, Adapter $db, $strategies = array())
 {
     $hydrator = new ArraySerializable();
     foreach ($strategies as $field => $strategy) {
         $hydrator->addStrategy($field, $strategy);
     }
     $resultSet = new HydratingResultSet();
     $resultSet->setHydrator($hydrator);
     parent::__construct($table, $db, null, $resultSet);
 }
開發者ID:xangxiong,項目名稱:rest-example,代碼行數:10,代碼來源:Base.php

示例4: getResultSet

 /**
  * gets the resultSet
  *
  * @return HydratingResultSet
  */
 protected function getResultSet()
 {
     if (!$this->resultSetPrototype instanceof HydratingResultSet) {
         $resultSetPrototype = new HydratingResultSet();
         $resultSetPrototype->setHydrator($this->getHydrator());
         $resultSetPrototype->setObjectPrototype($this->getModel());
         $this->resultSetPrototype = $resultSetPrototype;
     }
     return clone $this->resultSetPrototype;
 }
開發者ID:uthando-cms,項目名稱:uthando-common,代碼行數:15,代碼來源:AbstractDbMapper.php

示例5: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new ForgotPassword());
     $tableGateway = new TableGateway('vc_forget_tokens', $db, array(), $resultSetPrototype);
     $table = new ForgotPasswordTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:video-collections,代碼行數:10,代碼來源:ForgotPasswordTableFactory.php

示例6: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new Resource());
     $tableGateway = new TableGateway('resource', $db, null, $resultSetPrototype);
     $table = new ResourceTable($tableGateway);
     return $table;
 }
開發者ID:tomshaw,項目名稱:resource-datastore,代碼行數:10,代碼來源:ResourceFactory.php

示例7: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new ViewProfileCount());
     $tableGateway = new TableGateway('vc_view_profiles_count', $db, array(), $resultSetPrototype);
     $table = new ViewProfileCountTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:video-collections,代碼行數:10,代碼來源:ViewProfileCountTableFactory.php

示例8: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new SearchCategoriesList());
     $tableGateway = new TableGateway('search_categories_list', $db, array(), $resultSetPrototype);
     $table = new SearchCategoriesListTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:taggerzz-new,代碼行數:10,代碼來源:SearchCategoriesListTableFactory.php

示例9: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new SettingFlexibleType());
     $tableGateway = new TableGateway('setting_flexible_type', $db, array(), $resultSetPrototype);
     $table = new SettingFlexibleTypeTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:taggerzz-new,代碼行數:10,代碼來源:SettingFlexibleTypeTableFactory.php

示例10: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new LoginLinkExpired());
     $tableGateway = new TableGateway('login_link_expired', $db, array(), $resultSetPrototype);
     $table = new LoginLinkExpiredTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:video-collections,代碼行數:10,代碼來源:LoginLinkExpiredTableFactory.php

示例11: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new JsPlumbGrid());
     $tableGateway = new TableGateway('js_plumb_grid', $db, array(), $resultSetPrototype);
     $table = new JsPlumbGridTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:taggerzz-new,代碼行數:10,代碼來源:JsPlumbGridTableFactory.php

示例12: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new HydratingResultSet();
     $resultSetPrototype->setHydrator(new ObjectProperty());
     $resultSetPrototype->setObjectPrototype(new UserSkills());
     $tableGateway = new TableGateway('vc_user_skills', $db, array(), $resultSetPrototype);
     $table = new UserSkillsTable($tableGateway);
     return $table;
 }
開發者ID:aapthi,項目名稱:video-collections,代碼行數:10,代碼來源:UserSkillsTableFactory.php

示例13: findActive

 /**
  * @return Route[]
  */
 public function findActive()
 {
     $sql = new Sql($this->dbAdapter);
     $select = $sql->select($this->table)->where('active = 1');
     $result = $sql->prepareStatementForSqlObject($select)->execute();
     if ($result->isQueryResult() && $result->getAffectedRows()) {
         $resultSet = new HydratingResultSet($this->hydrator, $this->model);
         return $resultSet->initialize($result);
     }
     return [];
 }
開發者ID:greedybytes,項目名稱:routing,代碼行數:14,代碼來源:RouteService.php

示例14: contohGetList

 /**
  * @return JsonModel
  */
 public function contohGetList()
 {
     $sm = $this->getServiceLocator();
     $table = $sm->get('Organisasi\\DbTable\\StrukturOrganisasi');
     // defined in module.php
     $result = $table->select()->toArray();
     $resultSet = new HydratingResultSet(new ReflectionHydrator(), new StrukturOrganisasi());
     $resultSet->initialize($result);
     $a = array('data' => $result);
     return new JsonModel($a);
 }
開發者ID:vatoer,項目名稱:EOfficeZf2,代碼行數:14,代碼來源:ApiController.php

示例15: fetchAll

 public function fetchAll()
 {
     $select = $this->sql->select();
     $stmt = $this->sql->prepareStatementForSqlObject($select);
     $results = $stmt->execute();
     $entity = new ImpostoEntity();
     $classMethods = new ClassMethods();
     $resultset = new HydratingResultSet($classMethods, $entity);
     $resultset->initialize($results);
     return $resultset;
 }
開發者ID:LucasBurg,項目名稱:glass,代碼行數:11,代碼來源:ImpostoMapper.php


注:本文中的Zend\Db\ResultSet\HydratingResultSet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。