Public Member Functions | |
saveAction () |
Definition at line 35 of file IndexController.php.
saveAction | ( | ) |
Definition at line 37 of file IndexController.php.
00038 { 00039 $giftMessage = Mage::getModel('giftmessage/message'); 00040 if($this->getRequest()->getParam('message')) { 00041 $giftMessage->load($this->getRequest()->getParam('message')); 00042 } 00043 try { 00044 $entity = $giftMessage->getEntityModelByType($this->_getMappedType($this->getRequest()->getParam('type'))); 00045 00046 $giftMessage->setSender($this->getRequest()->getParam('sender')) 00047 ->setRecipient($this->getRequest()->getParam('recipient')) 00048 ->setMessage($this->getRequest()->getParam('messagetext')) 00049 ->save(); 00050 00051 00052 $entity->load($this->getRequest()->getParam('item')) 00053 ->setGiftMessageId($giftMessage->getId()) 00054 ->save(); 00055 00056 $this->getRequest()->setParam('message', $giftMessage->getId()); 00057 $this->getRequest()->setParam('entity', $entity); 00058 } catch (Exception $e) { 00059 00060 } 00061 00062 $this->loadLayout(); 00063 $this->renderLayout(); 00064 }