本文整理汇总了PHP中Mage_Core_Model_Email_Template::getTemplateActual方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Email_Template::getTemplateActual方法的具体用法?PHP Mage_Core_Model_Email_Template::getTemplateActual怎么用?PHP Mage_Core_Model_Email_Template::getTemplateActual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Email_Template
的用法示例。
在下文中一共展示了Mage_Core_Model_Email_Template::getTemplateActual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkCodeUsage
/**
* Check usage of template code in other templates
*
* @param Mage_Core_Model_Email_Template $template
* @return boolean
*/
public function checkCodeUsage(Mage_Core_Model_Email_Template $template)
{
if ($template->getTemplateActual() != 0 || is_null($template->getTemplateActual())) {
$select = $this->_read->select()->from($this->_templateTable, new Zend_Db_Expr('COUNT(template_id)'))->where('template_id!=?', $template->getId())->where('template_code=?', $template->getTemplateCode());
$countOfCodes = $this->_read->fetchOne($select);
return $countOfCodes > 0;
} else {
return false;
}
}
示例2: checkCodeUsage
/**
* Check usage of template code in other templates
*
* @param Mage_Core_Model_Email_Template $template
* @return boolean
*/
public function checkCodeUsage(Mage_Core_Model_Email_Template $template)
{
if ($template->getTemplateActual() != 0 || is_null($template->getTemplateActual())) {
$select = $this->_getReadAdapter()->select()->from($this->getMainTable(), 'COUNT(*)')->where('template_id != :template_id')->where('template_code = :template_code');
$bind = array('template_id' => $template->getId(), 'template_code' => $template->getTemplateCode());
$result = $this->_getReadAdapter()->fetchOne($select, $bind);
if ($result) {
return true;
}
}
return false;
}