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


PHP ResultSet\ResultSet类代码示例

本文整理汇总了PHP中Zend\Db\ResultSet\ResultSet的典型用法代码示例。如果您正苦于以下问题:PHP ResultSet类的具体用法?PHP ResultSet怎么用?PHP ResultSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getGateway

 /**
  * @param string             $name
  * @param DataModelInterface $model
  *
  * @return null|MongoGateway
  * @throws \Exception
  */
 public function getGateway($name, DataModelInterface $model = null)
 {
     if ($model == null) {
         throw new \Exception(' Raw Gateway needs a DataModelInterface instance as the second parameter ');
     }
     $adapterConfig = $this->getConfig($model);
     $gwName = Arr::getDoubtField($adapterConfig, 'gateway', null);
     if ($gwName === null) {
         $gwName = Arr::getDoubtField($adapterConfig, 'driver', null);
     }
     if ($gwName === null) {
         throw new \Exception('Unknown gateway');
     }
     // create resultSet prototype
     $resultSetPrototype = new ResultSet();
     $resultSetPrototype->setArrayObjectPrototype($model);
     // create custom transport for the model
     $dbAdapter = $this->getServiceLocator()->get($model->_adapter);
     // use general gw class
     if ($gwName == 'Pdo') {
         throw new \Exception(' TODO: Needs to implement PDO Gateway create !! ');
     }
     $gw = Obj::create('\\ModelFramework\\GatewayService\\MongoGateway', ['table' => $model->getTableName(), 'adapter' => $dbAdapter, 'resultSetPrototype' => $resultSetPrototype]);
     return $gw;
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:32,代码来源:GatewayServiceRaw.php

示例2: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $subject = $serviceLocator->get('Category\\Model\\Category');
     $resultSet = new ResultSet();
     $resultSet->setArrayObjectPrototype($subject);
     return $resultSet;
 }
开发者ID:red0point,项目名称:website,代码行数:7,代码来源:ResultSetFactory.php

示例3: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Application\\Model\\BookTable' => function ($sm) {
         $tableGateway = $sm->get('BookTableGateway');
         $table = new BookTable($tableGateway);
         return $table;
     }, 'BookTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Book());
         return new TableGateway('books', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\GenreTable' => function ($sm) {
         $tableGateway = $sm->get('GenreTableGateway');
         $table = new GenreTable($tableGateway);
         return $table;
     }, 'GenreTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Genre());
         return new TableGateway('genres', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\AuthorTable' => function ($sm) {
         $tableGateway = $sm->get('AuthorTableGateway');
         $table = new AuthorTable($tableGateway);
         return $table;
     }, 'AuthorTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Author());
         return new TableGateway('authors', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:povtasci,项目名称:zend2Sample,代码行数:31,代码来源:Module.php

示例4: getServiceConfig

 public function getServiceConfig()
 {
     return array('initializers' => array(function ($instance, $sm) {
         if ($instance instanceof \Zend\Db\Adapter\AdapterAwareInterface) {
             $instance->setDbAdapter($sm->get('Zend\\Db\\Adapter\\Adapter'));
         }
     }), 'factories' => array('InvoiceTable' => function ($sm) {
         $tableGateway = $sm->get('InvoiceTableGateway');
         $table = new InvoiceTable($tableGateway);
         return $table;
     }, 'InvoiceTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Invoice());
         return new TableGateway('invoice', $dbAdapter, null, $resultSetPrototype);
     }, 'Invoice\\Model\\OderTable' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $table = new OderTable($dbAdapter);
         return $table;
     }, 'Invoice\\Model\\OderdetailTable' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $table = new OderdetailTable($dbAdapter);
         return $table;
     }));
 }
开发者ID:gstearmit,项目名称:EshopVegeTable,代码行数:25,代码来源:Module.php

示例5: getTimeZones

 /**
  * Get time zones
  *
  * @return array
  */
 public function getTimeZones()
 {
     // check data in a memory
     if (null !== self::$timeZones) {
         return self::$timeZones;
     }
     // generate a cache name
     $cacheName = CacheUtility::getCacheName(self::CACHE_TIME_ZONES);
     // check data in cache
     if (null === ($timeZones = $this->staticCacheInstance->getItem($cacheName))) {
         $select = $this->select();
         $select->from('application_time_zone')->columns(['id', 'name'])->order('name');
         $statement = $this->prepareStatementForSqlObject($select);
         $resultSet = new ResultSet();
         $resultSet->initialize($statement->execute());
         foreach ($resultSet as $timeZone) {
             $timeZones[$timeZone->id] = $timeZone->name;
         }
         // save data in cache
         $this->staticCacheInstance->setItem($cacheName, $timeZones);
         $this->staticCacheInstance->setTags($cacheName, [self::CACHE_TIME_ZONES_DATA_TAG]);
     }
     self::$timeZones = $timeZones;
     return $timeZones;
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:30,代码来源:ApplicationTimeZone.php

示例6: getMenu

 /**
  * Get menu
  *
  * @return array
  */
 public function getMenu()
 {
     // generate cache name
     $cacheName = CacheUtility::getCacheName(self::CACHE_ADMIN_MENU);
     // check data in cache
     if (null === ($menu = $this->staticCacheInstance->getItem($cacheName))) {
         $select = $this->select();
         $select->from(['a' => 'application_admin_menu'])->columns(['name', 'controller', 'action'])->join(['b' => 'application_admin_menu_category'], 'a.category = b.id', ['category' => 'name', 'category_icon' => 'icon'])->join(['c' => 'application_admin_menu_part'], 'a.part = c.id', ['part' => 'name', 'part_icon' => 'icon'])->join(['d' => 'application_module'], new Expression('c.module = d.id and d.status = ?', [self::MODULE_STATUS_ACTIVE]), ['part_module' => 'name'])->join(['i' => 'application_module'], new Expression('b.module = i.id and i.status = ?', [self::MODULE_STATUS_ACTIVE]), ['category_module' => 'name'])->order('order');
         $statement = $this->prepareStatementForSqlObject($select);
         $resultSet = new ResultSet();
         $resultSet->initialize($statement->execute());
         // process admin menu
         foreach ($resultSet as $menuItem) {
             if (!isset($menu[$menuItem['part']])) {
                 $menu[$menuItem['part']] = ['part' => $menuItem['part'], 'icon' => $menuItem['part_icon'], 'module' => $menuItem['part_module'], 'items' => [0 => ['name' => $menuItem['name'], 'controller' => $menuItem['controller'], 'action' => $menuItem['action'], 'category' => $menuItem['category'], 'category_icon' => $menuItem['category_icon'], 'category_module' => $menuItem['category_module']]]];
             } else {
                 $menu[$menuItem['part']]['items'][] = ['name' => $menuItem['name'], 'controller' => $menuItem['controller'], 'action' => $menuItem['action'], 'category' => $menuItem['category'], 'category_icon' => $menuItem['category_icon'], 'category_module' => $menuItem['category_module']];
             }
         }
         // save data in cache
         $this->staticCacheInstance->setItem($cacheName, $menu);
         $this->staticCacheInstance->setTags($cacheName, [self::CACHE_ADMIN_MENU_DATA_TAG]);
     }
     return $menu;
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:30,代码来源:ApplicationAdminMenu.php

示例7: getServiceConfig

 public function getServiceConfig()
 {
     return ['factories' => ['MailOptions' => 'Base\\Service\\Factory\\MailOptions', 'CommunityTable' => function (ServiceLocatorInterface $sm) {
         $tableGateway = $sm->get('CommunityTableGateway');
         $table = new CommunityTable($tableGateway);
         return $table;
     }, 'CommunityTableGateway' => function (ServiceLocatorInterface $sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Community());
         return new TableGateway('tbl_community', $dbAdapter, null, $resultSetPrototype);
     }, 'ReleaseOrderTable' => function (ServiceLocatorInterface $sm) {
         $tableGateway = $sm->get('ReleaseOrderTableGateway');
         $table = new ReleaseOrderTable($tableGateway);
         return $table;
     }, 'ReleaseOrderTableGateway' => function (ServiceLocatorInterface $sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new ReleaseOrder());
         return new TableGateway('tbl_release_order', $dbAdapter, null, $resultSetPrototype);
     }, 'YqClassTable' => function (ServiceLocatorInterface $sm) {
         $tableGateway = $sm->get('YqClassTableGateway');
         $table = new YqClassTable($tableGateway);
         return $table;
     }, 'YqClassTableGateway' => function (ServiceLocatorInterface $sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new YqClass());
         return new TableGateway('tbl_yq_class', $dbAdapter, null, $resultSetPrototype);
     }, 'redis-cli' => 'Base\\Service\\Factory\\RedisFactory'], 'invokables' => ['LongDai' => 'Base\\Service\\LongDaiService']];
 }
开发者ID:329379172,项目名称:tbtool,代码行数:31,代码来源:Module.php

示例8: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Myworkapp\\Model\\TaskTable' => function ($sm) {
         $tableGateway = $sm->get('TaskTableGateway');
         $table = new TaskTable($tableGateway);
         return $table;
     }, 'TaskTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Task());
         return new TableGateway('tasks', $dbAdapter, null, $resultSetPrototype);
     }, 'Myworkapp\\Model\\TaskTypeTable' => function ($sm) {
         $tableGateway = $sm->get('TaskTypeTableGateway');
         $table = new TaskTypeTable($tableGateway);
         return $table;
     }, 'TaskTypeTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new TaskType());
         return new TableGateway('task_types', $dbAdapter, null, $resultSetPrototype);
     }, 'Myworkapp\\Model\\EmployeeTable' => function ($sm) {
         $tableGateway = $sm->get('EmployeeTableGateway');
         $table = new EmployeeTable($tableGateway);
         return $table;
     }, 'EmployeeTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Employee());
         return new TableGateway('employers', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:matijabelec,项目名称:mywork,代码行数:31,代码来源:Module.php

示例9: createService

 public function createService(ServiceLocatorInterface $sm)
 {
     $dbAdapter = $sm->get('db-adapter');
     $resultSetPrototype = new ResultSet();
     $resultSetPrototype->setArrayObjectPrototype(new Country());
     return new TableGateway("pays", $dbAdapter, null, $resultSetPrototype);
 }
开发者ID:skornous,项目名称:zend-api,代码行数:7,代码来源:CountryTableGatewayFactory.php

示例10: fetchAll

 public function fetchAll($paginate = true, $Flag = false, $user_id = '')
 {
     if ($paginate) {
         $select = new Select('messages');
         $select->columns(array('*', new Expression("from_user.user_name as from_user, to_user.user_name as to_user")));
         $select->join(array('from_user' => 'users'), 'from_user.id = messages.from_user_id', array(), 'left');
         $select->join(array('to_user' => 'users'), 'to_user.id = messages.to_user_id', array(), 'left');
         if ($Flag == "trash") {
             $select->where(array('deleteFlag' => '1'));
             $select->order('created_date ASC');
         } else {
             if ($Flag == "outbox") {
                 $select->where(array('from_user_id' => $user_id, 'deleteFlag' => '0'));
                 $select->order('created_date ASC');
             } else {
                 if ($Flag == "inbox") {
                     $select->where('to_user_id = ' . $user_id . ' AND deleteFlag = 0');
                     $select->order('created_date ASC');
                 }
             }
         }
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Messages());
         $paginatorAdapter = new DbSelect($select, $this->tableGateway->getAdapter(), $resultSetPrototype);
         $paginator = new Paginator($paginatorAdapter);
         return $paginator;
     }
     return $this->tableGateway->select();
 }
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:29,代码来源:MessagesTable.php

示例11: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Forum\\Model\\ThreadList' => function ($sm) {
         $tableGateway = $sm->get('ThreadListGateway');
         $table = new ThreadList($tableGateway);
         return $table;
     }, 'ThreadListGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Thread());
         return new TableGateway('forum', $dbAdapter, null, $resultSetPrototype);
     }, 'Forum\\Model\\PostList' => function ($sm) {
         $tableGateway = $sm->get('PostListGateway');
         $table = new PostList($tableGateway);
         return $table;
     }, 'PostListGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Post());
         return new TableGateway('posts', $dbAdapter, null, $resultSetPrototype);
     }, 'Forum\\Model\\UserList' => function ($sm) {
         $tableGateway = $sm->get('UserListGateway');
         $table = new UserList($tableGateway);
         return $table;
     }, 'UserListGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new User());
         return new TableGateway('users', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:jpollard92,项目名称:forum,代码行数:31,代码来源:Module.php

示例12: fetchAll

 public function fetchAll($request, $paginated = false)
 {
     if ($paginated) {
         // create a new Select object for the table album
         $select = new Select('album');
         $select->order($request['sort'] . " " . $request['order']);
         // Search
         if ($request['search']) {
             $x = $request['search'] . '%';
             $where = new \Zend\Db\Sql\Where();
             $where->like('title', $x);
             $where->or->like('artist', $x);
             $select->where($where);
         }
         // New result set based on the Album entity
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Album());
         // New pagination adapter object
         $paginatorAdapter = new DbSelect($select, $this->tableGateway->getAdapter(), $resultSetPrototype);
         $paginator = new Paginator($paginatorAdapter);
         return $paginator;
     }
     $resultSet = $this->tableGateway->select();
     return $resultSet;
 }
开发者ID:anshp,项目名称:new,代码行数:25,代码来源:AlbumTable.php

示例13: createService

 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $dbAdapter = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
     $resultSetPrototype = new ResultSet();
     $resultSetPrototype->setArrayObjectPrototype(new Product());
     return new TableGateway('table_product', $dbAdapter, null, $resultSetPrototype);
 }
开发者ID:RRcom,项目名称:Product,代码行数:7,代码来源:ProductTableGatewayServiceFactory.php

示例14: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Api\\Model\\GroupsTable' => function ($sm) {
         $tableGateway = $sm->get('GroupsTableGateway');
         $table = new GroupsTable($tableGateway);
         return $table;
     }, 'GroupsTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Group());
         return new TableGateway('groups', $dbAdapter, null, $resultSetPrototype);
     }, 'Api\\Model\\UsersTable' => function ($sm) {
         $tableGateway = $sm->get('UsersTableGateway');
         $table = new UsersTable($tableGateway);
         return $table;
     }, 'UsersTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new User());
         return new TableGateway('users', $dbAdapter, null, $resultSetPrototype);
     }, 'Api\\Model\\UsersToGroupsTable' => function ($sm) {
         $tableGateway = $sm->get('UsersToGroupsTableGateway');
         $table = new UsersToGroupsTable($tableGateway);
         return $table;
     }, 'UsersToGroupsTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new UserToGroup());
         return new TableGateway('users_to_groups', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:Mestari,项目名称:zf2-restful-api,代码行数:31,代码来源:Module.php

示例15: fetchAll

 public function fetchAll($paginate = true, $filter = array(), $orderBy = array())
 {
     if ($paginate) {
         $select = new Select('service_language');
         $select->join('lookup_status', 'lookup_status.status_id = service_language.status_id', array('status'), 'left');
         /* Data filter code start here*/
         if (count($filter) > 0) {
             $filter['language_name'] != "" ? $select->where("service_language.language_name LIKE '%" . $filter['language_name'] . "%'") : "";
             $filter['status_id'] != "" ? $select->where("service_language.status_id = " . $filter['status_id']) : "";
         }
         /* Data filter code end here*/
         /* Data sorting code starts here */
         if (count($orderBy) > 0 && $orderBy['sort_field'] != '' && $orderBy['sort_order'] != '') {
             switch ($orderBy['sort_field']) {
                 case 'language':
                     $select->order('service_language.language_name ' . $orderBy['sort_order']);
                     break;
                 case 'status':
                     $select->order('lookup_status.status ' . $orderBy['sort_order']);
                     break;
             }
         }
         /* Data sorting code ends here */
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new ServiceLanguages());
         $paginatorAdapter = new DbSelect($select, $this->tableGateway->getAdapter(), $resultSetPrototype);
         $paginator = new Paginator($paginatorAdapter);
         return $paginator;
     }
     return $this->tableGateway->select();
 }
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:31,代码来源:ServiceLanguagesTable.php


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