本文整理汇总了PHP中Mage::throwexception方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::throwexception方法的具体用法?PHP Mage::throwexception怎么用?PHP Mage::throwexception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage
的用法示例。
在下文中一共展示了Mage::throwexception方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getLinkAttr
protected function _getLinkAttr($linkType, $linkAttr = null, $param = null)
{
if (!is_null($linkType)) {
$linkTypeId = is_numeric($linkType) ? $linkType : $this->_getLinkTypeId($linkType);
}
if (empty($this->_linkAttrs)) {
$attrs = $this->_read->fetchAll("select * from {$this->_t("catalog/product_link_attribute")}");
foreach ($attrs as $a) {
$this->_linkAttrs[$a['link_type_id']][$a['product_link_attribute_code']] = array("id" => $a['product_link_attribute_id'], "code" => $a['product_link_attribute_code'], "data_type" => $a['data_type']);
$this->_linkAttrIds[$a['product_link_attribute_id']] = $a['product_link_attribute_code'];
}
}
if (is_null($linkType)) {
return $this->_linkAttrs;
}
if (empty($this->_linkAttrs[$linkTypeId])) {
Mage::throwexception($this->__("Invalid product link type (%s)", $linkType));
}
if (is_null($linkAttr)) {
return $this->_linkAttrs[$linkTypeId];
}
if (is_numeric($linkAttr) && !empty($this->_linkAttrIds[$linkAttr])) {
$linkAttr = $this->_linkAttrIds[$linkAttr];
}
if (empty($this->_linkAttrs[$linkTypeId][$linkAttr])) {
Mage::throwexception($this->__("Invalid product link attribute (%s, %s)", $linkType, $linkAttr));
}
$attr = $this->_linkAttrs[$linkTypeId][$linkAttr];
return is_null($param) ? $attr : $attr[$param];
}
示例2: _getAttributeSetFields
protected function _getAttributeSetFields($attrSet)
{
if ($attrSet && !is_numeric($attrSet)) {
$attrSet = $this->_attr("product.attribute_set", "options_bytext", strtolower($attrSet));
}
if (!$attrSet) {
Mage::throwexception($this->__("Invalid attribute set"));
}
if (empty($this->_attributeSetFields[$attrSet])) {
$this->_attributeSetFields[$attrSet] = $this->_write->fetchPairs("select a.attribute_code, a.attribute_id from {$this->_t("eav/entity_attribute")} ea inner join {$this->_t("eav/attribute")} a on a.attribute_id=ea.attribute_id where attribute_set_id={$attrSet}");
}
return $this->_attributeSetFields[$attrSet];
}
示例3: _deleteRowEAOL
protected function _deleteRowEAOL($row)
{
if (sizeof($row) < 4) {
Mage::throwexception($this->__("Invalid row format"));
}
$aTable = $this->_t("eav/attribute");
$oTable = $this->_t("eav/attribute_option");
$olTable = $this->_t("eav/attribute_option_value");
$label = $this->_convertEncoding($row[2]);
$etId = $this->_getEntityType(!empty($row[4]) ? $row[4] : "catalog_product", "entity_type_id");
if (!$etId) {
$this->_profile->getLogger()->setColumn(5);
Mage::throwexception($this->__("Invalid entity type"));
}
$sId = $this->_getStoreId($row[3]);
if ($this->_skipStore($sId, 4)) {
return self::IMPORT_ROW_RESULT_NOCHANGE;
}
$existsId = $this->_write->fetchOne("select ol.value_id from {$oTable} o\n inner join {$aTable} a on a.attribute_id=o.attribute_id\n inner join {$olTable} od on od.option_id=o.option_id and od.store_id=0\n inner join {$olTable} ol on ol.option_id=o.option_id and ol.store_id={$sId}\n where a.entity_type_id={$etId} and a.attribute_code={$this->_write->quote($row[1])} and od.value={$this->_write->quote($label)}");
if ($existsId) {
$this->_write->delete($olTable, "value_id={$existsId}");
return self::IMPORT_ROW_RESULT_SUCCESS;
}
return self::IMPORT_ROW_RESULT_NOCHANGE;
}