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


PHP Varien_Db_Adapter_Interface::fetchAll方法代码示例

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


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

示例1: getAttributeCodes

 /**
  * Retrieve attribute codes using for flat
  *
  * @return array
  */
 public function getAttributeCodes()
 {
     if ($this->_attributeCodes === null) {
         $this->_attributeCodes = array();
         $systemAttributes = array();
         $attributeNodes = Mage::getConfig()->getNode(self::XML_NODE_ATTRIBUTE_NODES)->children();
         foreach ($attributeNodes as $node) {
             $attributes = Mage::getConfig()->getNode((string) $node)->asArray();
             $attributes = array_keys($attributes);
             $systemAttributes = array_unique(array_merge($attributes, $systemAttributes));
         }
         $bind = array('backend_type' => Mage_Eav_Model_Entity_Attribute_Abstract::TYPE_STATIC, 'entity_type_id' => $this->getEntityTypeId());
         $select = $this->_connection->select()->from(array('main_table' => $this->getTable('eav/attribute')))->join(array('additional_table' => $this->getTable('catalog/eav_attribute')), 'additional_table.attribute_id = main_table.attribute_id')->where('main_table.entity_type_id = :entity_type_id');
         $whereCondition = array('main_table.backend_type = :backend_type', $this->_connection->quoteInto('additional_table.is_used_for_promo_rules = ?', 1), $this->_connection->quoteInto('additional_table.used_in_product_listing = ?', 1), $this->_connection->quoteInto('additional_table.used_for_sort_by = ?', 1), $this->_connection->quoteInto('main_table.attribute_code IN(?)', $systemAttributes));
         if ($this->getFlatHelper()->isAddFilterableAttributes()) {
             $whereCondition[] = $this->_connection->quoteInto('additional_table.is_filterable > ?', 0);
         }
         $select->where(implode(' OR ', $whereCondition));
         $attributesData = $this->_connection->fetchAll($select, $bind);
         Mage::getSingleton('eav/config')->importAttributesData($this->getEntityType(), $attributesData);
         foreach ($attributesData as $data) {
             $this->_attributeCodes[$data['attribute_id']] = $data['attribute_code'];
         }
         unset($attributesData);
     }
     return $this->_attributeCodes;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:32,代码来源:Product.php

示例2: testInsertArray

 /**
  * @param array $columns
  * @param array $data
  * @param array $expected
  * @dataProvider insertArrayDataProvider
  */
 public function testInsertArray(array $columns, array $data, array $expected)
 {
     $this->_connection->insertArray($this->_tableName, $columns, $data);
     $select = $this->_connection->select()->from($this->_tableName, array_keys($expected[0]))->order('column1');
     $result = $this->_connection->fetchAll($select);
     $this->assertEquals($expected, $result);
 }
开发者ID:nemphys,项目名称:magento2,代码行数:13,代码来源:InterfaceTest.php

示例3: getByConnection

 /**
  * Get a list of host names for the supplied database adapter.
  *
  * @param \Varien_Db_Adapter_Interface $db
  * @return array
  */
 public function getByConnection(\Varien_Db_Adapter_Interface $db)
 {
     return $this->filterHostNames(array_map(function (array $row) {
         return $row['url'];
     }, $db->fetchAll($this->createSelect($db))));
 }
开发者ID:ksangers,项目名称:environment,代码行数:12,代码来源:HostNameFetcher.php

示例4: isEntityProcessed

 /**
  * Check is entity processed
  *
  * @param $type string category|product
  * @param $id   string
  * @return bool
  */
 function isEntityProcessed($type, $id)
 {
     $select = $this->_connection->select()->from($this->getEntityMigrationTable($type))->where('id = ?', $id);
     return (bool) count($this->_connection->fetchAll($select));
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:12,代码来源:Migration.php


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