Example #1
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->articulosScheduledForDeletion !== null) {
             if (!$this->articulosScheduledForDeletion->isEmpty()) {
                 ArticuloQuery::create()->filterByPrimaryKeys($this->articulosScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->articulosScheduledForDeletion = null;
             }
         }
         if ($this->collArticulos !== null) {
             foreach ($this->collArticulos as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #2
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aArticulo !== null) {
             if ($this->aArticulo->isModified() || $this->aArticulo->isNew()) {
                 $affectedRows += $this->aArticulo->save($con);
             }
             $this->setArticulo($this->aArticulo);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->articulovariantevalorsScheduledForDeletion !== null) {
             if (!$this->articulovariantevalorsScheduledForDeletion->isEmpty()) {
                 ArticulovariantevalorQuery::create()->filterByPrimaryKeys($this->articulovariantevalorsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->articulovariantevalorsScheduledForDeletion = null;
             }
         }
         if ($this->collArticulovariantevalors !== null) {
             foreach ($this->collArticulovariantevalors as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->propiedadvalorsScheduledForDeletion !== null) {
             if (!$this->propiedadvalorsScheduledForDeletion->isEmpty()) {
                 PropiedadvalorQuery::create()->filterByPrimaryKeys($this->propiedadvalorsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->propiedadvalorsScheduledForDeletion = null;
             }
         }
         if ($this->collPropiedadvalors !== null) {
             foreach ($this->collPropiedadvalors as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #3
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->usersScheduledForDeletion !== null) {
             if (!$this->usersScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->usersScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($remotePk, $pk);
                 }
                 UserSkillQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->usersScheduledForDeletion = null;
             }
             foreach ($this->getUsers() as $user) {
                 if ($user->isModified()) {
                     $user->save($con);
                 }
             }
         } elseif ($this->collUsers) {
             foreach ($this->collUsers as $user) {
                 if ($user->isModified()) {
                     $user->save($con);
                 }
             }
         }
         if ($this->userSkillsScheduledForDeletion !== null) {
             if (!$this->userSkillsScheduledForDeletion->isEmpty()) {
                 UserSkillQuery::create()->filterByPrimaryKeys($this->userSkillsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userSkillsScheduledForDeletion = null;
             }
         }
         if ($this->collUserSkills !== null) {
             foreach ($this->collUserSkills as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
 public function testCollectionAdd()
 {
     $manager = new ModelManager();
     $collection = new \PropelObjectCollection();
     $object = new \stdClass();
     $object->foo = 42;
     $this->assertTrue($collection->isEmpty());
     $manager->collectionAddElement($collection, $object);
     $this->assertSame(array($object), $collection->getArrayCopy());
     $this->assertCount(1, $collection);
 }
Example #5
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->transaccionsScheduledForDeletion !== null) {
             if (!$this->transaccionsScheduledForDeletion->isEmpty()) {
                 foreach ($this->transaccionsScheduledForDeletion as $transaccion) {
                     // need to save related object because we set the relation to null
                     $transaccion->save($con);
                 }
                 $this->transaccionsScheduledForDeletion = null;
             }
         }
         if ($this->collTransaccions !== null) {
             foreach ($this->collTransaccions as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->facturasScheduledForDeletion !== null) {
             if (!$this->facturasScheduledForDeletion->isEmpty()) {
                 foreach ($this->facturasScheduledForDeletion as $factura) {
                     // need to save related object because we set the relation to null
                     $factura->save($con);
                 }
                 $this->facturasScheduledForDeletion = null;
             }
         }
         if ($this->collFacturas !== null) {
             foreach ($this->collFacturas as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
    /**
     *
     * Prérempli la notification avec des responsables (sans sauvegarder la notification).
     * Si plusieurs responsables sont disponibles, un responsable 1 est pris en priorité pour remplir la notification,
     * un responsable 2 est ajouté si l'adresse est la même que le premier
     * Si trop de responsables sont disponibles, aucun choix arbitraire n'est fait et alors rien n'est rempli sur la notification
     * Si aucun responsable n'est disponible, la notification n'est pas remplie
     *
     * @return     boolean true ou false suivant que le remplissage a pu être effectué ou pas.
     *
     */
    public function preremplirResponsables() {
            $traitement = $this->getAbsenceEleveTraitement();
            if ($traitement === NULL) return false;

            $responsable_1_coll = new PropelObjectCollection();
            $responsable_2_coll = new PropelObjectCollection();
            foreach ($traitement->getResponsablesInformationsSaisies() as $responsable_information) {
                    if ($responsable_information == null) continue;
                    if ($responsable_information->getNiveauResponsabilite() == '1') {
                        $responsable_1_coll->add($responsable_information->getResponsableEleve());
                    } else if ($responsable_information->getNiveauResponsabilite() == '2') {
                        $responsable_2_coll->add($responsable_information->getResponsableEleve());
                    }
                    //si on ne peut pas choisir les responsables, on retourne sans remplir
                    if ($responsable_1_coll->count() > 1) return false;
            }

            if ($responsable_1_coll->isEmpty() && $responsable_2_coll->count() != 1) {
                //on ne peut pas choisir
                return false;
            }

            $responsable_eleve1 = $responsable_1_coll->getFirst();
            $responsable_eleve2 = $responsable_2_coll->getFirst();
            if ($responsable_eleve1 != null) {
                    $this->setEmail($responsable_eleve1->getMel());
                    $this->setTelephone($responsable_eleve1->getTelPort());
                    $this->setAdresseId($responsable_eleve1->getAdresseId());
                    $this->addResponsableEleve($responsable_eleve1);
            } else {
                    $this->setEmail($responsable_eleve2->getMel());
                    $this->setTelephone($responsable_eleve2->getTelPort());
                    $this->setAdresseId($responsable_eleve2->getAdresseId());
                    $this->addResponsableEleve($responsable_eleve2);
            }

            //on ajoute dans la liste des destinataires le resp 2 si il a la même adresse que le resp 1
            if ($responsable_eleve2 != null && $responsable_eleve1 != null && $responsable_eleve2->getAdresseId() == $responsable_eleve1->getAdresseId()) {
                    $this->addResponsableEleve($responsable_eleve2);
            }

            return true;
    }
Example #7
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aPageRelatedByCanonicalId !== null) {
             if ($this->aPageRelatedByCanonicalId->isModified() || $this->aPageRelatedByCanonicalId->isNew()) {
                 $affectedRows += $this->aPageRelatedByCanonicalId->save($con);
             }
             $this->setPageRelatedByCanonicalId($this->aPageRelatedByCanonicalId);
         }
         if ($this->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->pagesRelatedByIdScheduledForDeletion !== null) {
             if (!$this->pagesRelatedByIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->pagesRelatedByIdScheduledForDeletion as $pageRelatedById) {
                     // need to save related object because we set the relation to null
                     $pageRelatedById->save($con);
                 }
                 $this->pagesRelatedByIdScheduledForDeletion = null;
             }
         }
         if ($this->collPagesRelatedById !== null) {
             foreach ($this->collPagesRelatedById as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pagePropertysScheduledForDeletion !== null) {
             if (!$this->pagePropertysScheduledForDeletion->isEmpty()) {
                 PagePropertyQuery::create()->filterByPrimaryKeys($this->pagePropertysScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pagePropertysScheduledForDeletion = null;
             }
         }
         if ($this->collPagePropertys !== null) {
             foreach ($this->collPagePropertys as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pageStringsScheduledForDeletion !== null) {
             if (!$this->pageStringsScheduledForDeletion->isEmpty()) {
                 PageStringQuery::create()->filterByPrimaryKeys($this->pageStringsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pageStringsScheduledForDeletion = null;
             }
         }
         if ($this->collPageStrings !== null) {
             foreach ($this->collPageStrings as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentObjectsScheduledForDeletion !== null) {
             if (!$this->contentObjectsScheduledForDeletion->isEmpty()) {
                 ContentObjectQuery::create()->filterByPrimaryKeys($this->contentObjectsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentObjectsScheduledForDeletion = null;
             }
         }
         if ($this->collContentObjects !== null) {
             foreach ($this->collContentObjects as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rightsScheduledForDeletion !== null) {
             if (!$this->rightsScheduledForDeletion->isEmpty()) {
                 RightQuery::create()->filterByPrimaryKeys($this->rightsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rightsScheduledForDeletion = null;
             }
         }
         if ($this->collRights !== null) {
             foreach ($this->collRights as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #8
0
    echo ("<select name=\"id_creneau\" class=\"small\">");


    echo "<option value='-1'>choisissez un créneau</option>\n";
    foreach ($edt_creneau_col as $edt_creneau) {
	//$edt_creneau = new EdtCreneau();
	    echo "<option value='".$edt_creneau->getIdDefiniePeriode()."'";
	    if ($id_creneau == $edt_creneau->getIdDefiniePeriode()) echo " selected='selected' ";
	    echo ">";
	    echo $edt_creneau->getDescription();
	    echo "</option>\n";
    }
    echo "</select></p></div>";
echo '</div>';
//on affiche une boite de selection avec les cours
if (!$cours_col->isEmpty()) {
	//echo '<br/>ou<br/><br/>';
    echo '<p>ou</p>';
	echo '<div style="border-width: 1px; border-style: solid; text-align: left; padding : 4px;">';
    echo '<p>';
	echo ("<select name=\"id_cours\" class=\"small\">");
	echo "<option value='-1'>choisissez un cours</option>\n";
	foreach ($cours_col as $edt_cours) {
	    //$edt_cours = new EdtEmplacementCours();
		if ($edt_cours->getEdtCreneau() == NULL) {
		    //on affiche pas le cours si il n'est associé avec aucun creneau
		    continue;
		}
		echo "<option value='".$edt_cours->getIdCours()."'";
		if ($id_cours == $edt_cours->getIdCours()) echo " selected='selected' ";
		echo ">";
Example #9
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aEmpleadoRelatedByIdempleadocomercial !== null) {
             if ($this->aEmpleadoRelatedByIdempleadocomercial->isModified() || $this->aEmpleadoRelatedByIdempleadocomercial->isNew()) {
                 $affectedRows += $this->aEmpleadoRelatedByIdempleadocomercial->save($con);
             }
             $this->setEmpleadoRelatedByIdempleadocomercial($this->aEmpleadoRelatedByIdempleadocomercial);
         }
         if ($this->aEmpleadoRelatedByIdempleadooperaciones !== null) {
             if ($this->aEmpleadoRelatedByIdempleadooperaciones->isModified() || $this->aEmpleadoRelatedByIdempleadooperaciones->isNew()) {
                 $affectedRows += $this->aEmpleadoRelatedByIdempleadooperaciones->save($con);
             }
             $this->setEmpleadoRelatedByIdempleadooperaciones($this->aEmpleadoRelatedByIdempleadooperaciones);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->clientearchivosScheduledForDeletion !== null) {
             if (!$this->clientearchivosScheduledForDeletion->isEmpty()) {
                 ClientearchivoQuery::create()->filterByPrimaryKeys($this->clientearchivosScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->clientearchivosScheduledForDeletion = null;
             }
         }
         if ($this->collClientearchivos !== null) {
             foreach ($this->collClientearchivos as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->expedientesScheduledForDeletion !== null) {
             if (!$this->expedientesScheduledForDeletion->isEmpty()) {
                 ExpedienteQuery::create()->filterByPrimaryKeys($this->expedientesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->expedientesScheduledForDeletion = null;
             }
         }
         if ($this->collExpedientes !== null) {
             foreach ($this->collExpedientes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->proveedorclientesScheduledForDeletion !== null) {
             if (!$this->proveedorclientesScheduledForDeletion->isEmpty()) {
                 ProveedorclienteQuery::create()->filterByPrimaryKeys($this->proveedorclientesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->proveedorclientesScheduledForDeletion = null;
             }
         }
         if ($this->collProveedorclientes !== null) {
             foreach ($this->collProveedorclientes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #10
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aSalaquirurgica !== null) {
             if ($this->aSalaquirurgica->isModified() || $this->aSalaquirurgica->isNew()) {
                 $affectedRows += $this->aSalaquirurgica->save($con);
             }
             $this->setSalaquirurgica($this->aSalaquirurgica);
         }
         if ($this->aQuirofano !== null) {
             if ($this->aQuirofano->isModified() || $this->aQuirofano->isNew()) {
                 $affectedRows += $this->aQuirofano->save($con);
             }
             $this->setQuirofano($this->aQuirofano);
         }
         if ($this->aRiesgoqx !== null) {
             if ($this->aRiesgoqx->isModified() || $this->aRiesgoqx->isNew()) {
                 $affectedRows += $this->aRiesgoqx->save($con);
             }
             $this->setRiesgoqx($this->aRiesgoqx);
         }
         if ($this->aContaminacionqx !== null) {
             if ($this->aContaminacionqx->isModified() || $this->aContaminacionqx->isNew()) {
                 $affectedRows += $this->aContaminacionqx->save($con);
             }
             $this->setContaminacionqx($this->aContaminacionqx);
         }
         if ($this->aEventoqx !== null) {
             if ($this->aEventoqx->isModified() || $this->aEventoqx->isNew()) {
                 $affectedRows += $this->aEventoqx->save($con);
             }
             $this->setEventoqx($this->aEventoqx);
         }
         if ($this->aProcedimiento !== null) {
             if ($this->aProcedimiento->isModified() || $this->aProcedimiento->isNew()) {
                 $affectedRows += $this->aProcedimiento->save($con);
             }
             $this->setProcedimiento($this->aProcedimiento);
         }
         if ($this->aCausadiferido !== null) {
             if ($this->aCausadiferido->isModified() || $this->aCausadiferido->isNew()) {
                 $affectedRows += $this->aCausadiferido->save($con);
             }
             $this->setCausadiferido($this->aCausadiferido);
         }
         if ($this->aAtencion !== null) {
             if ($this->aAtencion->isModified() || $this->aAtencion->isNew()) {
                 $affectedRows += $this->aAtencion->save($con);
             }
             $this->setAtencion($this->aAtencion);
         }
         if ($this->aEspecialidad !== null) {
             if ($this->aEspecialidad->isModified() || $this->aEspecialidad->isNew()) {
                 $affectedRows += $this->aEspecialidad->save($con);
             }
             $this->setEspecialidad($this->aEspecialidad);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->personalcirugiasScheduledForDeletion !== null) {
             if (!$this->personalcirugiasScheduledForDeletion->isEmpty()) {
                 foreach ($this->personalcirugiasScheduledForDeletion as $personalcirugia) {
                     // need to save related object because we set the relation to null
                     $personalcirugia->save($con);
                 }
                 $this->personalcirugiasScheduledForDeletion = null;
             }
         }
         if ($this->collPersonalcirugias !== null) {
             foreach ($this->collPersonalcirugias as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->diagnosticocirugiasScheduledForDeletion !== null) {
             if (!$this->diagnosticocirugiasScheduledForDeletion->isEmpty()) {
                 foreach ($this->diagnosticocirugiasScheduledForDeletion as $diagnosticocirugia) {
                     // need to save related object because we set the relation to null
                     $diagnosticocirugia->save($con);
                 }
                 $this->diagnosticocirugiasScheduledForDeletion = null;
             }
         }
         if ($this->collDiagnosticocirugias !== null) {
             foreach ($this->collDiagnosticocirugias as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->procedimientocirugiasScheduledForDeletion !== null) {
             if (!$this->procedimientocirugiasScheduledForDeletion->isEmpty()) {
                 foreach ($this->procedimientocirugiasScheduledForDeletion as $procedimientocirugia) {
                     // need to save related object because we set the relation to null
                     $procedimientocirugia->save($con);
                 }
                 $this->procedimientocirugiasScheduledForDeletion = null;
             }
         }
         if ($this->collProcedimientocirugias !== null) {
             foreach ($this->collProcedimientocirugias as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->procedimientregrogramadosScheduledForDeletion !== null) {
             if (!$this->procedimientregrogramadosScheduledForDeletion->isEmpty()) {
                 foreach ($this->procedimientregrogramadosScheduledForDeletion as $procedimientregrogramado) {
                     // need to save related object because we set the relation to null
                     $procedimientregrogramado->save($con);
                 }
                 $this->procedimientregrogramadosScheduledForDeletion = null;
             }
         }
         if ($this->collProcedimientregrogramados !== null) {
             foreach ($this->collProcedimientregrogramados as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #11
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aConsultorio !== null) {
             if ($this->aConsultorio->isModified() || $this->aConsultorio->isNew()) {
                 $affectedRows += $this->aConsultorio->save($con);
             }
             $this->setConsultorio($this->aConsultorio);
         }
         if ($this->aMedico !== null) {
             if ($this->aMedico->isModified() || $this->aMedico->isNew()) {
                 $affectedRows += $this->aMedico->save($con);
             }
             $this->setMedico($this->aMedico);
         }
         if ($this->aPaciente !== null) {
             if ($this->aPaciente->isModified() || $this->aPaciente->isNew()) {
                 $affectedRows += $this->aPaciente->save($con);
             }
             $this->setPaciente($this->aPaciente);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->cargoconsultasScheduledForDeletion !== null) {
             if (!$this->cargoconsultasScheduledForDeletion->isEmpty()) {
                 CargoconsultaQuery::create()->filterByPrimaryKeys($this->cargoconsultasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cargoconsultasScheduledForDeletion = null;
             }
         }
         if ($this->collCargoconsultas !== null) {
             foreach ($this->collCargoconsultas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->consultaanticiposScheduledForDeletion !== null) {
             if (!$this->consultaanticiposScheduledForDeletion->isEmpty()) {
                 ConsultaanticipoQuery::create()->filterByPrimaryKeys($this->consultaanticiposScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->consultaanticiposScheduledForDeletion = null;
             }
         }
         if ($this->collConsultaanticipos !== null) {
             foreach ($this->collConsultaanticipos as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->facturasScheduledForDeletion !== null) {
             if (!$this->facturasScheduledForDeletion->isEmpty()) {
                 FacturaQuery::create()->filterByPrimaryKeys($this->facturasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->facturasScheduledForDeletion = null;
             }
         }
         if ($this->collFacturas !== null) {
             foreach ($this->collFacturas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #12
0
			</p>
		</form>
<?php }
?>
		</div>
<?php if (isset($message_enregistrement)) { ?>
	<p><?php echo($message_enregistrement); ?></p>
<?php
}

//**************** ELEVES *****************

if (TRUE == $_SESSION['showJournee']) {
	include 'lib/saisir_groupe_journee.php';
} else {
if ($eleve_col->isEmpty()) {
?>
    <p>Aucun créneau selectionné</p>
<?php
} else {
?>
    <div>
		<form method="post" action="enregistrement_saisie_groupe.php" id="liste_absence_eleve">
			<p>
				<input type="hidden" name="total_eleves" value="<?php echo($eleve_col->count()); ?>"/>
				<input type="hidden" name="id_aid" value="<?php echo($id_aid); ?>"/>
				<input type="hidden" name="id_groupe" value="<?php echo($id_groupe); ?>"/>
				<input type="hidden" name="id_classe" value="<?php echo($id_classe); ?>"/>
				<input type="hidden" name="id_creneau" value="<?php echo($id_creneau); ?>"/>
				<input type="hidden" name="id_cours" value="<?php echo($id_cours); ?>"/>
				<input type="hidden" name="type_selection" value="<?php echo($type_selection); ?>"/>
Example #13
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->organizationsScheduledForDeletion !== null) {
             if (!$this->organizationsScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->organizationsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 UserOrganizationQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->organizationsScheduledForDeletion = null;
             }
             foreach ($this->getOrganizations() as $organization) {
                 if ($organization->isModified()) {
                     $organization->save($con);
                 }
             }
         } elseif ($this->collOrganizations) {
             foreach ($this->collOrganizations as $organization) {
                 if ($organization->isModified()) {
                     $organization->save($con);
                 }
             }
         }
         if ($this->productsScheduledForDeletion !== null) {
             if (!$this->productsScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->productsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 UserProductQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->productsScheduledForDeletion = null;
             }
             foreach ($this->getProducts() as $product) {
                 if ($product->isModified()) {
                     $product->save($con);
                 }
             }
         } elseif ($this->collProducts) {
             foreach ($this->collProducts as $product) {
                 if ($product->isModified()) {
                     $product->save($con);
                 }
             }
         }
         if ($this->chartsScheduledForDeletion !== null) {
             if (!$this->chartsScheduledForDeletion->isEmpty()) {
                 foreach ($this->chartsScheduledForDeletion as $chart) {
                     // need to save related object because we set the relation to null
                     $chart->save($con);
                 }
                 $this->chartsScheduledForDeletion = null;
             }
         }
         if ($this->collCharts !== null) {
             foreach ($this->collCharts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userOrganizationsScheduledForDeletion !== null) {
             if (!$this->userOrganizationsScheduledForDeletion->isEmpty()) {
                 UserOrganizationQuery::create()->filterByPrimaryKeys($this->userOrganizationsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userOrganizationsScheduledForDeletion = null;
             }
         }
         if ($this->collUserOrganizations !== null) {
             foreach ($this->collUserOrganizations as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->actionsScheduledForDeletion !== null) {
             if (!$this->actionsScheduledForDeletion->isEmpty()) {
                 ActionQuery::create()->filterByPrimaryKeys($this->actionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->actionsScheduledForDeletion = null;
             }
         }
         if ($this->collActions !== null) {
             foreach ($this->collActions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->jobsScheduledForDeletion !== null) {
             if (!$this->jobsScheduledForDeletion->isEmpty()) {
                 JobQuery::create()->filterByPrimaryKeys($this->jobsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->jobsScheduledForDeletion = null;
             }
         }
         if ($this->collJobs !== null) {
             foreach ($this->collJobs as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userProductsScheduledForDeletion !== null) {
             if (!$this->userProductsScheduledForDeletion->isEmpty()) {
                 UserProductQuery::create()->filterByPrimaryKeys($this->userProductsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userProductsScheduledForDeletion = null;
             }
         }
         if ($this->collUserProducts !== null) {
             foreach ($this->collUserProducts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #14
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aLanguageRelatedByLanguageId !== null) {
             if ($this->aLanguageRelatedByLanguageId->isModified() || $this->aLanguageRelatedByLanguageId->isNew()) {
                 $affectedRows += $this->aLanguageRelatedByLanguageId->save($con);
             }
             $this->setLanguageRelatedByLanguageId($this->aLanguageRelatedByLanguageId);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             // Rewind the backend_settings LOB column, since PDO does not rewind after inserting value.
             if ($this->backend_settings !== null && is_resource($this->backend_settings)) {
                 rewind($this->backend_settings);
             }
             $this->resetModified();
         }
         if ($this->userGroupsRelatedByUserIdScheduledForDeletion !== null) {
             if (!$this->userGroupsRelatedByUserIdScheduledForDeletion->isEmpty()) {
                 UserGroupQuery::create()->filterByPrimaryKeys($this->userGroupsRelatedByUserIdScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userGroupsRelatedByUserIdScheduledForDeletion = null;
             }
         }
         if ($this->collUserGroupsRelatedByUserId !== null) {
             foreach ($this->collUserGroupsRelatedByUserId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userRolesRelatedByUserIdScheduledForDeletion !== null) {
             if (!$this->userRolesRelatedByUserIdScheduledForDeletion->isEmpty()) {
                 UserRoleQuery::create()->filterByPrimaryKeys($this->userRolesRelatedByUserIdScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userRolesRelatedByUserIdScheduledForDeletion = null;
             }
         }
         if ($this->collUserRolesRelatedByUserId !== null) {
             foreach ($this->collUserRolesRelatedByUserId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentsRelatedByOwnerIdScheduledForDeletion !== null) {
             if (!$this->documentsRelatedByOwnerIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentsRelatedByOwnerIdScheduledForDeletion as $documentRelatedByOwnerId) {
                     // need to save related object because we set the relation to null
                     $documentRelatedByOwnerId->save($con);
                 }
                 $this->documentsRelatedByOwnerIdScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentsRelatedByOwnerId !== null) {
             foreach ($this->collDocumentsRelatedByOwnerId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->linksRelatedByOwnerIdScheduledForDeletion !== null) {
             if (!$this->linksRelatedByOwnerIdScheduledForDeletion->isEmpty()) {
                 LinkQuery::create()->filterByPrimaryKeys($this->linksRelatedByOwnerIdScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->linksRelatedByOwnerIdScheduledForDeletion = null;
             }
         }
         if ($this->collLinksRelatedByOwnerId !== null) {
             foreach ($this->collLinksRelatedByOwnerId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pagesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->pagesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->pagesRelatedByCreatedByScheduledForDeletion as $pageRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $pageRelatedByCreatedBy->save($con);
                 }
                 $this->pagesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collPagesRelatedByCreatedBy !== null) {
             foreach ($this->collPagesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pagesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->pagesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->pagesRelatedByUpdatedByScheduledForDeletion as $pageRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $pageRelatedByUpdatedBy->save($con);
                 }
                 $this->pagesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collPagesRelatedByUpdatedBy !== null) {
             foreach ($this->collPagesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pagePropertysRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->pagePropertysRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->pagePropertysRelatedByCreatedByScheduledForDeletion as $pagePropertyRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $pagePropertyRelatedByCreatedBy->save($con);
                 }
                 $this->pagePropertysRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collPagePropertysRelatedByCreatedBy !== null) {
             foreach ($this->collPagePropertysRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pagePropertysRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->pagePropertysRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->pagePropertysRelatedByUpdatedByScheduledForDeletion as $pagePropertyRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $pagePropertyRelatedByUpdatedBy->save($con);
                 }
                 $this->pagePropertysRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collPagePropertysRelatedByUpdatedBy !== null) {
             foreach ($this->collPagePropertysRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pageStringsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->pageStringsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->pageStringsRelatedByCreatedByScheduledForDeletion as $pageStringRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $pageStringRelatedByCreatedBy->save($con);
                 }
                 $this->pageStringsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collPageStringsRelatedByCreatedBy !== null) {
             foreach ($this->collPageStringsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pageStringsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->pageStringsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->pageStringsRelatedByUpdatedByScheduledForDeletion as $pageStringRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $pageStringRelatedByUpdatedBy->save($con);
                 }
                 $this->pageStringsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collPageStringsRelatedByUpdatedBy !== null) {
             foreach ($this->collPageStringsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentObjectsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->contentObjectsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->contentObjectsRelatedByCreatedByScheduledForDeletion as $contentObjectRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $contentObjectRelatedByCreatedBy->save($con);
                 }
                 $this->contentObjectsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collContentObjectsRelatedByCreatedBy !== null) {
             foreach ($this->collContentObjectsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentObjectsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->contentObjectsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->contentObjectsRelatedByUpdatedByScheduledForDeletion as $contentObjectRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $contentObjectRelatedByUpdatedBy->save($con);
                 }
                 $this->contentObjectsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collContentObjectsRelatedByUpdatedBy !== null) {
             foreach ($this->collContentObjectsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->languageObjectsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->languageObjectsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->languageObjectsRelatedByCreatedByScheduledForDeletion as $languageObjectRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $languageObjectRelatedByCreatedBy->save($con);
                 }
                 $this->languageObjectsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLanguageObjectsRelatedByCreatedBy !== null) {
             foreach ($this->collLanguageObjectsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->languageObjectsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->languageObjectsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->languageObjectsRelatedByUpdatedByScheduledForDeletion as $languageObjectRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $languageObjectRelatedByUpdatedBy->save($con);
                 }
                 $this->languageObjectsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLanguageObjectsRelatedByUpdatedBy !== null) {
             foreach ($this->collLanguageObjectsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->languageObjectHistorysRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->languageObjectHistorysRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->languageObjectHistorysRelatedByCreatedByScheduledForDeletion as $languageObjectHistoryRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $languageObjectHistoryRelatedByCreatedBy->save($con);
                 }
                 $this->languageObjectHistorysRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLanguageObjectHistorysRelatedByCreatedBy !== null) {
             foreach ($this->collLanguageObjectHistorysRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->languageObjectHistorysRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->languageObjectHistorysRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->languageObjectHistorysRelatedByUpdatedByScheduledForDeletion as $languageObjectHistoryRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $languageObjectHistoryRelatedByUpdatedBy->save($con);
                 }
                 $this->languageObjectHistorysRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLanguageObjectHistorysRelatedByUpdatedBy !== null) {
             foreach ($this->collLanguageObjectHistorysRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->languagesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->languagesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->languagesRelatedByCreatedByScheduledForDeletion as $languageRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $languageRelatedByCreatedBy->save($con);
                 }
                 $this->languagesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLanguagesRelatedByCreatedBy !== null) {
             foreach ($this->collLanguagesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->languagesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->languagesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->languagesRelatedByUpdatedByScheduledForDeletion as $languageRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $languageRelatedByUpdatedBy->save($con);
                 }
                 $this->languagesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLanguagesRelatedByUpdatedBy !== null) {
             foreach ($this->collLanguagesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->translationsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->translationsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->translationsRelatedByCreatedByScheduledForDeletion as $translationRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $translationRelatedByCreatedBy->save($con);
                 }
                 $this->translationsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collTranslationsRelatedByCreatedBy !== null) {
             foreach ($this->collTranslationsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->translationsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->translationsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->translationsRelatedByUpdatedByScheduledForDeletion as $translationRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $translationRelatedByUpdatedBy->save($con);
                 }
                 $this->translationsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collTranslationsRelatedByUpdatedBy !== null) {
             foreach ($this->collTranslationsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userGroupsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->userGroupsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->userGroupsRelatedByCreatedByScheduledForDeletion as $userGroupRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $userGroupRelatedByCreatedBy->save($con);
                 }
                 $this->userGroupsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collUserGroupsRelatedByCreatedBy !== null) {
             foreach ($this->collUserGroupsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userGroupsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->userGroupsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->userGroupsRelatedByUpdatedByScheduledForDeletion as $userGroupRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $userGroupRelatedByUpdatedBy->save($con);
                 }
                 $this->userGroupsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collUserGroupsRelatedByUpdatedBy !== null) {
             foreach ($this->collUserGroupsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->groupsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->groupsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->groupsRelatedByCreatedByScheduledForDeletion as $groupRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $groupRelatedByCreatedBy->save($con);
                 }
                 $this->groupsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collGroupsRelatedByCreatedBy !== null) {
             foreach ($this->collGroupsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->groupsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->groupsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->groupsRelatedByUpdatedByScheduledForDeletion as $groupRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $groupRelatedByUpdatedBy->save($con);
                 }
                 $this->groupsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collGroupsRelatedByUpdatedBy !== null) {
             foreach ($this->collGroupsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->groupRolesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->groupRolesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->groupRolesRelatedByCreatedByScheduledForDeletion as $groupRoleRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $groupRoleRelatedByCreatedBy->save($con);
                 }
                 $this->groupRolesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collGroupRolesRelatedByCreatedBy !== null) {
             foreach ($this->collGroupRolesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->groupRolesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->groupRolesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->groupRolesRelatedByUpdatedByScheduledForDeletion as $groupRoleRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $groupRoleRelatedByUpdatedBy->save($con);
                 }
                 $this->groupRolesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collGroupRolesRelatedByUpdatedBy !== null) {
             foreach ($this->collGroupRolesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rolesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->rolesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->rolesRelatedByCreatedByScheduledForDeletion as $roleRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $roleRelatedByCreatedBy->save($con);
                 }
                 $this->rolesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collRolesRelatedByCreatedBy !== null) {
             foreach ($this->collRolesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rolesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->rolesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->rolesRelatedByUpdatedByScheduledForDeletion as $roleRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $roleRelatedByUpdatedBy->save($con);
                 }
                 $this->rolesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collRolesRelatedByUpdatedBy !== null) {
             foreach ($this->collRolesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userRolesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->userRolesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->userRolesRelatedByCreatedByScheduledForDeletion as $userRoleRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $userRoleRelatedByCreatedBy->save($con);
                 }
                 $this->userRolesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collUserRolesRelatedByCreatedBy !== null) {
             foreach ($this->collUserRolesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userRolesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->userRolesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->userRolesRelatedByUpdatedByScheduledForDeletion as $userRoleRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $userRoleRelatedByUpdatedBy->save($con);
                 }
                 $this->userRolesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collUserRolesRelatedByUpdatedBy !== null) {
             foreach ($this->collUserRolesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rightsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->rightsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->rightsRelatedByCreatedByScheduledForDeletion as $rightRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $rightRelatedByCreatedBy->save($con);
                 }
                 $this->rightsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collRightsRelatedByCreatedBy !== null) {
             foreach ($this->collRightsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rightsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->rightsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->rightsRelatedByUpdatedByScheduledForDeletion as $rightRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $rightRelatedByUpdatedBy->save($con);
                 }
                 $this->rightsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collRightsRelatedByUpdatedBy !== null) {
             foreach ($this->collRightsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->documentsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentsRelatedByCreatedByScheduledForDeletion as $documentRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $documentRelatedByCreatedBy->save($con);
                 }
                 $this->documentsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentsRelatedByCreatedBy !== null) {
             foreach ($this->collDocumentsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->documentsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentsRelatedByUpdatedByScheduledForDeletion as $documentRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $documentRelatedByUpdatedBy->save($con);
                 }
                 $this->documentsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentsRelatedByUpdatedBy !== null) {
             foreach ($this->collDocumentsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentDatasRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->documentDatasRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentDatasRelatedByCreatedByScheduledForDeletion as $documentDataRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $documentDataRelatedByCreatedBy->save($con);
                 }
                 $this->documentDatasRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentDatasRelatedByCreatedBy !== null) {
             foreach ($this->collDocumentDatasRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentDatasRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->documentDatasRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentDatasRelatedByUpdatedByScheduledForDeletion as $documentDataRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $documentDataRelatedByUpdatedBy->save($con);
                 }
                 $this->documentDatasRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentDatasRelatedByUpdatedBy !== null) {
             foreach ($this->collDocumentDatasRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentTypesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->documentTypesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentTypesRelatedByCreatedByScheduledForDeletion as $documentTypeRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $documentTypeRelatedByCreatedBy->save($con);
                 }
                 $this->documentTypesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentTypesRelatedByCreatedBy !== null) {
             foreach ($this->collDocumentTypesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentTypesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->documentTypesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentTypesRelatedByUpdatedByScheduledForDeletion as $documentTypeRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $documentTypeRelatedByUpdatedBy->save($con);
                 }
                 $this->documentTypesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentTypesRelatedByUpdatedBy !== null) {
             foreach ($this->collDocumentTypesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentCategorysRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->documentCategorysRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentCategorysRelatedByCreatedByScheduledForDeletion as $documentCategoryRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $documentCategoryRelatedByCreatedBy->save($con);
                 }
                 $this->documentCategorysRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentCategorysRelatedByCreatedBy !== null) {
             foreach ($this->collDocumentCategorysRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->documentCategorysRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->documentCategorysRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentCategorysRelatedByUpdatedByScheduledForDeletion as $documentCategoryRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $documentCategoryRelatedByUpdatedBy->save($con);
                 }
                 $this->documentCategorysRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collDocumentCategorysRelatedByUpdatedBy !== null) {
             foreach ($this->collDocumentCategorysRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->tagsRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->tagsRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->tagsRelatedByCreatedByScheduledForDeletion as $tagRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $tagRelatedByCreatedBy->save($con);
                 }
                 $this->tagsRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collTagsRelatedByCreatedBy !== null) {
             foreach ($this->collTagsRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->tagsRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->tagsRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->tagsRelatedByUpdatedByScheduledForDeletion as $tagRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $tagRelatedByUpdatedBy->save($con);
                 }
                 $this->tagsRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collTagsRelatedByUpdatedBy !== null) {
             foreach ($this->collTagsRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->tagInstancesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->tagInstancesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->tagInstancesRelatedByCreatedByScheduledForDeletion as $tagInstanceRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $tagInstanceRelatedByCreatedBy->save($con);
                 }
                 $this->tagInstancesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collTagInstancesRelatedByCreatedBy !== null) {
             foreach ($this->collTagInstancesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->tagInstancesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->tagInstancesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->tagInstancesRelatedByUpdatedByScheduledForDeletion as $tagInstanceRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $tagInstanceRelatedByUpdatedBy->save($con);
                 }
                 $this->tagInstancesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collTagInstancesRelatedByUpdatedBy !== null) {
             foreach ($this->collTagInstancesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->linksRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->linksRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->linksRelatedByCreatedByScheduledForDeletion as $linkRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $linkRelatedByCreatedBy->save($con);
                 }
                 $this->linksRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLinksRelatedByCreatedBy !== null) {
             foreach ($this->collLinksRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->linksRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->linksRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->linksRelatedByUpdatedByScheduledForDeletion as $linkRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $linkRelatedByUpdatedBy->save($con);
                 }
                 $this->linksRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLinksRelatedByUpdatedBy !== null) {
             foreach ($this->collLinksRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->linkCategorysRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->linkCategorysRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->linkCategorysRelatedByCreatedByScheduledForDeletion as $linkCategoryRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $linkCategoryRelatedByCreatedBy->save($con);
                 }
                 $this->linkCategorysRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLinkCategorysRelatedByCreatedBy !== null) {
             foreach ($this->collLinkCategorysRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->linkCategorysRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->linkCategorysRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->linkCategorysRelatedByUpdatedByScheduledForDeletion as $linkCategoryRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $linkCategoryRelatedByUpdatedBy->save($con);
                 }
                 $this->linkCategorysRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collLinkCategorysRelatedByUpdatedBy !== null) {
             foreach ($this->collLinkCategorysRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->referencesRelatedByCreatedByScheduledForDeletion !== null) {
             if (!$this->referencesRelatedByCreatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->referencesRelatedByCreatedByScheduledForDeletion as $referenceRelatedByCreatedBy) {
                     // need to save related object because we set the relation to null
                     $referenceRelatedByCreatedBy->save($con);
                 }
                 $this->referencesRelatedByCreatedByScheduledForDeletion = null;
             }
         }
         if ($this->collReferencesRelatedByCreatedBy !== null) {
             foreach ($this->collReferencesRelatedByCreatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->referencesRelatedByUpdatedByScheduledForDeletion !== null) {
             if (!$this->referencesRelatedByUpdatedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->referencesRelatedByUpdatedByScheduledForDeletion as $referenceRelatedByUpdatedBy) {
                     // need to save related object because we set the relation to null
                     $referenceRelatedByUpdatedBy->save($con);
                 }
                 $this->referencesRelatedByUpdatedByScheduledForDeletion = null;
             }
         }
         if ($this->collReferencesRelatedByUpdatedBy !== null) {
             foreach ($this->collReferencesRelatedByUpdatedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #15
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aKategori !== null) {
             if ($this->aKategori->isModified() || $this->aKategori->isNew()) {
                 $affectedRows += $this->aKategori->save($con);
             }
             $this->setKategori($this->aKategori);
         }
         if ($this->aKemasan !== null) {
             if ($this->aKemasan->isModified() || $this->aKemasan->isNew()) {
                 $affectedRows += $this->aKemasan->save($con);
             }
             $this->setKemasan($this->aKemasan);
         }
         if ($this->aProdusen !== null) {
             if ($this->aProdusen->isModified() || $this->aProdusen->isNew()) {
                 $affectedRows += $this->aProdusen->save($con);
             }
             $this->setProdusen($this->aProdusen);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->detailBarangMasuksScheduledForDeletion !== null) {
             if (!$this->detailBarangMasuksScheduledForDeletion->isEmpty()) {
                 DetailBarangMasukQuery::create()->filterByPrimaryKeys($this->detailBarangMasuksScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->detailBarangMasuksScheduledForDeletion = null;
             }
         }
         if ($this->collDetailBarangMasuks !== null) {
             foreach ($this->collDetailBarangMasuks as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->detailTransaksisScheduledForDeletion !== null) {
             if (!$this->detailTransaksisScheduledForDeletion->isEmpty()) {
                 DetailTransaksiQuery::create()->filterByPrimaryKeys($this->detailTransaksisScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->detailTransaksisScheduledForDeletion = null;
             }
         }
         if ($this->collDetailTransaksis !== null) {
             foreach ($this->collDetailTransaksis as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->hargasScheduledForDeletion !== null) {
             if (!$this->hargasScheduledForDeletion->isEmpty()) {
                 HargaQuery::create()->filterByPrimaryKeys($this->hargasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->hargasScheduledForDeletion = null;
             }
         }
         if ($this->collHargas !== null) {
             foreach ($this->collHargas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->linkBarangRaksScheduledForDeletion !== null) {
             if (!$this->linkBarangRaksScheduledForDeletion->isEmpty()) {
                 LinkBarangRakQuery::create()->filterByPrimaryKeys($this->linkBarangRaksScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->linkBarangRaksScheduledForDeletion = null;
             }
         }
         if ($this->collLinkBarangRaks !== null) {
             foreach ($this->collLinkBarangRaks as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->logBarangsScheduledForDeletion !== null) {
             if (!$this->logBarangsScheduledForDeletion->isEmpty()) {
                 LogBarangQuery::create()->filterByPrimaryKeys($this->logBarangsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->logBarangsScheduledForDeletion = null;
             }
         }
         if ($this->collLogBarangs !== null) {
             foreach ($this->collLogBarangs as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #16
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aCorporation !== null) {
             if ($this->aCorporation->isModified() || $this->aCorporation->isNew()) {
                 $affectedRows += $this->aCorporation->save($con);
             }
             $this->setCorporation($this->aCorporation);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->playersScheduledForDeletion !== null) {
             if (!$this->playersScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->playersScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($remotePk, $pk);
                 }
                 PlayerCourtQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->playersScheduledForDeletion = null;
             }
             foreach ($this->getPlayers() as $player) {
                 if ($player->isModified()) {
                     $player->save($con);
                 }
             }
         } elseif ($this->collPlayers) {
             foreach ($this->collPlayers as $player) {
                 if ($player->isModified()) {
                     $player->save($con);
                 }
             }
         }
         if ($this->playerCourtsScheduledForDeletion !== null) {
             if (!$this->playerCourtsScheduledForDeletion->isEmpty()) {
                 PlayerCourtQuery::create()->filterByPrimaryKeys($this->playerCourtsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->playerCourtsScheduledForDeletion = null;
             }
         }
         if ($this->collPlayerCourts !== null) {
             foreach ($this->collPlayerCourts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #17
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param      PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->sfGuardUserPermissionsScheduledForDeletion !== null) {
             if (!$this->sfGuardUserPermissionsScheduledForDeletion->isEmpty()) {
                 sfGuardUserPermissionQuery::create()->filterByPrimaryKeys($this->sfGuardUserPermissionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->sfGuardUserPermissionsScheduledForDeletion = null;
             }
         }
         if ($this->collsfGuardUserPermissions !== null) {
             foreach ($this->collsfGuardUserPermissions as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->sfGuardUserGroupsScheduledForDeletion !== null) {
             if (!$this->sfGuardUserGroupsScheduledForDeletion->isEmpty()) {
                 sfGuardUserGroupQuery::create()->filterByPrimaryKeys($this->sfGuardUserGroupsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->sfGuardUserGroupsScheduledForDeletion = null;
             }
         }
         if ($this->collsfGuardUserGroups !== null) {
             foreach ($this->collsfGuardUserGroups as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->sfGuardRememberKeysScheduledForDeletion !== null) {
             if (!$this->sfGuardRememberKeysScheduledForDeletion->isEmpty()) {
                 sfGuardRememberKeyQuery::create()->filterByPrimaryKeys($this->sfGuardRememberKeysScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->sfGuardRememberKeysScheduledForDeletion = null;
             }
         }
         if ($this->collsfGuardRememberKeys !== null) {
             foreach ($this->collsfGuardRememberKeys as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->usersScheduledForDeletion !== null) {
             if (!$this->usersScheduledForDeletion->isEmpty()) {
                 UserQuery::create()->filterByPrimaryKeys($this->usersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->usersScheduledForDeletion = null;
             }
         }
         if ($this->collUsers !== null) {
             foreach ($this->collUsers as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #18
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aAccount !== null) {
             if ($this->aAccount->isModified() || $this->aAccount->isNew()) {
                 $affectedRows += $this->aAccount->save($con);
             }
             $this->setAccount($this->aAccount);
         }
         if ($this->aDomain !== null) {
             if ($this->aDomain->isModified() || $this->aDomain->isNew()) {
                 $affectedRows += $this->aDomain->save($con);
             }
             $this->setDomain($this->aDomain);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->clockingsRelatedByCreatorIdScheduledForDeletion !== null) {
             if (!$this->clockingsRelatedByCreatorIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->clockingsRelatedByCreatorIdScheduledForDeletion as $clockingRelatedByCreatorId) {
                     // need to save related object because we set the relation to null
                     $clockingRelatedByCreatorId->save($con);
                 }
                 $this->clockingsRelatedByCreatorIdScheduledForDeletion = null;
             }
         }
         if ($this->collClockingsRelatedByCreatorId !== null) {
             foreach ($this->collClockingsRelatedByCreatorId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->clockingsRelatedByUserIdScheduledForDeletion !== null) {
             if (!$this->clockingsRelatedByUserIdScheduledForDeletion->isEmpty()) {
                 ClockingQuery::create()->filterByPrimaryKeys($this->clockingsRelatedByUserIdScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->clockingsRelatedByUserIdScheduledForDeletion = null;
             }
         }
         if ($this->collClockingsRelatedByUserId !== null) {
             foreach ($this->collClockingsRelatedByUserId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->propertyValuesScheduledForDeletion !== null) {
             if (!$this->propertyValuesScheduledForDeletion->isEmpty()) {
                 foreach ($this->propertyValuesScheduledForDeletion as $propertyValue) {
                     // need to save related object because we set the relation to null
                     $propertyValue->save($con);
                 }
                 $this->propertyValuesScheduledForDeletion = null;
             }
         }
         if ($this->collPropertyValues !== null) {
             foreach ($this->collPropertyValues as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->systemLogsScheduledForDeletion !== null) {
             if (!$this->systemLogsScheduledForDeletion->isEmpty()) {
                 foreach ($this->systemLogsScheduledForDeletion as $systemLog) {
                     // need to save related object because we set the relation to null
                     $systemLog->save($con);
                 }
                 $this->systemLogsScheduledForDeletion = null;
             }
         }
         if ($this->collSystemLogs !== null) {
             foreach ($this->collSystemLogs as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->transactionsRelatedByCreatorIdScheduledForDeletion !== null) {
             if (!$this->transactionsRelatedByCreatorIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->transactionsRelatedByCreatorIdScheduledForDeletion as $transactionRelatedByCreatorId) {
                     // need to save related object because we set the relation to null
                     $transactionRelatedByCreatorId->save($con);
                 }
                 $this->transactionsRelatedByCreatorIdScheduledForDeletion = null;
             }
         }
         if ($this->collTransactionsRelatedByCreatorId !== null) {
             foreach ($this->collTransactionsRelatedByCreatorId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->transactionsRelatedByUserIdScheduledForDeletion !== null) {
             if (!$this->transactionsRelatedByUserIdScheduledForDeletion->isEmpty()) {
                 TransactionQuery::create()->filterByPrimaryKeys($this->transactionsRelatedByUserIdScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->transactionsRelatedByUserIdScheduledForDeletion = null;
             }
         }
         if ($this->collTransactionsRelatedByUserId !== null) {
             foreach ($this->collTransactionsRelatedByUserId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #19
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param      PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             // Rewind the data LOB column, since PDO does not rewind after inserting value.
             if ($this->data !== null && is_resource($this->data)) {
                 rewind($this->data);
             }
             $this->resetModified();
         }
         if ($this->singleSignOnKeysScheduledForDeletion !== null) {
             if (!$this->singleSignOnKeysScheduledForDeletion->isEmpty()) {
                 foreach ($this->singleSignOnKeysScheduledForDeletion as $singleSignOnKey) {
                     // need to save related object because we set the relation to null
                     $singleSignOnKey->save($con);
                 }
                 $this->singleSignOnKeysScheduledForDeletion = null;
             }
         }
         if ($this->collSingleSignOnKeys !== null) {
             foreach ($this->collSingleSignOnKeys as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #20
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aAddress !== null) {
             if ($this->aAddress->isModified() || $this->aAddress->isNew()) {
                 $affectedRows += $this->aAddress->save($con);
             }
             $this->setAddress($this->aAddress);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->bookingTypesScheduledForDeletion !== null) {
             if (!$this->bookingTypesScheduledForDeletion->isEmpty()) {
                 BookingTypeQuery::create()->filterByPrimaryKeys($this->bookingTypesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->bookingTypesScheduledForDeletion = null;
             }
         }
         if ($this->collBookingTypes !== null) {
             foreach ($this->collBookingTypes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->clockingTypesScheduledForDeletion !== null) {
             if (!$this->clockingTypesScheduledForDeletion->isEmpty()) {
                 ClockingTypeQuery::create()->filterByPrimaryKeys($this->clockingTypesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->clockingTypesScheduledForDeletion = null;
             }
         }
         if ($this->collClockingTypes !== null) {
             foreach ($this->collClockingTypes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->domainsScheduledForDeletion !== null) {
             if (!$this->domainsScheduledForDeletion->isEmpty()) {
                 DomainQuery::create()->filterByPrimaryKeys($this->domainsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->domainsScheduledForDeletion = null;
             }
         }
         if ($this->collDomains !== null) {
             foreach ($this->collDomains as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->holidaysScheduledForDeletion !== null) {
             if (!$this->holidaysScheduledForDeletion->isEmpty()) {
                 HolidayQuery::create()->filterByPrimaryKeys($this->holidaysScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->holidaysScheduledForDeletion = null;
             }
         }
         if ($this->collHolidays !== null) {
             foreach ($this->collHolidays as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pluginsScheduledForDeletion !== null) {
             if (!$this->pluginsScheduledForDeletion->isEmpty()) {
                 PluginQuery::create()->filterByPrimaryKeys($this->pluginsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pluginsScheduledForDeletion = null;
             }
         }
         if ($this->collPlugins !== null) {
             foreach ($this->collPlugins as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->propertysScheduledForDeletion !== null) {
             if (!$this->propertysScheduledForDeletion->isEmpty()) {
                 PropertyQuery::create()->filterByPrimaryKeys($this->propertysScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->propertysScheduledForDeletion = null;
             }
         }
         if ($this->collPropertys !== null) {
             foreach ($this->collPropertys as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->usersScheduledForDeletion !== null) {
             if (!$this->usersScheduledForDeletion->isEmpty()) {
                 UserQuery::create()->filterByPrimaryKeys($this->usersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->usersScheduledForDeletion = null;
             }
         }
         if ($this->collUsers !== null) {
             foreach ($this->collUsers as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #21
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->organizationsScheduledForDeletion !== null) {
             if (!$this->organizationsScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->organizationsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 PluginOrganizationQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->organizationsScheduledForDeletion = null;
             }
             foreach ($this->getOrganizations() as $organization) {
                 if ($organization->isModified()) {
                     $organization->save($con);
                 }
             }
         } elseif ($this->collOrganizations) {
             foreach ($this->collOrganizations as $organization) {
                 if ($organization->isModified()) {
                     $organization->save($con);
                 }
             }
         }
         if ($this->productsScheduledForDeletion !== null) {
             if (!$this->productsScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->productsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($remotePk, $pk);
                 }
                 ProductPluginQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->productsScheduledForDeletion = null;
             }
             foreach ($this->getProducts() as $product) {
                 if ($product->isModified()) {
                     $product->save($con);
                 }
             }
         } elseif ($this->collProducts) {
             foreach ($this->collProducts as $product) {
                 if ($product->isModified()) {
                     $product->save($con);
                 }
             }
         }
         if ($this->pluginOrganizationsScheduledForDeletion !== null) {
             if (!$this->pluginOrganizationsScheduledForDeletion->isEmpty()) {
                 PluginOrganizationQuery::create()->filterByPrimaryKeys($this->pluginOrganizationsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pluginOrganizationsScheduledForDeletion = null;
             }
         }
         if ($this->collPluginOrganizations !== null) {
             foreach ($this->collPluginOrganizations as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pluginDatasScheduledForDeletion !== null) {
             if (!$this->pluginDatasScheduledForDeletion->isEmpty()) {
                 PluginDataQuery::create()->filterByPrimaryKeys($this->pluginDatasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pluginDatasScheduledForDeletion = null;
             }
         }
         if ($this->collPluginDatas !== null) {
             foreach ($this->collPluginDatas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productPluginsScheduledForDeletion !== null) {
             if (!$this->productPluginsScheduledForDeletion->isEmpty()) {
                 ProductPluginQuery::create()->filterByPrimaryKeys($this->productPluginsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productPluginsScheduledForDeletion = null;
             }
         }
         if ($this->collProductPlugins !== null) {
             foreach ($this->collProductPlugins as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #22
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->clientesRelatedByIdempleadocomercialScheduledForDeletion !== null) {
             if (!$this->clientesRelatedByIdempleadocomercialScheduledForDeletion->isEmpty()) {
                 ClienteQuery::create()->filterByPrimaryKeys($this->clientesRelatedByIdempleadocomercialScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->clientesRelatedByIdempleadocomercialScheduledForDeletion = null;
             }
         }
         if ($this->collClientesRelatedByIdempleadocomercial !== null) {
             foreach ($this->collClientesRelatedByIdempleadocomercial as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->clientesRelatedByIdempleadooperacionesScheduledForDeletion !== null) {
             if (!$this->clientesRelatedByIdempleadooperacionesScheduledForDeletion->isEmpty()) {
                 ClienteQuery::create()->filterByPrimaryKeys($this->clientesRelatedByIdempleadooperacionesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->clientesRelatedByIdempleadooperacionesScheduledForDeletion = null;
             }
         }
         if ($this->collClientesRelatedByIdempleadooperaciones !== null) {
             foreach ($this->collClientesRelatedByIdempleadooperaciones as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->expedientearchivosScheduledForDeletion !== null) {
             if (!$this->expedientearchivosScheduledForDeletion->isEmpty()) {
                 ExpedientearchivoQuery::create()->filterByPrimaryKeys($this->expedientearchivosScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->expedientearchivosScheduledForDeletion = null;
             }
         }
         if ($this->collExpedientearchivos !== null) {
             foreach ($this->collExpedientearchivos as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->expedientegastosScheduledForDeletion !== null) {
             if (!$this->expedientegastosScheduledForDeletion->isEmpty()) {
                 ExpedientegastoQuery::create()->filterByPrimaryKeys($this->expedientegastosScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->expedientegastosScheduledForDeletion = null;
             }
         }
         if ($this->collExpedientegastos !== null) {
             foreach ($this->collExpedientegastos as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #23
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aMesa !== null) {
             if ($this->aMesa->isModified() || $this->aMesa->isNew()) {
                 $affectedRows += $this->aMesa->save($con);
             }
             $this->setMesa($this->aMesa);
         }
         if ($this->aJugador !== null) {
             if ($this->aJugador->isModified() || $this->aJugador->isNew()) {
                 $affectedRows += $this->aJugador->save($con);
             }
             $this->setJugador($this->aJugador);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->turnosScheduledForDeletion !== null) {
             if (!$this->turnosScheduledForDeletion->isEmpty()) {
                 foreach ($this->turnosScheduledForDeletion as $turno) {
                     // need to save related object because we set the relation to null
                     $turno->save($con);
                 }
                 $this->turnosScheduledForDeletion = null;
             }
         }
         if ($this->collTurnos !== null) {
             foreach ($this->collTurnos as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             // Rewind the newsletter_body LOB column, since PDO does not rewind after inserting value.
             if ($this->newsletter_body !== null && is_resource($this->newsletter_body)) {
                 rewind($this->newsletter_body);
             }
             $this->resetModified();
         }
         if ($this->newsletterMailingsScheduledForDeletion !== null) {
             if (!$this->newsletterMailingsScheduledForDeletion->isEmpty()) {
                 NewsletterMailingQuery::create()->filterByPrimaryKeys($this->newsletterMailingsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->newsletterMailingsScheduledForDeletion = null;
             }
         }
         if ($this->collNewsletterMailings !== null) {
             foreach ($this->collNewsletterMailings as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #25
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->aOrganization !== null) {
             if ($this->aOrganization->isModified() || $this->aOrganization->isNew()) {
                 $affectedRows += $this->aOrganization->save($con);
             }
             $this->setOrganization($this->aOrganization);
         }
         if ($this->aChartRelatedByForkedFrom !== null) {
             if ($this->aChartRelatedByForkedFrom->isModified() || $this->aChartRelatedByForkedFrom->isNew()) {
                 $affectedRows += $this->aChartRelatedByForkedFrom->save($con);
             }
             $this->setChartRelatedByForkedFrom($this->aChartRelatedByForkedFrom);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->chartsRelatedByIdScheduledForDeletion !== null) {
             if (!$this->chartsRelatedByIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->chartsRelatedByIdScheduledForDeletion as $chartRelatedById) {
                     // need to save related object because we set the relation to null
                     $chartRelatedById->save($con);
                 }
                 $this->chartsRelatedByIdScheduledForDeletion = null;
             }
         }
         if ($this->collChartsRelatedById !== null) {
             foreach ($this->collChartsRelatedById as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->jobsScheduledForDeletion !== null) {
             if (!$this->jobsScheduledForDeletion->isEmpty()) {
                 JobQuery::create()->filterByPrimaryKeys($this->jobsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->jobsScheduledForDeletion = null;
             }
         }
         if ($this->collJobs !== null) {
             foreach ($this->collJobs as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #26
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->pedidoProveedorsScheduledForDeletion !== null) {
             if (!$this->pedidoProveedorsScheduledForDeletion->isEmpty()) {
                 foreach ($this->pedidoProveedorsScheduledForDeletion as $pedidoProveedor) {
                     // need to save related object because we set the relation to null
                     $pedidoProveedor->save($con);
                 }
                 $this->pedidoProveedorsScheduledForDeletion = null;
             }
         }
         if ($this->collPedidoProveedors !== null) {
             foreach ($this->collPedidoProveedors as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->inventariosScheduledForDeletion !== null) {
             if (!$this->inventariosScheduledForDeletion->isEmpty()) {
                 foreach ($this->inventariosScheduledForDeletion as $inventario) {
                     // need to save related object because we set the relation to null
                     $inventario->save($con);
                 }
                 $this->inventariosScheduledForDeletion = null;
             }
         }
         if ($this->collInventarios !== null) {
             foreach ($this->collInventarios as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->facturaDetallesScheduledForDeletion !== null) {
             if (!$this->facturaDetallesScheduledForDeletion->isEmpty()) {
                 foreach ($this->facturaDetallesScheduledForDeletion as $facturaDetalle) {
                     // need to save related object because we set the relation to null
                     $facturaDetalle->save($con);
                 }
                 $this->facturaDetallesScheduledForDeletion = null;
             }
         }
         if ($this->collFacturaDetalles !== null) {
             foreach ($this->collFacturaDetalles as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->movimientosScheduledForDeletion !== null) {
             if (!$this->movimientosScheduledForDeletion->isEmpty()) {
                 foreach ($this->movimientosScheduledForDeletion as $movimiento) {
                     // need to save related object because we set the relation to null
                     $movimiento->save($con);
                 }
                 $this->movimientosScheduledForDeletion = null;
             }
         }
         if ($this->collMovimientos !== null) {
             foreach ($this->collMovimientos as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aPage !== null) {
             if ($this->aPage->isModified() || $this->aPage->isNew()) {
                 $affectedRows += $this->aPage->save($con);
             }
             $this->setPage($this->aPage);
         }
         if ($this->aLanguage !== null) {
             if ($this->aLanguage->isModified() || $this->aLanguage->isNew()) {
                 $affectedRows += $this->aLanguage->save($con);
             }
             $this->setLanguage($this->aLanguage);
         }
         if ($this->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->searchIndexWordsScheduledForDeletion !== null) {
             if (!$this->searchIndexWordsScheduledForDeletion->isEmpty()) {
                 SearchIndexWordQuery::create()->filterByPrimaryKeys($this->searchIndexWordsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->searchIndexWordsScheduledForDeletion = null;
             }
         }
         if ($this->collSearchIndexWords !== null) {
             foreach ($this->collSearchIndexWords as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #28
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aLugar !== null) {
             if ($this->aLugar->isModified() || $this->aLugar->isNew()) {
                 $affectedRows += $this->aLugar->save($con);
             }
             $this->setLugar($this->aLugar);
         }
         if ($this->aOrdencompradetalle !== null) {
             if ($this->aOrdencompradetalle->isModified() || $this->aOrdencompradetalle->isNew()) {
                 $affectedRows += $this->aOrdencompradetalle->save($con);
             }
             $this->setOrdencompradetalle($this->aOrdencompradetalle);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->cargoadmisionsScheduledForDeletion !== null) {
             if (!$this->cargoadmisionsScheduledForDeletion->isEmpty()) {
                 CargoadmisionQuery::create()->filterByPrimaryKeys($this->cargoadmisionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cargoadmisionsScheduledForDeletion = null;
             }
         }
         if ($this->collCargoadmisions !== null) {
             foreach ($this->collCargoadmisions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->cargoconsultasScheduledForDeletion !== null) {
             if (!$this->cargoconsultasScheduledForDeletion->isEmpty()) {
                 CargoconsultaQuery::create()->filterByPrimaryKeys($this->cargoconsultasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cargoconsultasScheduledForDeletion = null;
             }
         }
         if ($this->collCargoconsultas !== null) {
             foreach ($this->collCargoconsultas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->cargoventasScheduledForDeletion !== null) {
             if (!$this->cargoventasScheduledForDeletion->isEmpty()) {
                 CargoventaQuery::create()->filterByPrimaryKeys($this->cargoventasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cargoventasScheduledForDeletion = null;
             }
         }
         if ($this->collCargoventas !== null) {
             foreach ($this->collCargoventas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->traspasodetallessScheduledForDeletion !== null) {
             if (!$this->traspasodetallessScheduledForDeletion->isEmpty()) {
                 TraspasodetallesQuery::create()->filterByPrimaryKeys($this->traspasodetallessScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->traspasodetallessScheduledForDeletion = null;
             }
         }
         if ($this->collTraspasodetalless !== null) {
             foreach ($this->collTraspasodetalless as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
    /**
     * Compte les demi-journees saisies. Les saisies doivent ètre triées par ordre de début.
     * Cette méthode ne travaille que sur les dates, et prend en compte les fermeture de l'établissement
     *
     * @param PropelObjectCollection $abs_saisie_col collection d'objets AbsenceEleveSaisie
     *
     * @return PropelCollection une collection de date time par demi journee comptee (un datetime pour le matin et un datetime pour l'apres midi
     */

    public static function compte_demi_journee($abs_saisie_col, $date_debut_iteration = null, $date_fin_iteration = null) {
        if ($abs_saisie_col->isEmpty()) {
            return new PropelCollection();
        }
        
        $abs_saisie_col->uasort(array("AbsencesEleveSaisieHelper", "compare_debut_absence"));
        
        //on récupère l'heure de demi-journée
        $heure_demi_journee = 11;//11:50 par défaut si rien n'est précisé dans les settings
        $minute_demi_journee = 50;
        if (getSettingValue("abs2_heure_demi_journee") != null) {
            try {
                $dt_demi_journee = new DateTime(getSettingValue("abs2_heure_demi_journee"));
                $heure_demi_journee = $dt_demi_journee->format('H');
                $minute_demi_journee = $dt_demi_journee->format('i');
            } catch (Exception $x) {
            }
        }
         
        //on va regarder la date du début pour notre algorithme
        if ($date_debut_iteration == null) {
            $date_debut_iteration = $abs_saisie_col->getFirst()->getDebutAbs(null);
        }
        if ($date_debut_iteration->format('Hi') < $heure_demi_journee.$minute_demi_journee) {
            $date_debut_iteration->setTime(0, 0, 0);
        } else {
            $date_debut_iteration->setTime(12, 0, 0);
        }
              
        //on va regarder la date du fin pour notre algorithme
        if ($date_fin_iteration == null) {
            foreach ($abs_saisie_col as $saisie) {
                if ($date_fin_iteration == null || $saisie->getFinAbs('U') > $date_fin_iteration->format('U')) {
                    $date_fin_iteration = $saisie->getFinAbs(null);
                }
            }
        }
        if ($date_fin_iteration->format('Hi') < $heure_demi_journee.$minute_demi_journee) {
            $date_fin_iteration->setTime(12, 0, 0);
        } else {
            $date_fin_iteration->setTime(23, 59, 59);
            $date_fin_iteration->modify("+1 second");
        }
        $date_fin_iteration->modify("+2 hours");//on ajout deux heures pour prendre en compte un décalage dans la date de compteur (+1h35) dans l'algorithme plus bas
        

        $result = new PropelCollection();
        $date_compteur = clone $date_debut_iteration;
        $horaire_tab = EdtHorairesEtablissementPeer::retrieveAllEdtHorairesEtablissementArrayCopy();
        require_once(dirname(__FILE__)."/EdtHelper.php");
        foreach($abs_saisie_col as $saisie) {
            if ($date_compteur->format('U') < $saisie->getDebutAbs('U')) {
                $date_compteur = clone $saisie->getDebutAbs(null);
            }
            if ($date_compteur >= $date_fin_iteration) {
                break;
            }
            
            while ($date_compteur <= $saisie->getFinAbs(null) && $date_compteur < $date_fin_iteration) {
                //est-ce un jour de la semaine ouvert ?
                if (!EdtHelper::isJourneeOuverte($date_compteur)) {
                    //etab fermé on va passer au lendemain
                    $date_compteur->setTime(23, 59, 59);
                    $date_compteur->modify("+2 hours");
                    continue;
                } elseif (!EdtHelper::isHoraireOuvert($date_compteur)) {
                    $horaire = $horaire_tab[EdtHelper::$semaine_declaration[$date_compteur->format("w")]];
                    if ($date_compteur->format('Hi') < $horaire->getOuvertureHoraireEtablissement('Hi')) {
                        //c'est le matin, on règle sur l'heure d'ouverture
                        $date_compteur->setTime($horaire->getOuvertureHoraireEtablissement('H'), $horaire->getOuvertureHoraireEtablissement('i'));
                    } else {
                        //on est apres la fermeture, on va passer au lendemain
                        $date_compteur->setTime(23, 59, 59);
                        $date_compteur->modify("+2 hours");
                    }
                    continue;
                } elseif ($date_compteur < $saisie->getDebutAbs(null) && !EdtHelper::isHoraireOuvert($saisie->getDebutAbs(null))) {
                    $date_compteur->modify("+19 minutes");
                    continue;
                }

                if ($date_compteur->format('Hi') < $heure_demi_journee.$minute_demi_journee) {
                    $date_compteur->setTime(0, 0, 0);
                } else {
                    $date_compteur->setTime(12, 0, 0);
                }
                $date_compteur_suivante = clone $date_compteur;
                $date_compteur_suivante->modify("+15 hours");//en ajoutant 15 heure on est sur de passer a la demi-journee suivante
                if ($date_compteur_suivante->format('H') < 12) {
                    $date_compteur_suivante->setTime(0, 0, 0);
                } else {
                    $date_compteur_suivante->setTime($heure_demi_journee, $minute_demi_journee, 0);
                }
                
                if ($saisie->getDebutAbs(null) < $date_compteur_suivante && $saisie->getFinAbs(null) > $date_compteur) {
                    $result->append(clone $date_compteur);
                    //on ajoute 1h35
                    //pour eviter le cas ou on a une saisie par exemple sur 11h45 -> 13h et de la compter comme deux demi-journees
                    $date_compteur_suivante->modify("+1 hour");
                    $date_compteur_suivante->modify("+45 minutes");
                }
                
                $date_compteur = $date_compteur_suivante;
                $saisie->clearAllReferences();
            }
        }
        return $result;
    }
Example #30
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aEspecialidad !== null) {
             if ($this->aEspecialidad->isModified() || $this->aEspecialidad->isNew()) {
                 $affectedRows += $this->aEspecialidad->save($con);
             }
             $this->setEspecialidad($this->aEspecialidad);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->admisionsScheduledForDeletion !== null) {
             if (!$this->admisionsScheduledForDeletion->isEmpty()) {
                 AdmisionQuery::create()->filterByPrimaryKeys($this->admisionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->admisionsScheduledForDeletion = null;
             }
         }
         if ($this->collAdmisions !== null) {
             foreach ($this->collAdmisions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->citasScheduledForDeletion !== null) {
             if (!$this->citasScheduledForDeletion->isEmpty()) {
                 CitaQuery::create()->filterByPrimaryKeys($this->citasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->citasScheduledForDeletion = null;
             }
         }
         if ($this->collCitas !== null) {
             foreach ($this->collCitas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->consultasScheduledForDeletion !== null) {
             if (!$this->consultasScheduledForDeletion->isEmpty()) {
                 ConsultaQuery::create()->filterByPrimaryKeys($this->consultasScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->consultasScheduledForDeletion = null;
             }
         }
         if ($this->collConsultas !== null) {
             foreach ($this->collConsultas as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->medicoespecialidadsScheduledForDeletion !== null) {
             if (!$this->medicoespecialidadsScheduledForDeletion->isEmpty()) {
                 MedicoespecialidadQuery::create()->filterByPrimaryKeys($this->medicoespecialidadsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->medicoespecialidadsScheduledForDeletion = null;
             }
         }
         if ($this->collMedicoespecialidads !== null) {
             foreach ($this->collMedicoespecialidads as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->medicofacturacionsScheduledForDeletion !== null) {
             if (!$this->medicofacturacionsScheduledForDeletion->isEmpty()) {
                 MedicofacturacionQuery::create()->filterByPrimaryKeys($this->medicofacturacionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->medicofacturacionsScheduledForDeletion = null;
             }
         }
         if ($this->collMedicofacturacions !== null) {
             foreach ($this->collMedicofacturacions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }