public function updateObject($values = null) { $object = parent::updateObject($values); $object->setForeignId($this->community->getId()); $object->setMemberId(sfContext::getInstance()->getUser()->getMemberId()); $object->setSubject(sfContext::getInstance()->getI18N()->__('%Community% introduction message')); $object->setIsSend(1); $messageTypeId = Doctrine::getTable('MessageType')->getMessageTypeIdByName('community_introduction'); $object->setMessageTypeId($messageTypeId); foreach ($this->getValue('member_id_list') as $memberId) { $this->saveSendList($object, $memberId); } return $object; }
public function updateObject($values = null) { $object = parent::updateObject($values); foreach ($this->embeddedForms as $key => $form) { if (!($form->getObject() && $form->getObject()->getFile())) { unset($this->embeddedForms[$key]); } } if (sfContext::getInstance()->getRequest()->getParameter('is_draft')) { $object->setIsSend(0); } else { $object->setIsSend(1); } $object->setMemberId(sfContext::getInstance()->getUser()->getMemberId()); $this->saveSendList($object); return $object; }