本文整理汇总了PHP中PropelObjectCollection::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP PropelObjectCollection::isEmpty方法的具体用法?PHP PropelObjectCollection::isEmpty怎么用?PHP PropelObjectCollection::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropelObjectCollection
的用法示例。
在下文中一共展示了PropelObjectCollection::isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSave
/**
* 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;
}
示例2: doSave
/**
* 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;
}
示例3: doSave
/**
* 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;
}
示例4: testCollectionAdd
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);
}
示例5: doSave
/**
* 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;
}
示例6: preremplirResponsables
/**
*
* 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;
}
示例7: doSave
/**
* 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())) {
//.........这里部分代码省略.........
示例8: echo
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 ">";
示例9: doSave
/**
* 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;
}
示例10: doSave
/**
* 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);
}
}
//.........这里部分代码省略.........
示例11: doSave
/**
* 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;
}
示例12: if
</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); ?>"/>
示例13: doSave
/**
* 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);
}
}
}
//.........这里部分代码省略.........
示例14: doSave
/**
* 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
//.........这里部分代码省略.........
示例15: doSave
/**
* 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);
}
}
//.........这里部分代码省略.........