コード例 #1
0
 /**
  * Load attributes into loaded entities
  *
  * @return Mage_Eav_Model_Entity_Collection_Abstract
  */
 public function _loadAttributes($printQuery = false, $logQuery = false)
 {
     if (empty($this->_items) || empty($this->_itemsById) || empty($this->_selectAttributes)) {
         return $this;
     }
     $entity = $this->getEntity();
     $entityIdField = $entity->getEntityIdField();
     $tableAttributes = array();
     foreach ($this->_selectAttributes as $attributeCode => $attributeId) {
         $attribute = AO::getSingleton('eav/config')->getCollectionAttribute($entity->getType(), $attributeCode);
         if ($attribute && !$attribute->isStatic()) {
             $tableAttributes[$attribute->getBackendTable()][] = $attributeId;
         }
     }
     foreach ($tableAttributes as $table => $attributes) {
         $select = $this->_getLoadAttributesSelect($table);
         try {
             $values = $this->_fetchAll($select, $attributes);
         } catch (Exception $e) {
             AO::printException($e, $select);
             $this->printLogQuery(true, true, $select);
             throw $e;
         }
         foreach ($values as $value) {
             $this->_setItemAttributeValue($value);
         }
     }
     return $this;
 }
コード例 #2
0
ファイル: Observer.php プロジェクト: ronseigel/agent-ohm
 public function installFailure($observer)
 {
     echo "<h2>There was a problem proceeding with Magento installation.</h2>";
     echo "<p>Please contact developers with error messages on this page.</p>";
     echo AO::printException($observer->getEvent()->getException());
 }