Пример #1
0
 public function save($connection = null)
 {
     if (QubitActor::ROOT_ID != $this->id && !isset($this->parentId) && 'QubitActor' == $this->className) {
         $this->parentId = QubitActor::ROOT_ID;
     }
     parent::save($connection);
     // Save related event objects
     foreach ($this->events as $event) {
         // Update search index for related info object
         $event->setIndexOnSave(true);
         $event->actor = $this;
         try {
             $event->save();
         } catch (PropelException $e) {
         }
     }
     // Save related contact information objects
     foreach ($this->contactInformations as $item) {
         $item->actor = $this;
         try {
             $item->save();
         } catch (PropelException $e) {
         }
     }
     QubitSearch::updateActorIndex($this);
     return $this;
 }