예제 #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aEmployee !== null) {
             if ($this->aEmployee->isModified()) {
                 $affectedRows += $this->aEmployee->save($con);
             }
             $this->setEmployee($this->aEmployee);
         }
         if ($this->aCatCategory !== null) {
             if ($this->aCatCategory->isModified()) {
                 $affectedRows += $this->aCatCategory->save($con);
             }
             $this->setCatCategory($this->aCatCategory);
         }
         if ($this->aDepartment !== null) {
             if ($this->aDepartment->isModified()) {
                 $affectedRows += $this->aDepartment->save($con);
             }
             $this->setDepartment($this->aDepartment);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = VTotalUploadPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setNew(false);
             } else {
                 $affectedRows += VTotalUploadPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }