Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new HistoryEventPeer();
     }
     return self::$peer;
 }