Example #1
0
 /**
  * Tests Varien_Object->isDeleted()
  */
 public function testIsDeleted()
 {
     $this->assertFalse($this->_object->isDeleted());
     $this->_object->isDeleted();
     $this->assertFalse($this->_object->isDeleted());
     $this->_object->isDeleted(true);
     $this->assertTrue($this->_object->isDeleted());
 }
Example #2
0
 /**
  * Save entity's attributes into the object's resource
  *
  * @param   Varien_Object $object
  * @return  Mage_Eav_Model_Entity_Abstract
  */
 public function save(Varien_Object $object)
 {
     if ($object->isDeleted()) {
         return $this->delete($object);
     }
     if (!$this->isPartialSave()) {
         $this->loadAllAttributes($object);
     }
     if (!$object->getEntityTypeId()) {
         $object->setEntityTypeId($this->getTypeId());
     }
     $object->setParentId((int) $object->getParentId());
     $this->_beforeSave($object);
     $this->_processSaveData($this->_collectSaveData($object));
     $this->_afterSave($object);
     return $this;
 }