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


PHP ResultSet::setArrayObjectPrototype方法代码示例

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


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

示例1: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Application\\Model\\LoginTable' => function ($sm) {
         $loginGateway = $sm->get('LoginTableGateway');
         $table = new LoginTable($loginGateway);
         return $table;
     }, 'LoginTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetProtype = new ResultSet();
         $resultSetProtype->setArrayObjectPrototype(new Login());
         return new TableGateway('login', $dbAdapter, null, $resultSetProtype);
     }, 'Application\\Model\\PortfolioTable' => function ($sm) {
         $portfolioGateway = $sm->get('PortfolioTableGateway');
         $table = new PortfolioTable($portfolioGateway);
         return $table;
     }, 'PortfolioTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetProtype = new ResultSet();
         $resultSetProtype->setArrayObjectPrototype(new Portfolio());
         return new TableGateway('portfolio', $dbAdapter, null, $resultSetProtype);
     }, 'Application\\Model\\FotosTable' => function ($sm) {
         $fotosGateway = $sm->get('FotosTableGateway');
         $table = new FotosTable($fotosGateway);
         return $table;
     }, 'FotosTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetProtype = new ResultSet();
         $resultSetProtype->setArrayObjectPrototype(new Fotos());
         return new TableGateway('fotos', $dbAdapter, null, $resultSetProtype);
     }));
 }
开发者ID:joonsantiago,项目名称:nortes,代码行数:31,代码来源:Module.php

示例2: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Application\\Model\\KategorieTable' => function ($sm) {
         $tableGateway = $sm->get('KategorieTableGateway');
         $table = new KategorieTable($tableGateway);
         return $table;
     }, 'KategorieTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Kategorie());
         return new TableGateway('kategorie', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\UserTable' => function ($sm) {
         $tableGateway = $sm->get('UserTableGateway');
         $table = new UserTable($tableGateway);
         return $table;
     }, 'UserTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new User());
         return new TableGateway('uzivatele', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\BannerTable' => function ($sm) {
         $tableGateway = $sm->get('BannerTableGateway');
         $table = new BannerTable($tableGateway);
         return $table;
     }, 'BannerTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Banner());
         return new TableGateway('banner', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:kouks,项目名称:Trinec,代码行数:31,代码来源:Module.php

示例3: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Application\\Model\\StateTable' => function ($sm) {
         $tableGateway = $sm->get('StateTableGateway');
         $table = new StateTable($tableGateway);
         return $table;
     }, 'StateTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new State());
         return new TableGateway(DB_PREFIX . 'state', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\CityTable' => function ($sm) {
         $tableGateway = $sm->get('CityTableGateway');
         $table = new CityTable($tableGateway);
         return $table;
     }, 'CityTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new City());
         return new TableGateway(DB_PREFIX . 'city', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\PostMerchandiseTable' => function ($sm) {
         $tableGateway = $sm->get('PostMerchandiseTableGateway');
         $table = new PostMerchandiseTable($tableGateway);
         return $table;
     }, 'PostMerchandiseTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Post());
         return new TableGateway(DB_PREFIX . 'post_merchandise', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:joegaBonito,项目名称:VIZISELLS--Internship-,代码行数:31,代码来源:Module.php

示例4: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Usuario\\Model\\UsuarioTable' => function ($sm) {
         $tableGateway = $sm->get('UsuarioTableGateway');
         $table = new UsuarioTable($tableGateway);
         return $table;
     }, 'UsuarioTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Usuario());
         return new TableGateway('ta_usuario', $dbAdapter, null, $resultSetPrototype);
     }, 'Usuario\\Model\\Cliente' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $table = new Cliente($dbAdapter);
         return $table;
     }, 'Usuario\\Model\\ComentariosTable' => function ($sm) {
         $tableGateway = $sm->get('ComentariosTableGateway');
         $table = new Model\ComentariosTable($tableGateway);
         return $table;
     }, 'ComentariosTableGateway' => function ($sm) {
         $dbAdapte = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Comentarios());
         return new TableGateway('ta_comentario', $dbAdapte, null, $resultSetPrototype);
     }, 'Usuario\\Model\\ClientesTable' => function ($sm) {
         $tableGateway = $sm->get('ClientesTableGateway');
         $table = new Model\ClientesTable($tableGateway);
         return $table;
     }, 'ClientesTableGateway' => function ($sm) {
         $dbAdapte = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Clientes());
         return new TableGateway('ta_cliente', $dbAdapte, null, $resultSetPrototype);
     }));
 }
开发者ID:kevcast,项目名称:lsrefactoring,代码行数:35,代码来源:Module.php

示例5: 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

示例6: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Application\\Model\\PaymentTable' => function ($sm) {
         $tableGateway = $sm->get('PaymentTableGateway');
         $table = new PaymentTable($tableGateway);
         return $table;
     }, 'PaymentTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Payment());
         return new TableGateway('payments_history', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\HuntClubTable' => function ($sm) {
         $tableGateway = $sm->get('HuntClubTableGateway');
         $table = new HuntClubTable($tableGateway);
         return $table;
     }, 'HuntClubTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new HuntClub());
         return new TableGateway('hunt_clubs', $dbAdapter, null, $resultSetPrototype);
     }, 'Application\\Model\\HuntClubGameTable' => function ($sm) {
         $tableGateway = $sm->get('HuntClubGameTableGateway');
         $table = new HuntClubGameTable($tableGateway);
         return $table;
     }, 'HuntClubGameTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new HuntClubGame());
         return new TableGateway('hunt_club_game', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:bladehr8,项目名称:bowhunter2015,代码行数:31,代码来源:Module.php

示例7: getUsersAndAbove

 public function getUsersAndAbove(bool $paginated, $name = '', $roles = [])
 {
     $select = new Select('account');
     $where = new Where();
     if ($roles) {
         $sub = $where->nest();
         for ($i = 0; $i < count($roles); $i++) {
             $sub->equalTo('role', $roles[$i]);
             if ($i < count($roles) - 1) {
                 $sub->or;
             }
         }
         $sub->unnest();
     } else {
         $where->greaterThan('role', '0');
         $where->lessThan('role', '32');
     }
     if ($name) {
         $where->like('name', '%' . $name . '%');
     }
     $select->where($where)->order('name ASC');
     if ($paginated) {
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Account());
         $paginatorAdapter = new DbSelect($select, $this->tableGateway->getAdapter(), $resultSetPrototype);
         return new Paginator($paginatorAdapter);
     }
     return $this->tableGateway->select($select);
 }
开发者ID:snowiow,项目名称:eternaldeztiny,代码行数:29,代码来源:AccountTable.php

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: __construct

 public function __construct(DBEntity $object, AdapterInterface $adapter, $features = null)
 {
     $this->object = $object;
     $resultSetPrototype = new ResultSet();
     $resultSetPrototype->setArrayObjectPrototype($object);
     parent::__construct($object->getTableName(), $adapter, $features, $resultSetPrototype);
 }
开发者ID:rodrigogk87,项目名称:djme,代码行数:7,代码来源:DJMeTableGateway.php

示例13: getServiceConfig

 public function getServiceConfig()
 {
     return array('factories' => array('Pizza\\Model\\PizzaTable' => function ($sm) {
         $tableGateway = $sm->get('PizzaTableGateway');
         $table = new PizzaTable($tableGateway);
         return $table;
     }, 'PizzaTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Pizza());
         return new TableGateway('pizza', $dbAdapter, null, $resultSetPrototype);
     }, 'Pizza\\Model\\SandwichTable' => function ($sm) {
         $tableGateway = $sm->get('SandwichTableGateway');
         $table = new SandwichTable($tableGateway);
         return $table;
     }, 'SandwichTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Sandwich());
         return new TableGateway('sandwich', $dbAdapter, null, $resultSetPrototype);
     }, 'Pizza\\Model\\DrinkTable' => function ($sm) {
         $tableGateway = $sm->get('DrinkTableGateway');
         $table = new DrinkTable($tableGateway);
         return $table;
     }, 'DrinkTableGateway' => function ($sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Drink());
         return new TableGateway('drink', $dbAdapter, null, $resultSetPrototype);
     }));
 }
开发者ID:Dawarate,项目名称:pizza,代码行数:31,代码来源:Module.php

示例14: getServiceConfig

 /**
  * Expected to return \Zend\ServiceManager\Config object or array to
  * seed such an object.
  *
  * @return array|\Zend\ServiceManager\Config
  */
 public function getServiceConfig()
 {
     return ['factories' => ['ArticleTable' => function (ServiceLocatorInterface $sm) {
         $tableGateway = $sm->get('ArticleTableGateway');
         $table = new ArticleTable($tableGateway);
         return $table;
     }, 'ArticleTableGateway' => function (ServiceLocatorInterface $sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new Article());
         return new TableGateway('tbl_article', $dbAdapter, null, $resultSetPrototype);
     }, 'UserTable' => function (ServiceLocatorInterface $sm) {
         $tableGateway = $sm->get('UserTableGateway');
         $table = new UserTable($tableGateway);
         return $table;
     }, 'UserTableGateway' => function (ServiceLocatorInterface $sm) {
         $dbAdapter = $sm->get('Zend\\Db\\Adapter\\Adapter');
         $resultSetPrototype = new ResultSet();
         $resultSetPrototype->setArrayObjectPrototype(new User());
         return new TableGateway('tbl_user', $dbAdapter, null, $resultSetPrototype);
     }, 'Smarty' => function (ServiceLocatorInterface $sm) {
         $smarty = new MySmarty();
         $smarty->debugging = false;
         $smarty->caching = false;
         $smarty->cache_lifetime = 120;
         $smarty->setTemplateDir(__DIR__ . '/view/smarty/templates');
         $smarty->setConfigDir(__DIR__ . '/view/smarty/configs');
         $smarty->setCompileDir(__DIR__ . '/view/smarty/templates_c');
         $smarty->setCacheDir(__DIR__ . '/view/smarty/cache');
         return $smarty;
     }]];
 }
开发者ID:329379172,项目名称:tbtool,代码行数:38,代码来源:module.php

示例15: 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


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