本文整理汇总了PHP中sfGuardUser::isModified方法的典型用法代码示例。如果您正苦于以下问题:PHP sfGuardUser::isModified方法的具体用法?PHP sfGuardUser::isModified怎么用?PHP sfGuardUser::isModified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfGuardUser
的用法示例。
在下文中一共展示了sfGuardUser::isModified方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->asfGuardUser !== null) {
if ($this->asfGuardUser->isModified() || $this->asfGuardUser->isNew()) {
$affectedRows += $this->asfGuardUser->save($con);
}
$this->setsfGuardUser($this->asfGuardUser);
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = sfGuardRememberKeyPeer::doInsert($this, $con);
$affectedRows += 1;
// we are assuming that there is only 1 row per doInsert() which
// should always be true here (even though technically
// BasePeer::doInsert() can insert multiple rows).
$this->setNew(false);
} else {
$affectedRows += sfGuardRememberKeyPeer::doUpdate($this, $con);
}
$this->resetModified();
// [HL] After being saved an object is no longer 'modified'
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
示例2: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->asfGuardUser !== null) {
if ($this->asfGuardUser->isModified() || $this->asfGuardUser->isNew()) {
$affectedRows += $this->asfGuardUser->save($con);
}
$this->setsfGuardUser($this->asfGuardUser);
}
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
$this->doInsert($con);
} else {
$this->doUpdate($con);
}
$affectedRows += 1;
$this->resetModified();
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
示例3: doSave
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->asfGuardUser !== null) {
if ($this->asfGuardUser->isModified() || $this->asfGuardUser->isNew()) {
$affectedRows += $this->asfGuardUser->save($con);
}
$this->setsfGuardUser($this->asfGuardUser);
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$criteria = $this->buildCriteria();
$pk = BasePeer::doInsert($criteria, $con);
$affectedRows += 1;
$this->setNew(false);
} else {
$affectedRows += sfGuardRememberKeyPeer::doUpdate($this, $con);
}
$this->resetModified();
// [HL] After being saved an object is no longer 'modified'
}
$this->alreadyInSave = false;
}
return $affectedRows;
}
示例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 PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->asfGuardUser !== null) {
if ($this->asfGuardUser->isModified() || $this->asfGuardUser->isNew()) {
$affectedRows += $this->asfGuardUser->save($con);
}
$this->setsfGuardUser($this->asfGuardUser);
}
if ($this->aPartidoRelatedByPartidoVideo1Id !== null) {
if ($this->aPartidoRelatedByPartidoVideo1Id->isModified() || $this->aPartidoRelatedByPartidoVideo1Id->isNew()) {
$affectedRows += $this->aPartidoRelatedByPartidoVideo1Id->save($con);
}
$this->setPartidoRelatedByPartidoVideo1Id($this->aPartidoRelatedByPartidoVideo1Id);
}
if ($this->aPartidoRelatedByPartidoVideo2Id !== null) {
if ($this->aPartidoRelatedByPartidoVideo2Id->isModified() || $this->aPartidoRelatedByPartidoVideo2Id->isNew()) {
$affectedRows += $this->aPartidoRelatedByPartidoVideo2Id->save($con);
}
$this->setPartidoRelatedByPartidoVideo2Id($this->aPartidoRelatedByPartidoVideo2Id);
}
if ($this->isNew()) {
$this->modifiedColumns[] = PropuestaPeer::ID;
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$pk = PropuestaPeer::doInsert($this, $con);
$affectedRows += 1;
// we are assuming that there is only 1 row per doInsert() which
// should always be true here (even though technically
// BasePeer::doInsert() can insert multiple rows).
$this->setId($pk);
//[IMV] update autoincrement primary key
$this->setNew(false);
} else {
$affectedRows += PropuestaPeer::doUpdate($this, $con);
}
$this->resetModified();
// [HL] After being saved an object is no longer 'modified'
}
if ($this->collEnlaces !== null) {
foreach ($this->collEnlaces as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->collEtiquetaPropuestas !== null) {
foreach ($this->collEtiquetaPropuestas as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$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 PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aRepository !== null) {
if ($this->aRepository->isModified() || $this->aRepository->isNew()) {
$affectedRows += $this->aRepository->save($con);
}
$this->setRepository($this->aRepository);
}
if ($this->asfGuardUser !== null) {
if ($this->asfGuardUser->isModified() || $this->asfGuardUser->isNew()) {
$affectedRows += $this->asfGuardUser->save($con);
}
$this->setsfGuardUser($this->asfGuardUser);
}
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
$this->doInsert($con);
} else {
$this->doUpdate($con);
}
$affectedRows += 1;
$this->resetModified();
}
if ($this->commentsScheduledForDeletion !== null) {
if (!$this->commentsScheduledForDeletion->isEmpty()) {
CommentQuery::create()->filterByPrimaryKeys($this->commentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
$this->commentsScheduledForDeletion = null;
}
}
if ($this->collComments !== null) {
foreach ($this->collComments as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->filesScheduledForDeletion !== null) {
if (!$this->filesScheduledForDeletion->isEmpty()) {
FileQuery::create()->filterByPrimaryKeys($this->filesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
$this->filesScheduledForDeletion = null;
}
}
if ($this->collFiles !== null) {
foreach ($this->collFiles as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->statusActionsScheduledForDeletion !== null) {
if (!$this->statusActionsScheduledForDeletion->isEmpty()) {
StatusActionQuery::create()->filterByPrimaryKeys($this->statusActionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
$this->statusActionsScheduledForDeletion = null;
}
}
if ($this->collStatusActions !== null) {
foreach ($this->collStatusActions as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$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 PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0;
// initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aContact !== null) {
if ($this->aContact->isModified() || $this->aContact->isNew()) {
$affectedRows += $this->aContact->save($con);
}
$this->setContact($this->aContact);
}
if ($this->asfGuardUser !== null) {
if ($this->asfGuardUser->isModified() || $this->asfGuardUser->isNew()) {
$affectedRows += $this->asfGuardUser->save($con);
}
$this->setsfGuardUser($this->asfGuardUser);
}
if ($this->isNew() || $this->isModified()) {
// persist changes
if ($this->isNew()) {
$this->doInsert($con);
} else {
$this->doUpdate($con);
}
$affectedRows += 1;
$this->resetModified();
}
if ($this->sessionsScheduledForDeletion !== null) {
if (!$this->sessionsScheduledForDeletion->isEmpty()) {
foreach ($this->sessionsScheduledForDeletion as $session) {
// need to save related object because we set the relation to null
$session->save($con);
}
$this->sessionsScheduledForDeletion = null;
}
}
if ($this->collSessions !== null) {
foreach ($this->collSessions as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->singleSignOnKeysScheduledForDeletion !== null) {
if (!$this->singleSignOnKeysScheduledForDeletion->isEmpty()) {
SingleSignOnKeyQuery::create()->filterByPrimaryKeys($this->singleSignOnKeysScheduledForDeletion->getPrimaryKeys(false))->delete($con);
$this->singleSignOnKeysScheduledForDeletion = null;
}
}
if ($this->collSingleSignOnKeys !== null) {
foreach ($this->collSingleSignOnKeys as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->systemEventSubscriptionsScheduledForDeletion !== null) {
if (!$this->systemEventSubscriptionsScheduledForDeletion->isEmpty()) {
SystemEventSubscriptionQuery::create()->filterByPrimaryKeys($this->systemEventSubscriptionsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
$this->systemEventSubscriptionsScheduledForDeletion = null;
}
}
if ($this->collSystemEventSubscriptions !== null) {
foreach ($this->collSystemEventSubscriptions as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->systemEventInstancesScheduledForDeletion !== null) {
if (!$this->systemEventInstancesScheduledForDeletion->isEmpty()) {
foreach ($this->systemEventInstancesScheduledForDeletion as $systemEventInstance) {
// need to save related object because we set the relation to null
$systemEventInstance->save($con);
}
$this->systemEventInstancesScheduledForDeletion = null;
}
}
if ($this->collSystemEventInstances !== null) {
foreach ($this->collSystemEventInstances as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
//.........这里部分代码省略.........