/**
  * 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;
 }
Exemplo n.º 2
0
 public function testGetPrimaryKeys()
 {
     $books = new ObjectCollection();
     $books->setModel('\\Propel\\Tests\\Bookstore\\Book');
     for ($i = 0; $i < 4; $i++) {
         $book = new Book();
         $book->setTitle('Title' . $i);
         $book->save($this->con);
         $books[] = $book;
     }
     $pks = $books->getPrimaryKeys();
     $this->assertEquals(4, count($pks));
     $keys = array('\\Propel\\Tests\\Bookstore\\Book_0', '\\Propel\\Tests\\Bookstore\\Book_1', '\\Propel\\Tests\\Bookstore\\Book_2', '\\Propel\\Tests\\Bookstore\\Book_3');
     $this->assertEquals($keys, array_keys($pks));
     $pks = $books->getPrimaryKeys(false);
     $keys = array(0, 1, 2, 3);
     $this->assertEquals($keys, array_keys($pks));
     foreach ($pks as $key => $value) {
         $this->assertEquals($books[$key]->getPrimaryKey(), $value);
     }
 }
Exemplo n.º 3
0
 /**
  * Filter the query by a related \App\Propel\User object
  *
  * @param \App\Propel\User|ObjectCollection $user the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildResourceQuery The current query, for fluid interface
  */
 public function filterByUser($user, $comparison = null)
 {
     if ($user instanceof \App\Propel\User) {
         return $this->addUsingAlias(ResourceTableMap::COL_RESOURCE_ID, $user->getResourceId(), $comparison);
     } elseif ($user instanceof ObjectCollection) {
         return $this->useUserQuery()->filterByPrimaryKeys($user->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByUser() only accepts arguments of type \\App\\Propel\\User or Collection');
     }
 }
 /**
  * Filter the query by a related \App\Models\TranslationKeyword object
  *
  * @param \App\Models\TranslationKeyword|ObjectCollection $translationKeyword the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildTranslationCatalogQuery The current query, for fluid interface
  */
 public function filterByTranslationKeyword($translationKeyword, $comparison = null)
 {
     if ($translationKeyword instanceof \App\Models\TranslationKeyword) {
         return $this->addUsingAlias(TranslationCatalogTableMap::COL_ID, $translationKeyword->getCatalogId(), $comparison);
     } elseif ($translationKeyword instanceof ObjectCollection) {
         return $this->useTranslationKeywordQuery()->filterByPrimaryKeys($translationKeyword->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByTranslationKeyword() only accepts arguments of type \\App\\Models\\TranslationKeyword or Collection');
     }
 }
Exemplo n.º 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;
         // 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;
 }
Exemplo n.º 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;
         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;
 }
Exemplo n.º 7
0
 /**
  * Filter the query by a related \ORM\DebitPayment object
  *
  * @param \ORM\DebitPayment|ObjectCollection $debitPayment  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildDebitQuery The current query, for fluid interface
  */
 public function filterByPayment($debitPayment, $comparison = null)
 {
     if ($debitPayment instanceof \ORM\DebitPayment) {
         return $this->addUsingAlias(DebitTableMap::COL_ID, $debitPayment->getDebitId(), $comparison);
     } elseif ($debitPayment instanceof ObjectCollection) {
         return $this->usePaymentQuery()->filterByPrimaryKeys($debitPayment->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPayment() only accepts arguments of type \\ORM\\DebitPayment or Collection');
     }
 }
Exemplo n.º 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->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;
 }
Exemplo n.º 9
0
 /**
  * Filter the query by a related \UserAttributeValues object
  *
  * @param \UserAttributeValues|ObjectCollection $userAttributeValues the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildUserAttributesQuery The current query, for fluid interface
  */
 public function filterByUserAttributeValues($userAttributeValues, $comparison = null)
 {
     if ($userAttributeValues instanceof \UserAttributeValues) {
         return $this->addUsingAlias(UserAttributesTableMap::COL_ID, $userAttributeValues->getUserAttributeId(), $comparison);
     } elseif ($userAttributeValues instanceof ObjectCollection) {
         return $this->useUserAttributeValuesQuery()->filterByPrimaryKeys($userAttributeValues->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByUserAttributeValues() only accepts arguments of type \\UserAttributeValues or Collection');
     }
 }
Exemplo n.º 10
0
 /**
  * Filter the query by a related \Data object
  *
  * @param \Data|ObjectCollection $data the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildContributionsQuery The current query, for fluid interface
  */
 public function filterByData($data, $comparison = null)
 {
     if ($data instanceof \Data) {
         return $this->addUsingAlias(ContributionsTableMap::COL_ID, $data->getForcontribution(), $comparison);
     } elseif ($data instanceof ObjectCollection) {
         return $this->useDataQuery()->filterByPrimaryKeys($data->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByData() only accepts arguments of type \\Data or Collection');
     }
 }
 /**
  * Filter the query by a related \SoColissimo\Model\SocolissimoPrice object
  *
  * @param \SoColissimo\Model\SocolissimoPrice|ObjectCollection $socolissimoPrice  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
  */
 public function filterBySocolissimoPrice($socolissimoPrice, $comparison = null)
 {
     if ($socolissimoPrice instanceof \SoColissimo\Model\SocolissimoPrice) {
         return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoPrice->getDeliveryModeId(), $comparison);
     } elseif ($socolissimoPrice instanceof ObjectCollection) {
         return $this->useSocolissimoPriceQuery()->filterByPrimaryKeys($socolissimoPrice->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySocolissimoPrice() only accepts arguments of type \\SoColissimo\\Model\\SocolissimoPrice or Collection');
     }
 }
 /**
  * Filter the query by a related \физическиеобъёмы object
  *
  * @param \физическиеобъёмы|ObjectCollection $�изическиеобъёмы the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildучасткиработQuery The current query, for fluid interface
  */
 public function filterByфизическиеобъёмы($�изическиеобъёмы, $comparison = null)
 {
     if ($�изическиеобъёмы instanceof \физическиеобъёмы) {
         return $this->addUsingAlias(участкиработTableMap::COL_ID, $�изическиеобъёмы->getучастокработ(), $comparison);
     } elseif ($�изическиеобъёмы instanceof ObjectCollection) {
         return $this->useфизическиеобъёмыQuery()->filterByPrimaryKeys($�изическиеобъёмы->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByфизическиеобъёмы() only accepts arguments of type \\физическиеобъёмы or Collection');
     }
 }
 /**
  * Filter the query by a related \App\Models\AdminCredential object
  *
  * @param \App\Models\AdminCredential|ObjectCollection $adminCredential the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildAdminCredentialGroupQuery The current query, for fluid interface
  */
 public function filterByAdminCredential($adminCredential, $comparison = null)
 {
     if ($adminCredential instanceof \App\Models\AdminCredential) {
         return $this->addUsingAlias(AdminCredentialGroupTableMap::COL_ID, $adminCredential->getGroupId(), $comparison);
     } elseif ($adminCredential instanceof ObjectCollection) {
         return $this->useAdminCredentialQuery()->filterByPrimaryKeys($adminCredential->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByAdminCredential() only accepts arguments of type \\App\\Models\\AdminCredential or Collection');
     }
 }
Exemplo n.º 14
0
 /**
  * Filter the query by a related \Model\Order object
  *
  * @param \Model\Order|ObjectCollection $order the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildTruckQuery The current query, for fluid interface
  */
 public function filterByOrder($order, $comparison = null)
 {
     if ($order instanceof \Model\Order) {
         return $this->addUsingAlias(TruckTableMap::COL_ID, $order->getTruckId(), $comparison);
     } elseif ($order instanceof ObjectCollection) {
         return $this->useOrderQuery()->filterByPrimaryKeys($order->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByOrder() only accepts arguments of type \\Model\\Order or Collection');
     }
 }
Exemplo n.º 15
0
 /**
  * Filter the query by a related \Issues object
  *
  * @param \Issues|ObjectCollection $issues the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildBooksQuery The current query, for fluid interface
  */
 public function filterByIssues($issues, $comparison = null)
 {
     if ($issues instanceof \Issues) {
         return $this->addUsingAlias(BooksTableMap::COL_ID, $issues->getForbook(), $comparison);
     } elseif ($issues instanceof ObjectCollection) {
         return $this->useIssuesQuery()->filterByPrimaryKeys($issues->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByIssues() only accepts arguments of type \\Issues or Collection');
     }
 }
Exemplo n.º 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;
         // 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;
 }
Exemplo n.º 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;
         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;
 }
Exemplo n.º 18
0
 /**
  * Filter the query by a related \Players object
  *
  * @param \Players|ObjectCollection $players the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildPositionRefQuery The current query, for fluid interface
  */
 public function filterByPlayers($players, $comparison = null)
 {
     if ($players instanceof \Players) {
         return $this->addUsingAlias(PositionRefTableMap::COL_POSITION, $players->getPosition(), $comparison);
     } elseif ($players instanceof ObjectCollection) {
         return $this->usePlayersQuery()->filterByPrimaryKeys($players->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPlayers() only accepts arguments of type \\Players or Collection');
     }
 }
Exemplo n.º 19
0
 /**
  * Filter the query by a related \Thelia\Model\OrderCouponModule object
  *
  * @param \Thelia\Model\OrderCouponModule|ObjectCollection $orderCouponModule  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildOrderCouponQuery The current query, for fluid interface
  */
 public function filterByOrderCouponModule($orderCouponModule, $comparison = null)
 {
     if ($orderCouponModule instanceof \Thelia\Model\OrderCouponModule) {
         return $this->addUsingAlias(OrderCouponTableMap::ID, $orderCouponModule->getCouponId(), $comparison);
     } elseif ($orderCouponModule instanceof ObjectCollection) {
         return $this->useOrderCouponModuleQuery()->filterByPrimaryKeys($orderCouponModule->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByOrderCouponModule() only accepts arguments of type \\Thelia\\Model\\OrderCouponModule or Collection');
     }
 }
Exemplo n.º 20
0
 /**
  * Filter the query by a related \gossi\trixionary\model\Skill object
  *
  * @param \gossi\trixionary\model\Skill|ObjectCollection $skill the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildFunctionPhaseQuery The current query, for fluid interface
  */
 public function filterByRootSkill($skill, $comparison = null)
 {
     if ($skill instanceof \gossi\trixionary\model\Skill) {
         return $this->addUsingAlias(FunctionPhaseTableMap::COL_ID, $skill->getFunctionPhaseId(), $comparison);
     } elseif ($skill instanceof ObjectCollection) {
         return $this->useRootSkillQuery()->filterByPrimaryKeys($skill->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByRootSkill() only accepts arguments of type \\gossi\\trixionary\\model\\Skill or Collection');
     }
 }
Exemplo n.º 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;
         // 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;
 }
Exemplo n.º 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->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;
 }
Exemplo n.º 23
0
 /**
  * Filter the query by a related \INSEEGeo\Model\InseeGeoDepartmentI18n object
  *
  * @param \INSEEGeo\Model\InseeGeoDepartmentI18n|ObjectCollection $inseeGeoDepartmentI18n  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildInseeGeoDepartmentQuery The current query, for fluid interface
  */
 public function filterByInseeGeoDepartmentI18n($inseeGeoDepartmentI18n, $comparison = null)
 {
     if ($inseeGeoDepartmentI18n instanceof \INSEEGeo\Model\InseeGeoDepartmentI18n) {
         return $this->addUsingAlias(InseeGeoDepartmentTableMap::ID, $inseeGeoDepartmentI18n->getId(), $comparison);
     } elseif ($inseeGeoDepartmentI18n instanceof ObjectCollection) {
         return $this->useInseeGeoDepartmentI18nQuery()->filterByPrimaryKeys($inseeGeoDepartmentI18n->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByInseeGeoDepartmentI18n() only accepts arguments of type \\INSEEGeo\\Model\\InseeGeoDepartmentI18n or Collection');
     }
 }
Exemplo n.º 24
0
 /**
  * Filter the query by a related \Thelia\Model\CategoryDocumentI18n object
  *
  * @param \Thelia\Model\CategoryDocumentI18n|ObjectCollection $categoryDocumentI18n  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildCategoryDocumentQuery The current query, for fluid interface
  */
 public function filterByCategoryDocumentI18n($categoryDocumentI18n, $comparison = null)
 {
     if ($categoryDocumentI18n instanceof \Thelia\Model\CategoryDocumentI18n) {
         return $this->addUsingAlias(CategoryDocumentTableMap::ID, $categoryDocumentI18n->getId(), $comparison);
     } elseif ($categoryDocumentI18n instanceof ObjectCollection) {
         return $this->useCategoryDocumentI18nQuery()->filterByPrimaryKeys($categoryDocumentI18n->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByCategoryDocumentI18n() only accepts arguments of type \\Thelia\\Model\\CategoryDocumentI18n or Collection');
     }
 }
Exemplo n.º 25
0
 /**
  * Filter the query by a related \iuf\junia\model\PerformanceScore object
  *
  * @param \iuf\junia\model\PerformanceScore|ObjectCollection $performanceScore the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildJudgeQuery The current query, for fluid interface
  */
 public function filterByPerformanceScore($performanceScore, $comparison = null)
 {
     if ($performanceScore instanceof \iuf\junia\model\PerformanceScore) {
         return $this->addUsingAlias(JudgeTableMap::COL_ID, $performanceScore->getJudgeId(), $comparison);
     } elseif ($performanceScore instanceof ObjectCollection) {
         return $this->usePerformanceScoreQuery()->filterByPrimaryKeys($performanceScore->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPerformanceScore() only accepts arguments of type \\iuf\\junia\\model\\PerformanceScore or Collection');
     }
 }
Exemplo n.º 26
0
 /**
  * Filter the query by a related \Haus23\Dtp\Model\Tip object
  *
  * @param \Haus23\Dtp\Model\Tip|ObjectCollection $tip  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildPlayerQuery The current query, for fluid interface
  */
 public function filterByTip($tip, $comparison = null)
 {
     if ($tip instanceof \Haus23\Dtp\Model\Tip) {
         return $this->addUsingAlias(PlayerTableMap::COL_ID, $tip->getPlayerId(), $comparison);
     } elseif ($tip instanceof ObjectCollection) {
         return $this->useTipQuery()->filterByPrimaryKeys($tip->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByTip() only accepts arguments of type \\Haus23\\Dtp\\Model\\Tip or Collection');
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 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->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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 30
0
 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param      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;
 }