本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: getAllIntroAdmin
/**
* Enter description here ...
* @return unknown
*/
public function getAllIntroAdmin()
{
$row = $this->db->fetchAll("SELECT * FROM intro");
return $row;
}