/** * Also need to create a JustGivingEvent object, if not already existing. * @param $con * @return Event object */ public function save($con = null) { $event = parent::save($con); //also, create a JustGivingEvent connecting to this. $jgEvent = Doctrine_Core::getTable('JustGivingEvent')->findOneByEvent($event->id); if ($jgEvent == false) { $jgEvent = new JustGivingEvent(); $jgEvent->Event = $event; $jgEvent->save(); } return $event; }
protected function doUpdateObject($values) { // событие перенесено? if (strtotime($this->object->getFireAt()) != strtotime($values['fire_at'])) { $values['last_fire_at'] = $this->object->getFireAt(); } parent::doUpdateObject($values); // "я иду" if (isset($values['iamgoing']) && $values['iamgoing']) { $user = sfContext::getInstance()->getUser()->getGuardUser(); if (!$this->object->hasFollower($user->getId())) { $accept = new PointUser(); $accept->setPoint($this->object); $accept->setUser($user); $accept->save(); } } }
public function configure() { parent::configure(); }