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


PHP Zend_Db::fetchAll方法代码示例

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


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

示例1: getAllDefaultRoles

 /**
  * 获取所有默认角色
  *
  * @return array
  */
 public function getAllDefaultRoles()
 {
     if (null == self::$_allDefaultRoles) {
         self::$_allDefaultRoles = $this->_cache->load('acl_all_default_roles');
         if (self::$_allDefaultRoles == false) {
             $rows = $this->_db->select()->from(array('role' => 'acl_role'), array('role_name', 'mod_name'))->join('acl_module', 'acl_module.mod_name=role.mod_name', array())->where('role.is_guest=0')->where('role.is_default=1');
             $rows = $this->_db->fetchAll($rows);
             $roles = array();
             foreach ($rows as $row) {
                 $roles[$row['mod_name']] = "{$row['mod_name']}.{$row['role_name']}";
             }
             self::$_allDefaultRoles = $roles;
             $this->_cache->save($roles, 'acl_all_default_roles');
         }
     }
     return self::$_allDefaultRoles;
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:22,代码来源:Auth.php

示例2: getListOfAllNewProducts

 /**
  * Get the list of the products for all categories
  *
  *
  * @return array
  */
 public function getListOfAllNewProducts()
 {
     $products = array();
     $this->getDataByName();
     $oProducts = new ProductsObject();
     $oSubCat = new SubCategoriesObject();
     $oCategory = new CatalogCategoriesObject();
     $subCategories = $oSubCat->getSubCatByCategory(0, false, $this->_currentLang);
     $oCategory->setQuery($subCategories);
     $categoryQuery = $oCategory->getDataCatagory($this->_currentLang, false);
     $oProducts->setQuery($categoryQuery);
     $select = $oProducts->getProducts($this->_currentLang, false);
     $select->where('P_New = 1');
     $select->order('PI_Name ASC');
     $products = $this->_db->fetchAll($select);
     //echo $select;
     return $products;
 }
开发者ID:anunay,项目名称:stentors,代码行数:24,代码来源:ProductsCollection.php

示例3: makeAcl

 /**
  * get roles and resources from db, build Zend_Acl structure and add permissions
  * @param Zend_Db $db
  */
 protected function makeAcl($db)
 {
     $acl = new Zend_Acl();
     $res = $db->fetchAll('select * from system_role');
     foreach ($res as $obj) {
         if ($obj['inherit_role'] != '') {
             if ($acl->hasRole($obj['inherit_role'])) {
                 $acl->addRole(new Zend_Acl_Role($obj['role']), $obj['inherit_role']);
             } else {
                 /**
                  * @todo very simply system to order roles, add role before inherited role
                  */
                 $res[] = $obj;
                 continue;
             }
         } else {
             $acl->addRole(new Zend_Acl_Role($obj['role']));
         }
     }
     $res = $db->fetchAll('select * from system_resource');
     foreach ($res as $obj) {
         $acl->addResource(new Zend_Acl_Resource($obj['resource']));
     }
     $res = $db->fetchAll('select r.role as role, rs.resource as resource, permission, privilege ' . 'from system_role as r join system_role_has_system_resource as m on ' . '(r.id = m.system_role_id) join system_resource as rs on (m.system_resource_id = rs.id)');
     foreach ($res as $obj) {
         $privilege = explode(',', $obj['privilege']);
         if ($obj['permission'] == 'allow') {
             $acl->allow($obj['role'], $obj['resource'], $privilege);
         } else {
             $acl->deny($obj['role'], $obj['resource'], $privilege);
         }
     }
     return $acl;
 }
开发者ID:NEOatNHNG,项目名称:cacert-testmgr,代码行数:38,代码来源:LoginController.php

示例4: getAllIntroAdmin

 /**
  * Enter description here ...
  * @return unknown
  */
 public function getAllIntroAdmin()
 {
     $row = $this->db->fetchAll("SELECT * FROM intro");
     return $row;
 }
开发者ID:laiello,项目名称:vinhloi,代码行数:9,代码来源:Intro.php


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