/**
  * 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      ConnectionInterface $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(ConnectionInterface $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);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->groupAccessesScheduledForDeletion !== null) {
             if (!$this->groupAccessesScheduledForDeletion->isEmpty()) {
                 \ECP\GroupAccessQuery::create()->filterByPrimaryKeys($this->groupAccessesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->groupAccessesScheduledForDeletion = null;
             }
         }
         if ($this->collGroupAccesses !== null) {
             foreach ($this->collGroupAccesses as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->stocksScheduledForDeletion !== null) {
             if (!$this->stocksScheduledForDeletion->isEmpty()) {
                 foreach ($this->stocksScheduledForDeletion as $stock) {
                     // need to save related object because we set the relation to null
                     $stock->save($con);
                 }
                 $this->stocksScheduledForDeletion = null;
             }
         }
         if ($this->collStocks !== null) {
             foreach ($this->collStocks as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aTaxRule !== null) {
             if ($this->aTaxRule->isModified() || $this->aTaxRule->isNew()) {
                 $affectedRows += $this->aTaxRule->save($con);
             }
             $this->setTaxRule($this->aTaxRule);
         }
         if ($this->aTemplate !== null) {
             if ($this->aTemplate->isModified() || $this->aTemplate->isNew()) {
                 $affectedRows += $this->aTemplate->save($con);
             }
             $this->setTemplate($this->aTemplate);
         }
         if ($this->aBrand !== null) {
             if ($this->aBrand->isModified() || $this->aBrand->isNew()) {
                 $affectedRows += $this->aBrand->save($con);
             }
             $this->setBrand($this->aBrand);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->categoriesScheduledForDeletion !== null) {
             if (!$this->categoriesScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->categoriesScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 ProductCategoryQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->categoriesScheduledForDeletion = null;
             }
             foreach ($this->getCategories() as $category) {
                 if ($category->isModified()) {
                     $category->save($con);
                 }
             }
         } elseif ($this->collCategories) {
             foreach ($this->collCategories as $category) {
                 if ($category->isModified()) {
                     $category->save($con);
                 }
             }
         }
         if ($this->productsRelatedByAccessoryScheduledForDeletion !== null) {
             if (!$this->productsRelatedByAccessoryScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->productsRelatedByAccessoryScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 AccessoryRelatedByProductIdQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->productsRelatedByAccessoryScheduledForDeletion = null;
             }
             foreach ($this->getProductsRelatedByAccessory() as $productRelatedByAccessory) {
                 if ($productRelatedByAccessory->isModified()) {
                     $productRelatedByAccessory->save($con);
                 }
             }
         } elseif ($this->collProductsRelatedByAccessory) {
             foreach ($this->collProductsRelatedByAccessory as $productRelatedByAccessory) {
                 if ($productRelatedByAccessory->isModified()) {
                     $productRelatedByAccessory->save($con);
                 }
             }
         }
         if ($this->productsRelatedByProductIdScheduledForDeletion !== null) {
             if (!$this->productsRelatedByProductIdScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->productsRelatedByProductIdScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 AccessoryRelatedByAccessoryQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->productsRelatedByProductIdScheduledForDeletion = null;
             }
             foreach ($this->getProductsRelatedByProductId() as $productRelatedByProductId) {
                 if ($productRelatedByProductId->isModified()) {
                     $productRelatedByProductId->save($con);
                 }
             }
         } elseif ($this->collProductsRelatedByProductId) {
             foreach ($this->collProductsRelatedByProductId as $productRelatedByProductId) {
                 if ($productRelatedByProductId->isModified()) {
                     $productRelatedByProductId->save($con);
                 }
             }
         }
         if ($this->productCategoriesScheduledForDeletion !== null) {
             if (!$this->productCategoriesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductCategoryQuery::create()->filterByPrimaryKeys($this->productCategoriesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productCategoriesScheduledForDeletion = null;
             }
         }
         if ($this->collProductCategories !== null) {
             foreach ($this->collProductCategories as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->featureProductsScheduledForDeletion !== null) {
             if (!$this->featureProductsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\FeatureProductQuery::create()->filterByPrimaryKeys($this->featureProductsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->featureProductsScheduledForDeletion = null;
             }
         }
         if ($this->collFeatureProducts !== null) {
             foreach ($this->collFeatureProducts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productSaleElementssScheduledForDeletion !== null) {
             if (!$this->productSaleElementssScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductSaleElementsQuery::create()->filterByPrimaryKeys($this->productSaleElementssScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productSaleElementssScheduledForDeletion = null;
             }
         }
         if ($this->collProductSaleElementss !== null) {
             foreach ($this->collProductSaleElementss as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productImagesScheduledForDeletion !== null) {
             if (!$this->productImagesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductImageQuery::create()->filterByPrimaryKeys($this->productImagesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productImagesScheduledForDeletion = null;
             }
         }
         if ($this->collProductImages !== null) {
             foreach ($this->collProductImages as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productDocumentsScheduledForDeletion !== null) {
             if (!$this->productDocumentsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductDocumentQuery::create()->filterByPrimaryKeys($this->productDocumentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productDocumentsScheduledForDeletion = null;
             }
         }
         if ($this->collProductDocuments !== null) {
             foreach ($this->collProductDocuments as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->accessoriesRelatedByProductIdScheduledForDeletion !== null) {
             if (!$this->accessoriesRelatedByProductIdScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\AccessoryQuery::create()->filterByPrimaryKeys($this->accessoriesRelatedByProductIdScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->accessoriesRelatedByProductIdScheduledForDeletion = null;
             }
         }
         if ($this->collAccessoriesRelatedByProductId !== null) {
             foreach ($this->collAccessoriesRelatedByProductId as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->accessoriesRelatedByAccessoryScheduledForDeletion !== null) {
             if (!$this->accessoriesRelatedByAccessoryScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\AccessoryQuery::create()->filterByPrimaryKeys($this->accessoriesRelatedByAccessoryScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->accessoriesRelatedByAccessoryScheduledForDeletion = null;
             }
         }
         if ($this->collAccessoriesRelatedByAccessory !== null) {
             foreach ($this->collAccessoriesRelatedByAccessory as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->cartItemsScheduledForDeletion !== null) {
             if (!$this->cartItemsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CartItemQuery::create()->filterByPrimaryKeys($this->cartItemsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cartItemsScheduledForDeletion = null;
             }
         }
         if ($this->collCartItems !== null) {
             foreach ($this->collCartItems as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productAssociatedContentsScheduledForDeletion !== null) {
             if (!$this->productAssociatedContentsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductAssociatedContentQuery::create()->filterByPrimaryKeys($this->productAssociatedContentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productAssociatedContentsScheduledForDeletion = null;
             }
         }
         if ($this->collProductAssociatedContents !== null) {
             foreach ($this->collProductAssociatedContents as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->saleProductsScheduledForDeletion !== null) {
             if (!$this->saleProductsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\SaleProductQuery::create()->filterByPrimaryKeys($this->saleProductsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->saleProductsScheduledForDeletion = null;
             }
         }
         if ($this->collSaleProducts !== null) {
             foreach ($this->collSaleProducts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productI18nsScheduledForDeletion !== null) {
             if (!$this->productI18nsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductI18nQuery::create()->filterByPrimaryKeys($this->productI18nsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productI18nsScheduledForDeletion = null;
             }
         }
         if ($this->collProductI18ns !== null) {
             foreach ($this->collProductI18ns as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productVersionsScheduledForDeletion !== null) {
             if (!$this->productVersionsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductVersionQuery::create()->filterByPrimaryKeys($this->productVersionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productVersionsScheduledForDeletion = null;
             }
         }
         if ($this->collProductVersions !== null) {
             foreach ($this->collProductVersions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $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      ConnectionInterface $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(ConnectionInterface $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->aPeriod !== null) {
             if ($this->aPeriod->isModified() || $this->aPeriod->isNew()) {
                 $affectedRows += $this->aPeriod->save($con);
             }
             $this->setPeriod($this->aPeriod);
         }
         if ($this->aSubject !== null) {
             if ($this->aSubject->isModified() || $this->aSubject->isNew()) {
                 $affectedRows += $this->aSubject->save($con);
             }
             $this->setSubject($this->aSubject);
         }
         if ($this->aStudent !== null) {
             if ($this->aStudent->isModified() || $this->aStudent->isNew()) {
                 $affectedRows += $this->aStudent->save($con);
             }
             $this->setStudent($this->aStudent);
         }
         if ($this->aSchoolYear !== null) {
             if ($this->aSchoolYear->isModified() || $this->aSchoolYear->isNew()) {
                 $affectedRows += $this->aSchoolYear->save($con);
             }
             $this->setSchoolYear($this->aSchoolYear);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->applicationRequestsScheduledForDeletion !== null) {
             if (!$this->applicationRequestsScheduledForDeletion->isEmpty()) {
                 foreach ($this->applicationRequestsScheduledForDeletion as $applicationRequest) {
                     // need to save related object because we set the relation to null
                     $applicationRequest->save($con);
                 }
                 $this->applicationRequestsScheduledForDeletion = null;
             }
         }
         if ($this->collApplicationRequests !== null) {
             foreach ($this->collApplicationRequests as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->rolesScheduledForDeletion !== null) {
             if (!$this->rolesScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->rolesScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getId();
                     $entryPk[1] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \Alchemy\Component\Cerberus\Model\UserRoleQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->rolesScheduledForDeletion = null;
             }
         }
         if ($this->collRoles) {
             foreach ($this->collRoles as $role) {
                 if (!$role->isDeleted() && ($role->isNew() || $role->isModified())) {
                     $role->save($con);
                 }
             }
         }
         if ($this->userRolesScheduledForDeletion !== null) {
             if (!$this->userRolesScheduledForDeletion->isEmpty()) {
                 \Alchemy\Component\Cerberus\Model\UserRoleQuery::create()->filterByPrimaryKeys($this->userRolesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userRolesScheduledForDeletion = null;
             }
         }
         if ($this->collUserRoles !== null) {
             foreach ($this->collUserRoles as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #6
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      ConnectionInterface $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(ConnectionInterface $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->aProduct !== null) {
             if ($this->aProduct->isModified() || $this->aProduct->isNew()) {
                 $affectedRows += $this->aProduct->save($con);
             }
             $this->setProduct($this->aProduct);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->productSaleElementssScheduledForDeletion !== null) {
             if (!$this->productSaleElementssScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->productSaleElementssScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($remotePk, $pk);
                 }
                 ProductSaleElementsProductImageQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->productSaleElementssScheduledForDeletion = null;
             }
             foreach ($this->getProductSaleElementss() as $productSaleElements) {
                 if ($productSaleElements->isModified()) {
                     $productSaleElements->save($con);
                 }
             }
         } elseif ($this->collProductSaleElementss) {
             foreach ($this->collProductSaleElementss as $productSaleElements) {
                 if ($productSaleElements->isModified()) {
                     $productSaleElements->save($con);
                 }
             }
         }
         if ($this->productSaleElementsProductImagesScheduledForDeletion !== null) {
             if (!$this->productSaleElementsProductImagesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductSaleElementsProductImageQuery::create()->filterByPrimaryKeys($this->productSaleElementsProductImagesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productSaleElementsProductImagesScheduledForDeletion = null;
             }
         }
         if ($this->collProductSaleElementsProductImages !== null) {
             foreach ($this->collProductSaleElementsProductImages as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productImageI18nsScheduledForDeletion !== null) {
             if (!$this->productImageI18nsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductImageI18nQuery::create()->filterByPrimaryKeys($this->productImageI18nsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productImageI18nsScheduledForDeletion = null;
             }
         }
         if ($this->collProductImageI18ns !== null) {
             foreach ($this->collProductImageI18ns as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aChampionship !== null) {
             if ($this->aChampionship->isModified() || $this->aChampionship->isNew()) {
                 $affectedRows += $this->aChampionship->save($con);
             }
             $this->setChampionship($this->aChampionship);
         }
         if ($this->aRound !== null) {
             if ($this->aRound->isModified() || $this->aRound->isNew()) {
                 $affectedRows += $this->aRound->save($con);
             }
             $this->setRound($this->aRound);
         }
         if ($this->aLeague !== null) {
             if ($this->aLeague->isModified() || $this->aLeague->isNew()) {
                 $affectedRows += $this->aLeague->save($con);
             }
             $this->setLeague($this->aLeague);
         }
         if ($this->aHometeam !== null) {
             if ($this->aHometeam->isModified() || $this->aHometeam->isNew()) {
                 $affectedRows += $this->aHometeam->save($con);
             }
             $this->setHometeam($this->aHometeam);
         }
         if ($this->aAwayteam !== null) {
             if ($this->aAwayteam->isModified() || $this->aAwayteam->isNew()) {
                 $affectedRows += $this->aAwayteam->save($con);
             }
             $this->setAwayteam($this->aAwayteam);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->tipsScheduledForDeletion !== null) {
             if (!$this->tipsScheduledForDeletion->isEmpty()) {
                 \Haus23\Dtp\Model\TipQuery::create()->filterByPrimaryKeys($this->tipsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->tipsScheduledForDeletion = null;
             }
         }
         if ($this->collTips !== null) {
             foreach ($this->collTips as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #8
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      ConnectionInterface $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(ConnectionInterface $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->aCurrency !== null) {
             if ($this->aCurrency->isModified() || $this->aCurrency->isNew()) {
                 $affectedRows += $this->aCurrency->save($con);
             }
             $this->setCurrency($this->aCurrency);
         }
         if ($this->aCustomer !== null) {
             if ($this->aCustomer->isModified() || $this->aCustomer->isNew()) {
                 $affectedRows += $this->aCustomer->save($con);
             }
             $this->setCustomer($this->aCustomer);
         }
         if ($this->aOrderAddressRelatedByInvoiceOrderAddressId !== null) {
             if ($this->aOrderAddressRelatedByInvoiceOrderAddressId->isModified() || $this->aOrderAddressRelatedByInvoiceOrderAddressId->isNew()) {
                 $affectedRows += $this->aOrderAddressRelatedByInvoiceOrderAddressId->save($con);
             }
             $this->setOrderAddressRelatedByInvoiceOrderAddressId($this->aOrderAddressRelatedByInvoiceOrderAddressId);
         }
         if ($this->aOrderAddressRelatedByDeliveryOrderAddressId !== null) {
             if ($this->aOrderAddressRelatedByDeliveryOrderAddressId->isModified() || $this->aOrderAddressRelatedByDeliveryOrderAddressId->isNew()) {
                 $affectedRows += $this->aOrderAddressRelatedByDeliveryOrderAddressId->save($con);
             }
             $this->setOrderAddressRelatedByDeliveryOrderAddressId($this->aOrderAddressRelatedByDeliveryOrderAddressId);
         }
         if ($this->aOrderStatus !== null) {
             if ($this->aOrderStatus->isModified() || $this->aOrderStatus->isNew()) {
                 $affectedRows += $this->aOrderStatus->save($con);
             }
             $this->setOrderStatus($this->aOrderStatus);
         }
         if ($this->aModuleRelatedByPaymentModuleId !== null) {
             if ($this->aModuleRelatedByPaymentModuleId->isModified() || $this->aModuleRelatedByPaymentModuleId->isNew()) {
                 $affectedRows += $this->aModuleRelatedByPaymentModuleId->save($con);
             }
             $this->setModuleRelatedByPaymentModuleId($this->aModuleRelatedByPaymentModuleId);
         }
         if ($this->aModuleRelatedByDeliveryModuleId !== null) {
             if ($this->aModuleRelatedByDeliveryModuleId->isModified() || $this->aModuleRelatedByDeliveryModuleId->isNew()) {
                 $affectedRows += $this->aModuleRelatedByDeliveryModuleId->save($con);
             }
             $this->setModuleRelatedByDeliveryModuleId($this->aModuleRelatedByDeliveryModuleId);
         }
         if ($this->aLang !== null) {
             if ($this->aLang->isModified() || $this->aLang->isNew()) {
                 $affectedRows += $this->aLang->save($con);
             }
             $this->setLang($this->aLang);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->orderProductsScheduledForDeletion !== null) {
             if (!$this->orderProductsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderProductQuery::create()->filterByPrimaryKeys($this->orderProductsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->orderProductsScheduledForDeletion = null;
             }
         }
         if ($this->collOrderProducts !== null) {
             foreach ($this->collOrderProducts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->orderCouponsScheduledForDeletion !== null) {
             if (!$this->orderCouponsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderCouponQuery::create()->filterByPrimaryKeys($this->orderCouponsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->orderCouponsScheduledForDeletion = null;
             }
         }
         if ($this->collOrderCoupons !== null) {
             foreach ($this->collOrderCoupons as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->orderVersionsScheduledForDeletion !== null) {
             if (!$this->orderVersionsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderVersionQuery::create()->filterByPrimaryKeys($this->orderVersionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->orderVersionsScheduledForDeletion = null;
             }
         }
         if ($this->collOrderVersions !== null) {
             foreach ($this->collOrderVersions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $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      ConnectionInterface $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(ConnectionInterface $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);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->rightssScheduledForDeletion !== null) {
             if (!$this->rightssScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->rightssScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[1] = $this->getId();
                     $entryPk[0] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \RRightsFortemplateQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->rightssScheduledForDeletion = null;
             }
         }
         if ($this->collRightss) {
             foreach ($this->collRightss as $rights) {
                 if (!$rights->isDeleted() && ($rights->isNew() || $rights->isModified())) {
                     $rights->save($con);
                 }
             }
         }
         if ($this->bookssScheduledForDeletion !== null) {
             if (!$this->bookssScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->bookssScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getId();
                     $entryPk[1] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \RTemplatenamesForbookQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->bookssScheduledForDeletion = null;
             }
         }
         if ($this->collBookss) {
             foreach ($this->collBookss as $books) {
                 if (!$books->isDeleted() && ($books->isNew() || $books->isModified())) {
                     $books->save($con);
                 }
             }
         }
         if ($this->formatssScheduledForDeletion !== null) {
             if (!$this->formatssScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->formatssScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getId();
                     $entryPk[1] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \RTemplatenamesInchapterQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->formatssScheduledForDeletion = null;
             }
         }
         if ($this->collFormatss) {
             foreach ($this->collFormatss as $formats) {
                 if (!$formats->isDeleted() && ($formats->isNew() || $formats->isModified())) {
                     $formats->save($con);
                 }
             }
         }
         if ($this->rRightsFortemplatesScheduledForDeletion !== null) {
             if (!$this->rRightsFortemplatesScheduledForDeletion->isEmpty()) {
                 \RRightsFortemplateQuery::create()->filterByPrimaryKeys($this->rRightsFortemplatesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rRightsFortemplatesScheduledForDeletion = null;
             }
         }
         if ($this->collRRightsFortemplates !== null) {
             foreach ($this->collRRightsFortemplates as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rTemplatenamesForbooksScheduledForDeletion !== null) {
             if (!$this->rTemplatenamesForbooksScheduledForDeletion->isEmpty()) {
                 \RTemplatenamesForbookQuery::create()->filterByPrimaryKeys($this->rTemplatenamesForbooksScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rTemplatenamesForbooksScheduledForDeletion = null;
             }
         }
         if ($this->collRTemplatenamesForbooks !== null) {
             foreach ($this->collRTemplatenamesForbooks as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rTemplatenamesInchaptersScheduledForDeletion !== null) {
             if (!$this->rTemplatenamesInchaptersScheduledForDeletion->isEmpty()) {
                 \RTemplatenamesInchapterQuery::create()->filterByPrimaryKeys($this->rTemplatenamesInchaptersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rTemplatenamesInchaptersScheduledForDeletion = null;
             }
         }
         if ($this->collRTemplatenamesInchapters !== null) {
             foreach ($this->collRTemplatenamesInchapters as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contributionssScheduledForDeletion !== null) {
             if (!$this->contributionssScheduledForDeletion->isEmpty()) {
                 \ContributionsQuery::create()->filterByPrimaryKeys($this->contributionssScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contributionssScheduledForDeletion = null;
             }
         }
         if ($this->collContributionss !== null) {
             foreach ($this->collContributionss as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->templatessScheduledForDeletion !== null) {
             if (!$this->templatessScheduledForDeletion->isEmpty()) {
                 \TemplatesQuery::create()->filterByPrimaryKeys($this->templatessScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->templatessScheduledForDeletion = null;
             }
         }
         if ($this->collTemplatess !== null) {
             foreach ($this->collTemplatess as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->ordersScheduledForDeletion !== null) {
             if (!$this->ordersScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderQuery::create()->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->ordersScheduledForDeletion = null;
             }
         }
         if ($this->collOrders !== null) {
             foreach ($this->collOrders as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->cartsScheduledForDeletion !== null) {
             if (!$this->cartsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CartQuery::create()->filterByPrimaryKeys($this->cartsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cartsScheduledForDeletion = null;
             }
         }
         if ($this->collCarts !== null) {
             foreach ($this->collCarts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productPricesScheduledForDeletion !== null) {
             if (!$this->productPricesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductPriceQuery::create()->filterByPrimaryKeys($this->productPricesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productPricesScheduledForDeletion = null;
             }
         }
         if ($this->collProductPrices !== null) {
             foreach ($this->collProductPrices as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->saleOffsetCurrenciesScheduledForDeletion !== null) {
             if (!$this->saleOffsetCurrenciesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\SaleOffsetCurrencyQuery::create()->filterByPrimaryKeys($this->saleOffsetCurrenciesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->saleOffsetCurrenciesScheduledForDeletion = null;
             }
         }
         if ($this->collSaleOffsetCurrencies !== null) {
             foreach ($this->collSaleOffsetCurrencies as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->currencyI18nsScheduledForDeletion !== null) {
             if (!$this->currencyI18nsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CurrencyI18nQuery::create()->filterByPrimaryKeys($this->currencyI18nsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->currencyI18nsScheduledForDeletion = null;
             }
         }
         if ($this->collCurrencyI18ns !== null) {
             foreach ($this->collCurrencyI18ns as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aCompanyRelatedByPublisherId !== null) {
             if ($this->aCompanyRelatedByPublisherId->isModified() || $this->aCompanyRelatedByPublisherId->isNew()) {
                 $affectedRows += $this->aCompanyRelatedByPublisherId->save($con);
             }
             $this->setCompanyRelatedByPublisherId($this->aCompanyRelatedByPublisherId);
         }
         if ($this->aCompanyRelatedByDeveloperId !== null) {
             if ($this->aCompanyRelatedByDeveloperId->isModified() || $this->aCompanyRelatedByDeveloperId->isNew()) {
                 $affectedRows += $this->aCompanyRelatedByDeveloperId->save($con);
             }
             $this->setCompanyRelatedByDeveloperId($this->aCompanyRelatedByDeveloperId);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->gameLinksScheduledForDeletion !== null) {
             if (!$this->gameLinksScheduledForDeletion->isEmpty()) {
                 \GameLinkQuery::create()->filterByPrimaryKeys($this->gameLinksScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->gameLinksScheduledForDeletion = null;
             }
         }
         if ($this->collGameLinks !== null) {
             foreach ($this->collGameLinks as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->gamePlatformsScheduledForDeletion !== null) {
             if (!$this->gamePlatformsScheduledForDeletion->isEmpty()) {
                 \GamePlatformQuery::create()->filterByPrimaryKeys($this->gamePlatformsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->gamePlatformsScheduledForDeletion = null;
             }
         }
         if ($this->collGamePlatforms !== null) {
             foreach ($this->collGamePlatforms as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->ratingHeadersScheduledForDeletion !== null) {
             if (!$this->ratingHeadersScheduledForDeletion->isEmpty()) {
                 \RatingHeaderQuery::create()->filterByPrimaryKeys($this->ratingHeadersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->ratingHeadersScheduledForDeletion = null;
             }
         }
         if ($this->collRatingHeaders !== null) {
             foreach ($this->collRatingHeaders as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userReviewsScheduledForDeletion !== null) {
             if (!$this->userReviewsScheduledForDeletion->isEmpty()) {
                 \UserReviewQuery::create()->filterByPrimaryKeys($this->userReviewsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userReviewsScheduledForDeletion = null;
             }
         }
         if ($this->collUserReviews !== null) {
             foreach ($this->collUserReviews as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #12
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      ConnectionInterface $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(ConnectionInterface $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);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->categoriesScheduledForDeletion !== null) {
             if (!$this->categoriesScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->categoriesScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getId();
                     $entryPk[1] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \ObjectCategoryQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->categoriesScheduledForDeletion = null;
             }
         }
         if ($this->collCategories) {
             foreach ($this->collCategories as $category) {
                 if (!$category->isDeleted() && ($category->isNew() || $category->isModified())) {
                     $category->save($con);
                 }
             }
         }
         if ($this->servicessScheduledForDeletion !== null) {
             if (!$this->servicessScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->servicessScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getId();
                     $entryPk[1] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \ObjectServicesQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->servicessScheduledForDeletion = null;
             }
         }
         if ($this->collServicess) {
             foreach ($this->collServicess as $services) {
                 if (!$services->isDeleted() && ($services->isNew() || $services->isModified())) {
                     $services->save($con);
                 }
             }
         }
         if ($this->objectCategoriesScheduledForDeletion !== null) {
             if (!$this->objectCategoriesScheduledForDeletion->isEmpty()) {
                 \ObjectCategoryQuery::create()->filterByPrimaryKeys($this->objectCategoriesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->objectCategoriesScheduledForDeletion = null;
             }
         }
         if ($this->collObjectCategories !== null) {
             foreach ($this->collObjectCategories as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->objectServicessScheduledForDeletion !== null) {
             if (!$this->objectServicessScheduledForDeletion->isEmpty()) {
                 \ObjectServicesQuery::create()->filterByPrimaryKeys($this->objectServicessScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->objectServicessScheduledForDeletion = null;
             }
         }
         if ($this->collObjectServicess !== null) {
             foreach ($this->collObjectServicess as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->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);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->ratingHeaderssScheduledForDeletion !== null) {
             if (!$this->ratingHeaderssScheduledForDeletion->isEmpty()) {
                 foreach ($this->ratingHeaderssScheduledForDeletion as $ratingHeaders) {
                     // need to save related object because we set the relation to null
                     $ratingHeaders->save($con);
                 }
                 $this->ratingHeaderssScheduledForDeletion = null;
             }
         }
         if ($this->collRatingHeaderss !== null) {
             foreach ($this->collRatingHeaderss as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rigAttributeValuessScheduledForDeletion !== null) {
             if (!$this->rigAttributeValuessScheduledForDeletion->isEmpty()) {
                 \RigAttributeValuesQuery::create()->filterByPrimaryKeys($this->rigAttributeValuessScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rigAttributeValuessScheduledForDeletion = null;
             }
         }
         if ($this->collRigAttributeValuess !== null) {
             foreach ($this->collRigAttributeValuess as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->auserSysRef !== null) {
             if ($this->auserSysRef->isModified() || $this->auserSysRef->isNew()) {
                 $affectedRows += $this->auserSysRef->save($con);
             }
             $this->setuserSysRef($this->auserSysRef);
         }
         if ($this->aBooks !== null) {
             if ($this->aBooks->isModified() || $this->aBooks->isNew()) {
                 $affectedRows += $this->aBooks->save($con);
             }
             $this->setBooks($this->aBooks);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->rightssScheduledForDeletion !== null) {
             if (!$this->rightssScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->rightssScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[1] = $this->getId();
                     $entryPk[0] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \RRightsForformatQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->rightssScheduledForDeletion = null;
             }
         }
         if ($this->collRightss) {
             foreach ($this->collRightss as $rights) {
                 if (!$rights->isDeleted() && ($rights->isNew() || $rights->isModified())) {
                     $rights->save($con);
                 }
             }
         }
         if ($this->templatenamessScheduledForDeletion !== null) {
             if (!$this->templatenamessScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->templatenamessScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[1] = $this->getId();
                     $entryPk[0] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \RTemplatenamesInchapterQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->templatenamessScheduledForDeletion = null;
             }
         }
         if ($this->collTemplatenamess) {
             foreach ($this->collTemplatenamess as $templatenames) {
                 if (!$templatenames->isDeleted() && ($templatenames->isNew() || $templatenames->isModified())) {
                     $templatenames->save($con);
                 }
             }
         }
         if ($this->rRightsForformatsScheduledForDeletion !== null) {
             if (!$this->rRightsForformatsScheduledForDeletion->isEmpty()) {
                 \RRightsForformatQuery::create()->filterByPrimaryKeys($this->rRightsForformatsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rRightsForformatsScheduledForDeletion = null;
             }
         }
         if ($this->collRRightsForformats !== null) {
             foreach ($this->collRRightsForformats as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rTemplatenamesInchaptersScheduledForDeletion !== null) {
             if (!$this->rTemplatenamesInchaptersScheduledForDeletion->isEmpty()) {
                 \RTemplatenamesInchapterQuery::create()->filterByPrimaryKeys($this->rTemplatenamesInchaptersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rTemplatenamesInchaptersScheduledForDeletion = null;
             }
         }
         if ($this->collRTemplatenamesInchapters !== null) {
             foreach ($this->collRTemplatenamesInchapters as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contributionssScheduledForDeletion !== null) {
             if (!$this->contributionssScheduledForDeletion->isEmpty()) {
                 \ContributionsQuery::create()->filterByPrimaryKeys($this->contributionssScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contributionssScheduledForDeletion = null;
             }
         }
         if ($this->collContributionss !== null) {
             foreach ($this->collContributionss as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aworkType !== null) {
             if ($this->aworkType->isModified() || $this->aworkType->isNew()) {
                 $affectedRows += $this->aworkType->save($con);
             }
             $this->setworkType($this->aworkType);
         }
         if ($this->aprimaryArtist !== null) {
             if ($this->aprimaryArtist->isModified() || $this->aprimaryArtist->isNew()) {
                 $affectedRows += $this->aprimaryArtist->save($con);
             }
             $this->setprimaryArtist($this->aprimaryArtist);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->worksScheduledForDeletion !== null) {
             if (!$this->worksScheduledForDeletion->isEmpty()) {
                 \SpoilerWiki\WorkQuery::create()->filterByPrimaryKeys($this->worksScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->worksScheduledForDeletion = null;
             }
         }
         if ($this->collWorks !== null) {
             foreach ($this->collWorks as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->topicsScheduledForDeletion !== null) {
             if (!$this->topicsScheduledForDeletion->isEmpty()) {
                 \SpoilerWiki\TopicQuery::create()->filterByPrimaryKeys($this->topicsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->topicsScheduledForDeletion = null;
             }
         }
         if ($this->collTopics !== null) {
             foreach ($this->collTopics as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->assignedRolesScheduledForDeletion !== null) {
             if (!$this->assignedRolesScheduledForDeletion->isEmpty()) {
                 \SpoilerWiki\AssignedRoleQuery::create()->filterByPrimaryKeys($this->assignedRolesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->assignedRolesScheduledForDeletion = null;
             }
         }
         if ($this->collAssignedRoles !== null) {
             foreach ($this->collAssignedRoles as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->galleriesScheduledForDeletion !== null) {
             if (!$this->galleriesScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->galleriesScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getId();
                     $entryPk[1] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \Models\ImageGalleryMapQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->galleriesScheduledForDeletion = null;
             }
         }
         if ($this->collGalleries) {
             foreach ($this->collGalleries as $gallery) {
                 if (!$gallery->isDeleted() && ($gallery->isNew() || $gallery->isModified())) {
                     $gallery->save($con);
                 }
             }
         }
         if ($this->usersScheduledForDeletion !== null) {
             if (!$this->usersScheduledForDeletion->isEmpty()) {
                 foreach ($this->usersScheduledForDeletion as $user) {
                     // need to save related object because we set the relation to null
                     $user->save($con);
                 }
                 $this->usersScheduledForDeletion = null;
             }
         }
         if ($this->collUsers !== null) {
             foreach ($this->collUsers as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->articlesScheduledForDeletion !== null) {
             if (!$this->articlesScheduledForDeletion->isEmpty()) {
                 foreach ($this->articlesScheduledForDeletion as $article) {
                     // need to save related object because we set the relation to null
                     $article->save($con);
                 }
                 $this->articlesScheduledForDeletion = null;
             }
         }
         if ($this->collArticles !== null) {
             foreach ($this->collArticles as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->imageGalleryMapsScheduledForDeletion !== null) {
             if (!$this->imageGalleryMapsScheduledForDeletion->isEmpty()) {
                 \Models\ImageGalleryMapQuery::create()->filterByPrimaryKeys($this->imageGalleryMapsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->imageGalleryMapsScheduledForDeletion = null;
             }
         }
         if ($this->collImageGalleryMaps !== null) {
             foreach ($this->collImageGalleryMaps as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aCustomerTitle !== null) {
             if ($this->aCustomerTitle->isModified() || $this->aCustomerTitle->isNew()) {
                 $affectedRows += $this->aCustomerTitle->save($con);
             }
             $this->setCustomerTitle($this->aCustomerTitle);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->couponsScheduledForDeletion !== null) {
             if (!$this->couponsScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->couponsScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 CouponCustomerCountQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->couponsScheduledForDeletion = null;
             }
             foreach ($this->getCoupons() as $coupon) {
                 if ($coupon->isModified()) {
                     $coupon->save($con);
                 }
             }
         } elseif ($this->collCoupons) {
             foreach ($this->collCoupons as $coupon) {
                 if ($coupon->isModified()) {
                     $coupon->save($con);
                 }
             }
         }
         if ($this->addressesScheduledForDeletion !== null) {
             if (!$this->addressesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\AddressQuery::create()->filterByPrimaryKeys($this->addressesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->addressesScheduledForDeletion = null;
             }
         }
         if ($this->collAddresses !== null) {
             foreach ($this->collAddresses as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->ordersScheduledForDeletion !== null) {
             if (!$this->ordersScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderQuery::create()->filterByPrimaryKeys($this->ordersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->ordersScheduledForDeletion = null;
             }
         }
         if ($this->collOrders !== null) {
             foreach ($this->collOrders as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->cartsScheduledForDeletion !== null) {
             if (!$this->cartsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CartQuery::create()->filterByPrimaryKeys($this->cartsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->cartsScheduledForDeletion = null;
             }
         }
         if ($this->collCarts !== null) {
             foreach ($this->collCarts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->couponCustomerCountsScheduledForDeletion !== null) {
             if (!$this->couponCustomerCountsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CouponCustomerCountQuery::create()->filterByPrimaryKeys($this->couponCustomerCountsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->couponCustomerCountsScheduledForDeletion = null;
             }
         }
         if ($this->collCouponCustomerCounts !== null) {
             foreach ($this->collCouponCustomerCounts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->customerVersionsScheduledForDeletion !== null) {
             if (!$this->customerVersionsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CustomerVersionQuery::create()->filterByPrimaryKeys($this->customerVersionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->customerVersionsScheduledForDeletion = null;
             }
         }
         if ($this->collCustomerVersions !== null) {
             foreach ($this->collCustomerVersions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aStartgroup !== null) {
             if ($this->aStartgroup->isModified() || $this->aStartgroup->isNew()) {
                 $affectedRows += $this->aStartgroup->save($con);
             }
             $this->setStartgroup($this->aStartgroup);
         }
         if ($this->aPerformanceTotalStatistic !== null) {
             if ($this->aPerformanceTotalStatistic->isModified() || $this->aPerformanceTotalStatistic->isNew()) {
                 $affectedRows += $this->aPerformanceTotalStatistic->save($con);
             }
             $this->setPerformanceTotalStatistic($this->aPerformanceTotalStatistic);
         }
         if ($this->aPerformanceExecutionStatistic !== null) {
             if ($this->aPerformanceExecutionStatistic->isModified() || $this->aPerformanceExecutionStatistic->isNew()) {
                 $affectedRows += $this->aPerformanceExecutionStatistic->save($con);
             }
             $this->setPerformanceExecutionStatistic($this->aPerformanceExecutionStatistic);
         }
         if ($this->aPerformanceChoreographyStatistic !== null) {
             if ($this->aPerformanceChoreographyStatistic->isModified() || $this->aPerformanceChoreographyStatistic->isNew()) {
                 $affectedRows += $this->aPerformanceChoreographyStatistic->save($con);
             }
             $this->setPerformanceChoreographyStatistic($this->aPerformanceChoreographyStatistic);
         }
         if ($this->aPerformanceMusicAndTimingStatistic !== null) {
             if ($this->aPerformanceMusicAndTimingStatistic->isModified() || $this->aPerformanceMusicAndTimingStatistic->isNew()) {
                 $affectedRows += $this->aPerformanceMusicAndTimingStatistic->save($con);
             }
             $this->setPerformanceMusicAndTimingStatistic($this->aPerformanceMusicAndTimingStatistic);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->scoresScheduledForDeletion !== null) {
             if (!$this->scoresScheduledForDeletion->isEmpty()) {
                 \iuf\junia\model\ScoreQuery::create()->filterByPrimaryKeys($this->scoresScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->scoresScheduledForDeletion = null;
             }
         }
         if ($this->collScores !== null) {
             foreach ($this->collScores as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->performanceScoresScheduledForDeletion !== null) {
             if (!$this->performanceScoresScheduledForDeletion->isEmpty()) {
                 \iuf\junia\model\PerformanceScoreQuery::create()->filterByPrimaryKeys($this->performanceScoresScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->performanceScoresScheduledForDeletion = null;
             }
         }
         if ($this->collPerformanceScores !== null) {
             foreach ($this->collPerformanceScores as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aOrder !== null) {
             if ($this->aOrder->isModified() || $this->aOrder->isNew()) {
                 $affectedRows += $this->aOrder->save($con);
             }
             $this->setOrder($this->aOrder);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->orderProductAttributeCombinationsScheduledForDeletion !== null) {
             if (!$this->orderProductAttributeCombinationsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderProductAttributeCombinationQuery::create()->filterByPrimaryKeys($this->orderProductAttributeCombinationsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->orderProductAttributeCombinationsScheduledForDeletion = null;
             }
         }
         if ($this->collOrderProductAttributeCombinations !== null) {
             foreach ($this->collOrderProductAttributeCombinations as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->orderProductTaxesScheduledForDeletion !== null) {
             if (!$this->orderProductTaxesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\OrderProductTaxQuery::create()->filterByPrimaryKeys($this->orderProductTaxesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->orderProductTaxesScheduledForDeletion = null;
             }
         }
         if ($this->collOrderProductTaxes !== null) {
             foreach ($this->collOrderProductTaxes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $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      ConnectionInterface $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(ConnectionInterface $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->aотображаемыетипытехникимтр !== null) {
             if ($this->aотображаемыетипытехникимтр->isModified() || $this->aотображаемыетипытехникимтр->isNew()) {
                 $affectedRows += $this->aотображаемыетипытехникимтр->save($con);
             }
             $this->setотображаемыетипытехникимтр($this->aотображаемыетипытехникимтр);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->�трsScheduledForDeletion !== null) {
             if (!$this->�трsScheduledForDeletion->isEmpty()) {
                 \мтрQuery::create()->filterByPrimaryKeys($this->�трsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->�трsScheduledForDeletion = null;
             }
         }
         if ($this->collмтрs !== null) {
             foreach ($this->collмтрs as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->profilesScheduledForDeletion !== null) {
             if (!$this->profilesScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->profilesScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($remotePk, $pk);
                 }
                 ProfileResourceQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->profilesScheduledForDeletion = null;
             }
             foreach ($this->getProfiles() as $profile) {
                 if ($profile->isModified()) {
                     $profile->save($con);
                 }
             }
         } elseif ($this->collProfiles) {
             foreach ($this->collProfiles as $profile) {
                 if ($profile->isModified()) {
                     $profile->save($con);
                 }
             }
         }
         if ($this->profileResourcesScheduledForDeletion !== null) {
             if (!$this->profileResourcesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProfileResourceQuery::create()->filterByPrimaryKeys($this->profileResourcesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->profileResourcesScheduledForDeletion = null;
             }
         }
         if ($this->collProfileResources !== null) {
             foreach ($this->collProfileResources as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->resourceI18nsScheduledForDeletion !== null) {
             if (!$this->resourceI18nsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ResourceI18nQuery::create()->filterByPrimaryKeys($this->resourceI18nsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->resourceI18nsScheduledForDeletion = null;
             }
         }
         if ($this->collResourceI18ns !== null) {
             foreach ($this->collResourceI18ns as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aImage !== null) {
             if ($this->aImage->isModified() || $this->aImage->isNew()) {
                 $affectedRows += $this->aImage->save($con);
             }
             $this->setImage($this->aImage);
         }
         if ($this->aMember !== null) {
             if ($this->aMember->isModified() || $this->aMember->isNew()) {
                 $affectedRows += $this->aMember->save($con);
             }
             $this->setMember($this->aMember);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->articlesScheduledForDeletion !== null) {
             if (!$this->articlesScheduledForDeletion->isEmpty()) {
                 \Models\ArticleQuery::create()->filterByPrimaryKeys($this->articlesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->articlesScheduledForDeletion = null;
             }
         }
         if ($this->collArticles !== null) {
             foreach ($this->collArticles as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->commentsScheduledForDeletion !== null) {
             if (!$this->commentsScheduledForDeletion->isEmpty()) {
                 \Models\CommentQuery::create()->filterByPrimaryKeys($this->commentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->commentsScheduledForDeletion = null;
             }
         }
         if ($this->collComments !== null) {
             foreach ($this->collComments as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->ratingsScheduledForDeletion !== null) {
             if (!$this->ratingsScheduledForDeletion->isEmpty()) {
                 \Models\RatingQuery::create()->filterByPrimaryKeys($this->ratingsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->ratingsScheduledForDeletion = null;
             }
         }
         if ($this->collRatings !== null) {
             foreach ($this->collRatings as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userReportsRelatedByIdUserScheduledForDeletion !== null) {
             if (!$this->userReportsRelatedByIdUserScheduledForDeletion->isEmpty()) {
                 \Models\UserReportQuery::create()->filterByPrimaryKeys($this->userReportsRelatedByIdUserScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userReportsRelatedByIdUserScheduledForDeletion = null;
             }
         }
         if ($this->collUserReportsRelatedByIdUser !== null) {
             foreach ($this->collUserReportsRelatedByIdUser as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userReportsRelatedByIdUserReportedScheduledForDeletion !== null) {
             if (!$this->userReportsRelatedByIdUserReportedScheduledForDeletion->isEmpty()) {
                 \Models\UserReportQuery::create()->filterByPrimaryKeys($this->userReportsRelatedByIdUserReportedScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userReportsRelatedByIdUserReportedScheduledForDeletion = null;
             }
         }
         if ($this->collUserReportsRelatedByIdUserReported !== null) {
             foreach ($this->collUserReportsRelatedByIdUserReported as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->bugReportsScheduledForDeletion !== null) {
             if (!$this->bugReportsScheduledForDeletion->isEmpty()) {
                 \Models\BugReportQuery::create()->filterByPrimaryKeys($this->bugReportsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->bugReportsScheduledForDeletion = null;
             }
         }
         if ($this->collBugReports !== null) {
             foreach ($this->collBugReports as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->ideasRelatedByIdUserScheduledForDeletion !== null) {
             if (!$this->ideasRelatedByIdUserScheduledForDeletion->isEmpty()) {
                 \Models\IdeaQuery::create()->filterByPrimaryKeys($this->ideasRelatedByIdUserScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->ideasRelatedByIdUserScheduledForDeletion = null;
             }
         }
         if ($this->collIdeasRelatedByIdUser !== null) {
             foreach ($this->collIdeasRelatedByIdUser as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->ideasRelatedByApprovedByScheduledForDeletion !== null) {
             if (!$this->ideasRelatedByApprovedByScheduledForDeletion->isEmpty()) {
                 foreach ($this->ideasRelatedByApprovedByScheduledForDeletion as $ideaRelatedByApprovedBy) {
                     // need to save related object because we set the relation to null
                     $ideaRelatedByApprovedBy->save($con);
                 }
                 $this->ideasRelatedByApprovedByScheduledForDeletion = null;
             }
         }
         if ($this->collIdeasRelatedByApprovedBy !== null) {
             foreach ($this->collIdeasRelatedByApprovedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->membershipApplicationsScheduledForDeletion !== null) {
             if (!$this->membershipApplicationsScheduledForDeletion->isEmpty()) {
                 \Models\MembershipApplicationQuery::create()->filterByPrimaryKeys($this->membershipApplicationsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->membershipApplicationsScheduledForDeletion = null;
             }
         }
         if ($this->collMembershipApplications !== null) {
             foreach ($this->collMembershipApplications as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->galleriesScheduledForDeletion !== null) {
             if (!$this->galleriesScheduledForDeletion->isEmpty()) {
                 foreach ($this->galleriesScheduledForDeletion as $gallery) {
                     // need to save related object because we set the relation to null
                     $gallery->save($con);
                 }
                 $this->galleriesScheduledForDeletion = null;
             }
         }
         if ($this->collGalleries !== null) {
             foreach ($this->collGalleries as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->bansRelatedByIdUserScheduledForDeletion !== null) {
             if (!$this->bansRelatedByIdUserScheduledForDeletion->isEmpty()) {
                 \Models\BanQuery::create()->filterByPrimaryKeys($this->bansRelatedByIdUserScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->bansRelatedByIdUserScheduledForDeletion = null;
             }
         }
         if ($this->collBansRelatedByIdUser !== null) {
             foreach ($this->collBansRelatedByIdUser as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->bansRelatedByBannedByScheduledForDeletion !== null) {
             if (!$this->bansRelatedByBannedByScheduledForDeletion->isEmpty()) {
                 \Models\BanQuery::create()->filterByPrimaryKeys($this->bansRelatedByBannedByScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->bansRelatedByBannedByScheduledForDeletion = null;
             }
         }
         if ($this->collBansRelatedByBannedBy !== null) {
             foreach ($this->collBansRelatedByBannedBy as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aOwner !== null) {
             if ($this->aOwner->isModified() || $this->aOwner->isNew()) {
                 $affectedRows += $this->aOwner->save($con);
             }
             $this->setOwner($this->aOwner);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->usersScheduledForDeletion !== null) {
             if (!$this->usersScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->usersScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[1] = $this->getId();
                     $entryPk[0] = $entry->getId();
                     $pks[] = $entryPk;
                 }
                 \Models\UserGroupQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->usersScheduledForDeletion = null;
             }
         }
         if ($this->collUsers) {
             foreach ($this->collUsers as $user) {
                 if (!$user->isDeleted() && ($user->isNew() || $user->isModified())) {
                     $user->save($con);
                 }
             }
         }
         if ($this->packPermissionsScheduledForDeletion !== null) {
             if (!$this->packPermissionsScheduledForDeletion->isEmpty()) {
                 \Models\PackPermissionQuery::create()->filterByPrimaryKeys($this->packPermissionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->packPermissionsScheduledForDeletion = null;
             }
         }
         if ($this->collPackPermissions !== null) {
             foreach ($this->collPackPermissions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->userGroupsScheduledForDeletion !== null) {
             if (!$this->userGroupsScheduledForDeletion->isEmpty()) {
                 \Models\UserGroupQuery::create()->filterByPrimaryKeys($this->userGroupsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->userGroupsScheduledForDeletion = null;
             }
         }
         if ($this->collUserGroups !== null) {
             foreach ($this->collUserGroups as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $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      ConnectionInterface $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(ConnectionInterface $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->aCategories !== null) {
             if ($this->aCategories->isModified() || $this->aCategories->isNew()) {
                 $affectedRows += $this->aCategories->save($con);
             }
             $this->setCategories($this->aCategories);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->itemssScheduledForDeletion !== null) {
             if (!$this->itemssScheduledForDeletion->isEmpty()) {
                 foreach ($this->itemssScheduledForDeletion as $items) {
                     // need to save related object because we set the relation to null
                     $items->save($con);
                 }
                 $this->itemssScheduledForDeletion = null;
             }
         }
         if ($this->collItemss !== null) {
             foreach ($this->collItemss as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aCourse !== null) {
             if ($this->aCourse->isModified() || $this->aCourse->isNew()) {
                 $affectedRows += $this->aCourse->save($con);
             }
             $this->setCourse($this->aCourse);
         }
         if ($this->aSchoolYear !== null) {
             if ($this->aSchoolYear->isModified() || $this->aSchoolYear->isNew()) {
                 $affectedRows += $this->aSchoolYear->save($con);
             }
             $this->setSchoolYear($this->aSchoolYear);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->adminUsersScheduledForDeletion !== null) {
             if (!$this->adminUsersScheduledForDeletion->isEmpty()) {
                 \App\Models\AdminUserQuery::create()->filterByPrimaryKeys($this->adminUsersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->adminUsersScheduledForDeletion = null;
             }
         }
         if ($this->collAdminUsers !== null) {
             foreach ($this->collAdminUsers as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->applicationsScheduledForDeletion !== null) {
             if (!$this->applicationsScheduledForDeletion->isEmpty()) {
                 \App\Models\ApplicationQuery::create()->filterByPrimaryKeys($this->applicationsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->applicationsScheduledForDeletion = null;
             }
         }
         if ($this->collApplications !== null) {
             foreach ($this->collApplications as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $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      ConnectionInterface $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(ConnectionInterface $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->aInvGroups !== null) {
             if ($this->aInvGroups->isModified() || $this->aInvGroups->isNew()) {
                 $affectedRows += $this->aInvGroups->save($con);
             }
             $this->setInvGroups($this->aInvGroups);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->dgmEffectssScheduledForDeletion !== null) {
             if (!$this->dgmEffectssScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->dgmEffectssScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getTypeid();
                     $entryPk[1] = $entry->getEffectid();
                     $pks[] = $entryPk;
                 }
                 \EVE\DgmTypeEffectsQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->dgmEffectssScheduledForDeletion = null;
             }
         }
         if ($this->collDgmEffectss) {
             foreach ($this->collDgmEffectss as $dgmEffects) {
                 if (!$dgmEffects->isDeleted() && ($dgmEffects->isNew() || $dgmEffects->isModified())) {
                     $dgmEffects->save($con);
                 }
             }
         }
         if ($this->dgmAttributeTypessScheduledForDeletion !== null) {
             if (!$this->dgmAttributeTypessScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 foreach ($this->dgmAttributeTypessScheduledForDeletion as $entry) {
                     $entryPk = [];
                     $entryPk[0] = $this->getTypeid();
                     $entryPk[1] = $entry->getAttributeid();
                     $pks[] = $entryPk;
                 }
                 \EVE\DgmTypeAttributesQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->dgmAttributeTypessScheduledForDeletion = null;
             }
         }
         if ($this->collDgmAttributeTypess) {
             foreach ($this->collDgmAttributeTypess as $dgmAttributeTypes) {
                 if (!$dgmAttributeTypes->isDeleted() && ($dgmAttributeTypes->isNew() || $dgmAttributeTypes->isModified())) {
                     $dgmAttributeTypes->save($con);
                 }
             }
         }
         if ($this->singleInvMetaTypes !== null) {
             if (!$this->singleInvMetaTypes->isDeleted() && ($this->singleInvMetaTypes->isNew() || $this->singleInvMetaTypes->isModified())) {
                 $affectedRows += $this->singleInvMetaTypes->save($con);
             }
         }
         if ($this->dgmTypeEffectssScheduledForDeletion !== null) {
             if (!$this->dgmTypeEffectssScheduledForDeletion->isEmpty()) {
                 \EVE\DgmTypeEffectsQuery::create()->filterByPrimaryKeys($this->dgmTypeEffectssScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->dgmTypeEffectssScheduledForDeletion = null;
             }
         }
         if ($this->collDgmTypeEffectss !== null) {
             foreach ($this->collDgmTypeEffectss as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->dgmTypeAttributessScheduledForDeletion !== null) {
             if (!$this->dgmTypeAttributessScheduledForDeletion->isEmpty()) {
                 \EVE\DgmTypeAttributesQuery::create()->filterByPrimaryKeys($this->dgmTypeAttributessScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->dgmTypeAttributessScheduledForDeletion = null;
             }
         }
         if ($this->collDgmTypeAttributess !== null) {
             foreach ($this->collDgmTypeAttributess as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #27
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      ConnectionInterface $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(ConnectionInterface $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->aFileType !== null) {
             if ($this->aFileType->isModified() || $this->aFileType->isNew()) {
                 $affectedRows += $this->aFileType->save($con);
             }
             $this->setFileType($this->aFileType);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->categoriesScheduledForDeletion !== null) {
             if (!$this->categoriesScheduledForDeletion->isEmpty()) {
                 foreach ($this->categoriesScheduledForDeletion as $category) {
                     // need to save related object because we set the relation to null
                     $category->save($con);
                 }
                 $this->categoriesScheduledForDeletion = null;
             }
         }
         if ($this->collCategories !== null) {
             foreach ($this->collCategories as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->newsScheduledForDeletion !== null) {
             if (!$this->newsScheduledForDeletion->isEmpty()) {
                 foreach ($this->newsScheduledForDeletion as $news) {
                     // need to save related object because we set the relation to null
                     $news->save($con);
                 }
                 $this->newsScheduledForDeletion = null;
             }
         }
         if ($this->collNews !== null) {
             foreach ($this->collNews as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->periodicPlansScheduledForDeletion !== null) {
             if (!$this->periodicPlansScheduledForDeletion->isEmpty()) {
                 foreach ($this->periodicPlansScheduledForDeletion as $periodicPlan) {
                     // need to save related object because we set the relation to null
                     $periodicPlan->save($con);
                 }
                 $this->periodicPlansScheduledForDeletion = null;
             }
         }
         if ($this->collPeriodicPlans !== null) {
             foreach ($this->collPeriodicPlans as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productsScheduledForDeletion !== null) {
             if (!$this->productsScheduledForDeletion->isEmpty()) {
                 foreach ($this->productsScheduledForDeletion as $product) {
                     // need to save related object because we set the relation to null
                     $product->save($con);
                 }
                 $this->productsScheduledForDeletion = null;
             }
         }
         if ($this->collProducts !== null) {
             foreach ($this->collProducts as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->providersScheduledForDeletion !== null) {
             if (!$this->providersScheduledForDeletion->isEmpty()) {
                 foreach ($this->providersScheduledForDeletion as $provider) {
                     // need to save related object because we set the relation to null
                     $provider->save($con);
                 }
                 $this->providersScheduledForDeletion = null;
             }
         }
         if ($this->collProviders !== null) {
             foreach ($this->collProviders as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->resourceFilesScheduledForDeletion !== null) {
             if (!$this->resourceFilesScheduledForDeletion->isEmpty()) {
                 \App\Propel\ResourceFileQuery::create()->filterByPrimaryKeys($this->resourceFilesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->resourceFilesScheduledForDeletion = null;
             }
         }
         if ($this->collResourceFiles !== null) {
             foreach ($this->collResourceFiles as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->usersScheduledForDeletion !== null) {
             if (!$this->usersScheduledForDeletion->isEmpty()) {
                 foreach ($this->usersScheduledForDeletion as $user) {
                     // need to save related object because we set the relation to null
                     $user->save($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;
 }
Exemple #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      ConnectionInterface $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(ConnectionInterface $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->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->aCategory !== null) {
             if ($this->aCategory->isModified() || $this->aCategory->isNew()) {
                 $affectedRows += $this->aCategory->save($con);
             }
             $this->setCategory($this->aCategory);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
                 $affectedRows += 1;
             } else {
                 $affectedRows += $this->doUpdate($con);
             }
             $this->resetModified();
         }
         if ($this->subNotesScheduledForDeletion !== null) {
             if (!$this->subNotesScheduledForDeletion->isEmpty()) {
                 \Models\SubNoteQuery::create()->filterByPrimaryKeys($this->subNotesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->subNotesScheduledForDeletion = null;
             }
         }
         if ($this->collSubNotes !== null) {
             foreach ($this->collSubNotes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->filesScheduledForDeletion !== null) {
             if (!$this->filesScheduledForDeletion->isEmpty()) {
                 \Models\FileQuery::create()->filterByPrimaryKeys($this->filesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->filesScheduledForDeletion = null;
             }
         }
         if ($this->collFiles !== null) {
             foreach ($this->collFiles as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->notificationsScheduledForDeletion !== null) {
             if (!$this->notificationsScheduledForDeletion->isEmpty()) {
                 foreach ($this->notificationsScheduledForDeletion as $notification) {
                     // need to save related object because we set the relation to null
                     $notification->save($con);
                 }
                 $this->notificationsScheduledForDeletion = null;
             }
         }
         if ($this->collNotifications !== null) {
             foreach ($this->collNotifications as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->commentsScheduledForDeletion !== null) {
             if (!$this->commentsScheduledForDeletion->isEmpty()) {
                 \Models\CommentQuery::create()->filterByPrimaryKeys($this->commentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->commentsScheduledForDeletion = null;
             }
         }
         if ($this->collComments !== null) {
             foreach ($this->collComments as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->sharedsScheduledForDeletion !== null) {
             if (!$this->sharedsScheduledForDeletion->isEmpty()) {
                 foreach ($this->sharedsScheduledForDeletion as $shared) {
                     // need to save related object because we set the relation to null
                     $shared->save($con);
                 }
                 $this->sharedsScheduledForDeletion = null;
             }
         }
         if ($this->collShareds !== null) {
             foreach ($this->collShareds as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Exemple #29
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      ConnectionInterface $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(ConnectionInterface $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->foldersScheduledForDeletion !== null) {
             if (!$this->foldersScheduledForDeletion->isEmpty()) {
                 $pks = array();
                 $pk = $this->getPrimaryKey();
                 foreach ($this->foldersScheduledForDeletion->getPrimaryKeys(false) as $remotePk) {
                     $pks[] = array($pk, $remotePk);
                 }
                 ContentFolderQuery::create()->filterByPrimaryKeys($pks)->delete($con);
                 $this->foldersScheduledForDeletion = null;
             }
             foreach ($this->getFolders() as $folder) {
                 if ($folder->isModified()) {
                     $folder->save($con);
                 }
             }
         } elseif ($this->collFolders) {
             foreach ($this->collFolders as $folder) {
                 if ($folder->isModified()) {
                     $folder->save($con);
                 }
             }
         }
         if ($this->contentFoldersScheduledForDeletion !== null) {
             if (!$this->contentFoldersScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ContentFolderQuery::create()->filterByPrimaryKeys($this->contentFoldersScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentFoldersScheduledForDeletion = null;
             }
         }
         if ($this->collContentFolders !== null) {
             foreach ($this->collContentFolders as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentImagesScheduledForDeletion !== null) {
             if (!$this->contentImagesScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ContentImageQuery::create()->filterByPrimaryKeys($this->contentImagesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentImagesScheduledForDeletion = null;
             }
         }
         if ($this->collContentImages !== null) {
             foreach ($this->collContentImages as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentDocumentsScheduledForDeletion !== null) {
             if (!$this->contentDocumentsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ContentDocumentQuery::create()->filterByPrimaryKeys($this->contentDocumentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentDocumentsScheduledForDeletion = null;
             }
         }
         if ($this->collContentDocuments !== null) {
             foreach ($this->collContentDocuments as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->productAssociatedContentsScheduledForDeletion !== null) {
             if (!$this->productAssociatedContentsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ProductAssociatedContentQuery::create()->filterByPrimaryKeys($this->productAssociatedContentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->productAssociatedContentsScheduledForDeletion = null;
             }
         }
         if ($this->collProductAssociatedContents !== null) {
             foreach ($this->collProductAssociatedContents as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->categoryAssociatedContentsScheduledForDeletion !== null) {
             if (!$this->categoryAssociatedContentsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\CategoryAssociatedContentQuery::create()->filterByPrimaryKeys($this->categoryAssociatedContentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->categoryAssociatedContentsScheduledForDeletion = null;
             }
         }
         if ($this->collCategoryAssociatedContents !== null) {
             foreach ($this->collCategoryAssociatedContents as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentI18nsScheduledForDeletion !== null) {
             if (!$this->contentI18nsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ContentI18nQuery::create()->filterByPrimaryKeys($this->contentI18nsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentI18nsScheduledForDeletion = null;
             }
         }
         if ($this->collContentI18ns !== null) {
             foreach ($this->collContentI18ns as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentVersionsScheduledForDeletion !== null) {
             if (!$this->contentVersionsScheduledForDeletion->isEmpty()) {
                 \Thelia\Model\ContentVersionQuery::create()->filterByPrimaryKeys($this->contentVersionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentVersionsScheduledForDeletion = null;
             }
         }
         if ($this->collContentVersions !== null) {
             foreach ($this->collContentVersions as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $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      ConnectionInterface $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(ConnectionInterface $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->aInseeGeoDepartment !== null) {
             if ($this->aInseeGeoDepartment->isModified() || $this->aInseeGeoDepartment->isNew()) {
                 $affectedRows += $this->aInseeGeoDepartment->save($con);
             }
             $this->setInseeGeoDepartment($this->aInseeGeoDepartment);
         }
         if ($this->aInseeGeoRegion !== null) {
             if ($this->aInseeGeoRegion->isModified() || $this->aInseeGeoRegion->isNew()) {
                 $affectedRows += $this->aInseeGeoRegion->save($con);
             }
             $this->setInseeGeoRegion($this->aInseeGeoRegion);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->inseeGeoMunicipalityI18nsScheduledForDeletion !== null) {
             if (!$this->inseeGeoMunicipalityI18nsScheduledForDeletion->isEmpty()) {
                 \INSEEGeo\Model\InseeGeoMunicipalityI18nQuery::create()->filterByPrimaryKeys($this->inseeGeoMunicipalityI18nsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->inseeGeoMunicipalityI18nsScheduledForDeletion = null;
             }
         }
         if ($this->collInseeGeoMunicipalityI18ns !== null) {
             foreach ($this->collInseeGeoMunicipalityI18ns as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }