Пример #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aJobTemplate !== null) {
             if ($this->aJobTemplate->isModified()) {
                 $affectedRows += $this->aJobTemplate->save($con);
             }
             $this->setJobTemplate($this->aJobTemplate);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = UserGroupPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += UserGroupPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collAcls !== null) {
             foreach ($this->collAcls as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collUsers !== null) {
             foreach ($this->collUsers as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }