本文整理汇总了PHP中Mage_Core_Model_Email_Template::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Email_Template::getId方法的具体用法?PHP Mage_Core_Model_Email_Template::getId怎么用?PHP Mage_Core_Model_Email_Template::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Email_Template
的用法示例。
在下文中一共展示了Mage_Core_Model_Email_Template::getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例3: testSendTransactional
public function testSendTransactional()
{
$this->_model->sendTransactional('customer_create_account_email_template', array('name' => 'Sender Name', 'email' => 'sender@example.com'), 'recipient@example.com', 'Recipient Name');
$this->assertEquals('customer_create_account_email_template', $this->_model->getId());
$this->assertTrue($this->_model->getSentSuccess());
}
示例4: addTemplateToConfig
public function addTemplateToConfig(Mage_Core_Model_Email_Template $template, $templateCode = '', $scope = '', $scopeId = null)
{
if (!$templateCode) {
$templateCode = Mage::app()->getRequest()->getParam('templatecode');
}
try {
if (is_null($scopeId)) {
list($scope, $scopeId) = $this->_getCurrentScope();
}
$oReq = Mage::app()->getFrontController()->getRequest();
if ($scope) {
$templatePath = Mage::helper('aitemails')->getPathByEmailTemplateCode($templateCode);
if ($templatePath) {
Mage::getConfig()->saveConfig($templatePath, $template->getId(), $scope, $scopeId);
Mage::getConfig()->reinit();
Mage::app()->reinitStores();
//$this->_getRulerResource()->markConfig($configDataModel);
}
}
} catch (Exception $exc) {
}
}