Mage_GiftMessage_Model_Message Class Reference

Inheritance diagram for Mage_GiftMessage_Model_Message:

Mage_Core_Model_Abstract Varien_Object

List of all members.

Public Member Functions

 getEntityModelByType ($type)
 isMessageEmpty ()

Static Public Member Functions

static getAllowedEntityTypes ()

Protected Member Functions

 _construct ()

Static Protected Attributes

static $_allowedEntityTypes


Detailed Description

Definition at line 35 of file Message.php.


Member Function Documentation

_construct (  )  [protected]

Enter description here...

Reimplemented from Varien_Object.

Definition at line 52 of file Message.php.

00053     {
00054         $this->_init('giftmessage/message');
00055     }

static getAllowedEntityTypes (  )  [static]

Return list of allowed entities for using in gift messages

Returns:
array

Definition at line 88 of file Message.php.

00089     {
00090         return self::$_allowedEntityTypes;
00091     }

getEntityModelByType ( type  ) 

Return model from entity type

Parameters:
string $type
Returns:
Mage_Eav_Model_Entity_Abstract

Definition at line 63 of file Message.php.

00064     {
00065         $types = self::getAllowedEntityTypes();
00066         if(!isset($types[$type])) {
00067             Mage::throwException(Mage::helper('giftmessage')->__('Unknown entity type'));
00068         }
00069 
00070         return Mage::getModel($types[$type]);
00071     }

isMessageEmpty (  ) 

Checks thats gift message is empty

Returns:
boolean

Definition at line 78 of file Message.php.

00079     {
00080         return trim($this->getMessage()) == '';
00081     }


Member Data Documentation

$_allowedEntityTypes [static, protected]

Initial value:

 array(
        'order'         => 'sales/order',
        'order_item'    => 'sales/order_item',
        'order_address' => 'sales/order_address',
        'quote'         => 'sales/quote',
        'quote_item'    => 'sales/quote_item',
        'quote_address' => 'sales/quote_address',
        'quote_address_item' => 'sales/quote_address_item'
    )

Definition at line 42 of file Message.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:13 2009 for Magento by  doxygen 1.5.8