本文整理汇总了PHP中Propel\Runtime\Collection\ObjectCollection::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectCollection::isEmpty方法的具体用法?PHP ObjectCollection::isEmpty怎么用?PHP ObjectCollection::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Runtime\Collection\ObjectCollection
的用法示例。
在下文中一共展示了ObjectCollection::isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例2: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例3: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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);
}
//.........这里部分代码省略.........
示例4: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例5: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例6: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例7: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例8: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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) {
//.........这里部分代码省略.........
示例9: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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);
}
}
}
//.........这里部分代码省略.........
示例10: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例11: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例12: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例13: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}
示例14: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
//.........这里部分代码省略.........
示例15: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param 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;
}