本文整理汇总了PHP中Mage_Core_Model_Message_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Message_Abstract类的具体用法?PHP Mage_Core_Model_Message_Abstract怎么用?PHP Mage_Core_Model_Message_Abstract使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Core_Model_Message_Abstract类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMessageCssClass
public function getMessageCssClass(Mage_Core_Model_Message_Abstract $message)
{
if (isset(self::$_messageMap[$message->getType()])) {
return self::$_messageMap[$message->getType()];
}
return $message->getType();
}
示例2: addMessage
public function addMessage(Mage_Core_Model_Message_Abstract $message)
{
if (!isset($this->_messages[$message->getType()])) {
$this->_messages[$message->getType()] = array();
}
$this->_messages[$message->getType()][] = $message;
return $this;
}
示例3: addMessage
/**
* Adding new message to collection
*
* @param Mage_Core_Model_Message_Abstract $message
* @return Mage_Core_Model_Message_Collection
*/
public function addMessage(Mage_Core_Model_Message_Abstract $message)
{
// Only do this for MB, not Magento standalone
if (Mage::getSingleton('magebridge/core')->getMetaData('enable_messages') == 1) {
$text = base64_encode($message->getCode());
switch ($message->getType()) {
case 'error':
header('X-MageBridge-Error: ' . $text);
break;
case 'warning':
header('X-MageBridge-Warning: ' . $text);
break;
case 'success':
case 'notice':
default:
header('X-MageBridge-Notice: ' . $text);
break;
}
}
// Perform the parent action
return parent::addMessage($message);
}
示例4: addMessage
public function addMessage(Mage_Core_Model_Message_Abstract $message)
{
// ensure duplicate messages are not added
$identifier = md5($message->getType() . '-' . $message->getText() . '-' . $message->getCode() . '-' . $message->getIdentifier() . '-' . (int) $message->getIsSticky());
$messages = $this->getMessages()->getItems();
foreach ($messages as $m) {
$identifier2 = md5($m->getType() . '-' . $m->getText() . '-' . $m->getCode() . '-' . $m->getIdentifier() . '-' . (int) $m->getIsSticky());
if ($identifier == $identifier2) {
return $this;
}
}
return parent::addMessage($message);
}
示例5: addMessage
public function addMessage(Mage_Core_Model_Message_Abstract $message)
{
$message->setIdentifier(uniqid() . '|' . $this->_now);
return parent::addMessage($message);
}
示例6: addMessage
/**
* Adding new message to message collection
*
* @param Mage_Core_Model_Message_Abstract $message
* @return Mage_Core_Block_Messages
*/
public function addMessage(Mage_Core_Model_Message_Abstract $message)
{
if ($this->_fixMessages()) {
$this->_saveMessages($message->getItems());
} else {
parent::addMessage($message);
}
return $this;
}
示例7: __construct
public function __construct($code)
{
parent::__construct(Mage_Core_Model_Message::ERROR, $code);
}
示例8: __construct
/**
* Constructor for to initialize the message with
* the passed code.
*
* @param string $code The code to initialize the message with
* @return void
*/
public function __construct($code)
{
parent::__construct(Faett_Manager_Model_Message::CONSOLE, $code);
}
示例9: __construct
/**
* Initializes a migration message.
*
* @param string $code
* @return void
*/
public function __construct($code)
{
return parent::__construct(self::MESSAGE_TYPE, $code);
}