public function save($con = null) { if ($this->getUserId() == null) { if (sfContext::getInstance()->getUser()->isAuthenticated()) { $this->setUserId(sfContext::getInstance()->getUser()->getId()); } else { $user = sfGuardUserPeer::retrieveByUsername('admin'); $this->setUserId($user->getId()); } } parent::save(); }
public function getPeer() { if (self::$peer === null) { self::$peer = new HistoryEventPeer(); } return self::$peer; }