Mage_Eav_Model_Mysql4_Entity_Attribute_Group Class Reference

Inheritance diagram for Mage_Eav_Model_Mysql4_Entity_Attribute_Group:

Mage_Core_Model_Mysql4_Abstract Mage_Core_Model_Resource_Abstract

List of all members.

Public Member Functions

 itemExists ($object)

Protected Member Functions

 _construct ()
 _beforeSave (Mage_Core_Model_Abstract $object)
 _afterSave (Mage_Core_Model_Abstract $object)


Detailed Description

Definition at line 28 of file Group.php.


Member Function Documentation

_afterSave ( Mage_Core_Model_Abstract object  )  [protected]

Perform actions after object save

Parameters:
Mage_Core_Model_Abstract $object

Reimplemented from Mage_Core_Model_Mysql4_Abstract.

Definition at line 65 of file Group.php.

00066     {
00067         if ($object->getAttributes()) {
00068             foreach ($object->getAttributes() as $attribute) {
00069                 $attribute->setAttributeGroupId($object->getId());
00070                 $attribute->save();
00071             }
00072         }
00073         return parent::_afterSave($object);
00074     }

_beforeSave ( Mage_Core_Model_Abstract object  )  [protected]

Perform actions before object save

Parameters:
Mage_Core_Model_Abstract $object

Reimplemented from Mage_Core_Model_Mysql4_Abstract.

Definition at line 52 of file Group.php.

00053     {
00054         if (!$object->getSortOrder()) {
00055             $object->setSortOrder($this->_getMaxSortOrder($object) + 1);
00056         }
00057         return parent::_beforeSave($object);
00058     }

_construct (  )  [protected]

Resource initialization

Reimplemented from Mage_Core_Model_Resource_Abstract.

Definition at line 30 of file Group.php.

00031     {
00032         $this->_init('eav/attribute_group', 'attribute_group_id');
00033     }

itemExists ( object  ) 

Definition at line 35 of file Group.php.

00036     {
00037         $read = $this->_getReadAdapter();
00038         $select = $read->select()->from($this->getMainTable())
00039             ->where("attribute_group_name='{$object->getAttributeGroupName()}'");
00040         $data = $read->fetchRow($select);
00041         if (!$data) {
00042             return false;
00043         }
00044         return true;
00045     }


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

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