示例#1
0
 public function save(Doctrine_Connection $conn = null)
 {
     if (!$this->getOwnerId()) {
         $user = sfContext::getInstance()->getUser();
         if ($user->getGuardUser()) {
             $this->setOwnerId($user->getGuardUser()->getId());
         }
     }
     // Let the culture be the user's culture
     return aZendSearch::saveInDoctrineAndLucene($this, null, $conn);
 }
示例#2
0
 /**
  * DOCUMENT ME
  * @param Doctrine_Connection $conn
  * @return mixed
  */
 public function save(Doctrine_Connection $conn = null)
 {
     if (!$this->getOwnerId()) {
         if (sfContext::hasInstance()) {
             $user = sfContext::getInstance()->getUser();
             if ($user->getGuardUser()) {
                 $this->setOwnerId($user->getGuardUser()->getId());
             }
         }
     }
     // Let the culture be the user's culture
     $result = aZendSearch::saveInDoctrineAndLucene($this, null, $conn);
     $crops = $this->getCrops();
     foreach ($crops as $crop) {
         $crop->setTitle($this->getTitle());
         $crop->setDescription($this->getDescription());
         $crop->setCredit($this->getCredit());
         $crop->save();
     }
     return $result;
 }