当前位置: 首页>>代码示例>>PHP>>正文


PHP Empleado::isNew方法代码示例

本文整理汇总了PHP中Empleado::isNew方法的典型用法代码示例。如果您正苦于以下问题:PHP Empleado::isNew方法的具体用法?PHP Empleado::isNew怎么用?PHP Empleado::isNew使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Empleado的用法示例。


在下文中一共展示了Empleado::isNew方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aEmpleado !== null) {
             if ($this->aEmpleado->isModified() || $this->aEmpleado->isNew()) {
                 $affectedRows += $this->aEmpleado->save($con);
             }
             $this->setEmpleado($this->aEmpleado);
         }
         if ($this->aExpediente !== null) {
             if ($this->aExpediente->isModified() || $this->aExpediente->isNew()) {
                 $affectedRows += $this->aExpediente->save($con);
             }
             $this->setExpediente($this->aExpediente);
         }
         if ($this->aGastofacturacion !== null) {
             if ($this->aGastofacturacion->isModified() || $this->aGastofacturacion->isNew()) {
                 $affectedRows += $this->aGastofacturacion->save($con);
             }
             $this->setGastofacturacion($this->aGastofacturacion);
         }
         if ($this->aProveedoritrade !== null) {
             if ($this->aProveedoritrade->isModified() || $this->aProveedoritrade->isNew()) {
                 $affectedRows += $this->aProveedoritrade->save($con);
             }
             $this->setProveedoritrade($this->aProveedoritrade);
         }
         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;
 }
开发者ID:vicbaporu,项目名称:ITRADE,代码行数:59,代码来源:BaseExpedientegasto.php

示例2: doSave

 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aEmpleadoRelatedByIdempleadocomercial !== null) {
             if ($this->aEmpleadoRelatedByIdempleadocomercial->isModified() || $this->aEmpleadoRelatedByIdempleadocomercial->isNew()) {
                 $affectedRows += $this->aEmpleadoRelatedByIdempleadocomercial->save($con);
             }
             $this->setEmpleadoRelatedByIdempleadocomercial($this->aEmpleadoRelatedByIdempleadocomercial);
         }
         if ($this->aEmpleadoRelatedByIdempleadooperaciones !== null) {
             if ($this->aEmpleadoRelatedByIdempleadooperaciones->isModified() || $this->aEmpleadoRelatedByIdempleadooperaciones->isNew()) {
                 $affectedRows += $this->aEmpleadoRelatedByIdempleadooperaciones->save($con);
             }
             $this->setEmpleadoRelatedByIdempleadooperaciones($this->aEmpleadoRelatedByIdempleadooperaciones);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->clientearchivosScheduledForDeletion !== null) {
             if (!$this->clientearchivosScheduledForDeletion->isEmpty()) {
                 ClientearchivoQuery::create()->filterByPrimaryKeys($this->clientearchivosScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->clientearchivosScheduledForDeletion = null;
             }
         }
         if ($this->collClientearchivos !== null) {
             foreach ($this->collClientearchivos as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->expedientesScheduledForDeletion !== null) {
             if (!$this->expedientesScheduledForDeletion->isEmpty()) {
                 ExpedienteQuery::create()->filterByPrimaryKeys($this->expedientesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->expedientesScheduledForDeletion = null;
             }
         }
         if ($this->collExpedientes !== null) {
             foreach ($this->collExpedientes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->proveedorclientesScheduledForDeletion !== null) {
             if (!$this->proveedorclientesScheduledForDeletion->isEmpty()) {
                 ProveedorclienteQuery::create()->filterByPrimaryKeys($this->proveedorclientesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->proveedorclientesScheduledForDeletion = null;
             }
         }
         if ($this->collProveedorclientes !== null) {
             foreach ($this->collProveedorclientes as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
开发者ID:vicbaporu,项目名称:ITRADE,代码行数:86,代码来源:BaseCliente.php


注:本文中的Empleado::isNew方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。