/**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = GalleryImageSizePeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . GalleryImageSizePeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(GalleryImageSizePeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::GALLERY_IMAGE_ID)) {
         $modifiedColumns[':p' . $index++] = '`gallery_image_id`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::LOCATION)) {
         $modifiedColumns[':p' . $index++] = '`location`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::WIDTH)) {
         $modifiedColumns[':p' . $index++] = '`width`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::HEIGHT)) {
         $modifiedColumns[':p' . $index++] = '`height`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::FILESIZE)) {
         $modifiedColumns[':p' . $index++] = '`filesize`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`created_at`';
     }
     if ($this->isColumnModified(GalleryImageSizePeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`updated_at`';
     }
     $sql = sprintf('INSERT INTO `gallery_image_size` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`gallery_image_id`':
                     $stmt->bindValue($identifier, $this->gallery_image_id, PDO::PARAM_INT);
                     break;
                 case '`location`':
                     $stmt->bindValue($identifier, $this->location, PDO::PARAM_STR);
                     break;
                 case '`width`':
                     $stmt->bindValue($identifier, $this->width, PDO::PARAM_INT);
                     break;
                 case '`height`':
                     $stmt->bindValue($identifier, $this->height, PDO::PARAM_INT);
                     break;
                 case '`filesize`':
                     $stmt->bindValue($identifier, $this->filesize, PDO::PARAM_INT);
                     break;
                 case '`created_at`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`updated_at`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = afWidgetHelpSettingsPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . afWidgetHelpSettingsPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::USER_ID)) {
         $modifiedColumns[':p' . $index++] = '`USER_ID`';
     }
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::WIDGET_HELP_IS_ENABLED)) {
         $modifiedColumns[':p' . $index++] = '`WIDGET_HELP_IS_ENABLED`';
     }
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::POPUP_HELP_IS_ENABLED)) {
         $modifiedColumns[':p' . $index++] = '`POPUP_HELP_IS_ENABLED`';
     }
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::HELP_TYPE)) {
         $modifiedColumns[':p' . $index++] = '`HELP_TYPE`';
     }
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
     }
     if ($this->isColumnModified(afWidgetHelpSettingsPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
     }
     $sql = sprintf('INSERT INTO `af_widget_help_settings` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`USER_ID`':
                     $stmt->bindValue($identifier, $this->user_id, PDO::PARAM_INT);
                     break;
                 case '`WIDGET_HELP_IS_ENABLED`':
                     $stmt->bindValue($identifier, (int) $this->widget_help_is_enabled, PDO::PARAM_INT);
                     break;
                 case '`POPUP_HELP_IS_ENABLED`':
                     $stmt->bindValue($identifier, (int) $this->popup_help_is_enabled, PDO::PARAM_INT);
                     break;
                 case '`HELP_TYPE`':
                     $stmt->bindValue($identifier, $this->help_type, PDO::PARAM_INT);
                     break;
                 case '`CREATED_AT`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`UPDATED_AT`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = ExpedientehistorialPeer::IDEXPEDIENTEHISTORIAL;
     if (null !== $this->idexpedientehistorial) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . ExpedientehistorialPeer::IDEXPEDIENTEHISTORIAL . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ExpedientehistorialPeer::IDEXPEDIENTEHISTORIAL)) {
         $modifiedColumns[':p' . $index++] = '`idexpedientehistorial`';
     }
     if ($this->isColumnModified(ExpedientehistorialPeer::IDEXPEDIENTESERVICIO)) {
         $modifiedColumns[':p' . $index++] = '`idexpedienteservicio`';
     }
     if ($this->isColumnModified(ExpedientehistorialPeer::IDESTADOSERVICIO)) {
         $modifiedColumns[':p' . $index++] = '`idestadoservicio`';
     }
     if ($this->isColumnModified(ExpedientehistorialPeer::EXPEDIENTEHISTORIAL_FECHA)) {
         $modifiedColumns[':p' . $index++] = '`expedientehistorial_fecha`';
     }
     if ($this->isColumnModified(ExpedientehistorialPeer::EXPEDIENTEHISTORIAL_NOTA)) {
         $modifiedColumns[':p' . $index++] = '`expedientehistorial_nota`';
     }
     $sql = sprintf('INSERT INTO `expedientehistorial` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`idexpedientehistorial`':
                     $stmt->bindValue($identifier, $this->idexpedientehistorial, PDO::PARAM_INT);
                     break;
                 case '`idexpedienteservicio`':
                     $stmt->bindValue($identifier, $this->idexpedienteservicio, PDO::PARAM_INT);
                     break;
                 case '`idestadoservicio`':
                     $stmt->bindValue($identifier, $this->idestadoservicio, PDO::PARAM_INT);
                     break;
                 case '`expedientehistorial_fecha`':
                     $stmt->bindValue($identifier, $this->expedientehistorial_fecha, PDO::PARAM_STR);
                     break;
                 case '`expedientehistorial_nota`':
                     $stmt->bindValue($identifier, $this->expedientehistorial_nota, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdexpedientehistorial($pk);
     $this->setNew(false);
 }
Example #4
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = ClientePeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . ClientePeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ClientePeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(ClientePeer::NOMBRE)) {
         $modifiedColumns[':p' . $index++] = '`NOMBRE`';
     }
     if ($this->isColumnModified(ClientePeer::CORREO)) {
         $modifiedColumns[':p' . $index++] = '`CORREO`';
     }
     if ($this->isColumnModified(ClientePeer::DIRECCION)) {
         $modifiedColumns[':p' . $index++] = '`DIRECCION`';
     }
     if ($this->isColumnModified(ClientePeer::TELEFONO)) {
         $modifiedColumns[':p' . $index++] = '`TELEFONO`';
     }
     if ($this->isColumnModified(ClientePeer::CIUDAD)) {
         $modifiedColumns[':p' . $index++] = '`CIUDAD`';
     }
     if ($this->isColumnModified(ClientePeer::OBSERVACION)) {
         $modifiedColumns[':p' . $index++] = '`OBSERVACION`';
     }
     if ($this->isColumnModified(ClientePeer::PUNTOS)) {
         $modifiedColumns[':p' . $index++] = '`PUNTOS`';
     }
     if ($this->isColumnModified(ClientePeer::NIT)) {
         $modifiedColumns[':p' . $index++] = '`NIT`';
     }
     $sql = sprintf('INSERT INTO `cliente` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`NOMBRE`':
                     $stmt->bindValue($identifier, $this->nombre, PDO::PARAM_STR);
                     break;
                 case '`CORREO`':
                     $stmt->bindValue($identifier, $this->correo, PDO::PARAM_STR);
                     break;
                 case '`DIRECCION`':
                     $stmt->bindValue($identifier, $this->direccion, PDO::PARAM_STR);
                     break;
                 case '`TELEFONO`':
                     $stmt->bindValue($identifier, $this->telefono, PDO::PARAM_STR);
                     break;
                 case '`CIUDAD`':
                     $stmt->bindValue($identifier, $this->ciudad, PDO::PARAM_STR);
                     break;
                 case '`OBSERVACION`':
                     $stmt->bindValue($identifier, $this->observacion, PDO::PARAM_STR);
                     break;
                 case '`PUNTOS`':
                     $stmt->bindValue($identifier, $this->puntos, PDO::PARAM_INT);
                     break;
                 case '`NIT`':
                     $stmt->bindValue($identifier, $this->nit, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #5
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = PlayerPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . PlayerPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(PlayerPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(PlayerPeer::LAST_NAME)) {
         $modifiedColumns[':p' . $index++] = '`last_name`';
     }
     if ($this->isColumnModified(PlayerPeer::FIRST_NAME)) {
         $modifiedColumns[':p' . $index++] = '`first_name`';
     }
     if ($this->isColumnModified(PlayerPeer::PHOTO)) {
         $modifiedColumns[':p' . $index++] = '`photo`';
     }
     if ($this->isColumnModified(PlayerPeer::PHONE)) {
         $modifiedColumns[':p' . $index++] = '`phone`';
     }
     if ($this->isColumnModified(PlayerPeer::MOBILE)) {
         $modifiedColumns[':p' . $index++] = '`mobile`';
     }
     if ($this->isColumnModified(PlayerPeer::NOTE)) {
         $modifiedColumns[':p' . $index++] = '`note`';
     }
     $sql = sprintf('INSERT INTO `player` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`last_name`':
                     $stmt->bindValue($identifier, $this->last_name, PDO::PARAM_STR);
                     break;
                 case '`first_name`':
                     $stmt->bindValue($identifier, $this->first_name, PDO::PARAM_STR);
                     break;
                 case '`photo`':
                     $stmt->bindValue($identifier, $this->photo, PDO::PARAM_STR);
                     break;
                 case '`phone`':
                     $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR);
                     break;
                 case '`mobile`':
                     $stmt->bindValue($identifier, $this->mobile, PDO::PARAM_STR);
                     break;
                 case '`note`':
                     $stmt->bindValue($identifier, $this->note, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = NewsletterPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . NewsletterPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(NewsletterPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(NewsletterPeer::SUBJECT)) {
         $modifiedColumns[':p' . $index++] = '`subject`';
     }
     if ($this->isColumnModified(NewsletterPeer::NEWSLETTER_BODY)) {
         $modifiedColumns[':p' . $index++] = '`newsletter_body`';
     }
     if ($this->isColumnModified(NewsletterPeer::LANGUAGE_ID)) {
         $modifiedColumns[':p' . $index++] = '`language_id`';
     }
     if ($this->isColumnModified(NewsletterPeer::IS_APPROVED)) {
         $modifiedColumns[':p' . $index++] = '`is_approved`';
     }
     if ($this->isColumnModified(NewsletterPeer::IS_HTML)) {
         $modifiedColumns[':p' . $index++] = '`is_html`';
     }
     if ($this->isColumnModified(NewsletterPeer::TEMPLATE_NAME)) {
         $modifiedColumns[':p' . $index++] = '`template_name`';
     }
     if ($this->isColumnModified(NewsletterPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`created_at`';
     }
     if ($this->isColumnModified(NewsletterPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`updated_at`';
     }
     if ($this->isColumnModified(NewsletterPeer::CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`created_by`';
     }
     if ($this->isColumnModified(NewsletterPeer::UPDATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`updated_by`';
     }
     $sql = sprintf('INSERT INTO `newsletters` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`subject`':
                     $stmt->bindValue($identifier, $this->subject, PDO::PARAM_STR);
                     break;
                 case '`newsletter_body`':
                     if (is_resource($this->newsletter_body)) {
                         rewind($this->newsletter_body);
                     }
                     $stmt->bindValue($identifier, $this->newsletter_body, PDO::PARAM_LOB);
                     break;
                 case '`language_id`':
                     $stmt->bindValue($identifier, $this->language_id, PDO::PARAM_STR);
                     break;
                 case '`is_approved`':
                     $stmt->bindValue($identifier, (int) $this->is_approved, PDO::PARAM_INT);
                     break;
                 case '`is_html`':
                     $stmt->bindValue($identifier, (int) $this->is_html, PDO::PARAM_INT);
                     break;
                 case '`template_name`':
                     $stmt->bindValue($identifier, $this->template_name, PDO::PARAM_STR);
                     break;
                 case '`created_at`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`updated_at`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
                 case '`created_by`':
                     $stmt->bindValue($identifier, $this->created_by, PDO::PARAM_INT);
                     break;
                 case '`updated_by`':
                     $stmt->bindValue($identifier, $this->updated_by, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = ClientePeer::ID_CLIE;
     if (null !== $this->id_clie) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . ClientePeer::ID_CLIE . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ClientePeer::ID_CLIE)) {
         $modifiedColumns[':p' . $index++] = '`ID_CLIE`';
     }
     if ($this->isColumnModified(ClientePeer::APELLIDO)) {
         $modifiedColumns[':p' . $index++] = '`APELLIDO`';
     }
     if ($this->isColumnModified(ClientePeer::NOMBRE)) {
         $modifiedColumns[':p' . $index++] = '`NOMBRE`';
     }
     if ($this->isColumnModified(ClientePeer::TELEFONO)) {
         $modifiedColumns[':p' . $index++] = '`TELEFONO`';
     }
     if ($this->isColumnModified(ClientePeer::DIRECCION)) {
         $modifiedColumns[':p' . $index++] = '`DIRECCION`';
     }
     if ($this->isColumnModified(ClientePeer::ID_PROV)) {
         $modifiedColumns[':p' . $index++] = '`ID_PROV`';
     }
     if ($this->isColumnModified(ClientePeer::ID_CIUDAD)) {
         $modifiedColumns[':p' . $index++] = '`ID_CIUDAD`';
     }
     if ($this->isColumnModified(ClientePeer::EMAIL)) {
         $modifiedColumns[':p' . $index++] = '`EMAIL`';
     }
     if ($this->isColumnModified(ClientePeer::USER)) {
         $modifiedColumns[':p' . $index++] = '`USER`';
     }
     if ($this->isColumnModified(ClientePeer::PASS)) {
         $modifiedColumns[':p' . $index++] = '`PASS`';
     }
     $sql = sprintf('INSERT INTO `cliente` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID_CLIE`':
                     $stmt->bindValue($identifier, $this->id_clie, PDO::PARAM_INT);
                     break;
                 case '`APELLIDO`':
                     $stmt->bindValue($identifier, $this->apellido, PDO::PARAM_STR);
                     break;
                 case '`NOMBRE`':
                     $stmt->bindValue($identifier, $this->nombre, PDO::PARAM_STR);
                     break;
                 case '`TELEFONO`':
                     $stmt->bindValue($identifier, $this->telefono, PDO::PARAM_STR);
                     break;
                 case '`DIRECCION`':
                     $stmt->bindValue($identifier, $this->direccion, PDO::PARAM_STR);
                     break;
                 case '`ID_PROV`':
                     $stmt->bindValue($identifier, $this->id_prov, PDO::PARAM_INT);
                     break;
                 case '`ID_CIUDAD`':
                     $stmt->bindValue($identifier, $this->id_ciudad, PDO::PARAM_INT);
                     break;
                 case '`EMAIL`':
                     $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR);
                     break;
                 case '`USER`':
                     $stmt->bindValue($identifier, $this->user, PDO::PARAM_STR);
                     break;
                 case '`PASS`':
                     $stmt->bindValue($identifier, $this->pass, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdClie($pk);
     $this->setNew(false);
 }
Example #8
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = OrdencompraPeer::IDORDENCOMPRA;
     if (null !== $this->idordencompra) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . OrdencompraPeer::IDORDENCOMPRA . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(OrdencompraPeer::IDORDENCOMPRA)) {
         $modifiedColumns[':p' . $index++] = '`idordencompra`';
     }
     if ($this->isColumnModified(OrdencompraPeer::IDPROVEEDOR)) {
         $modifiedColumns[':p' . $index++] = '`idproveedor`';
     }
     if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_NOFACTURA)) {
         $modifiedColumns[':p' . $index++] = '`ordencompra_nofactura`';
     }
     if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_FACTURAPDF)) {
         $modifiedColumns[':p' . $index++] = '`ordencompra_facturapdf`';
     }
     if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_FECHA)) {
         $modifiedColumns[':p' . $index++] = '`ordencompra_fecha`';
     }
     if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_IMPORTE)) {
         $modifiedColumns[':p' . $index++] = '`ordencompra_importe`';
     }
     if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_STATUS)) {
         $modifiedColumns[':p' . $index++] = '`ordencompra_status`';
     }
     if ($this->isColumnModified(OrdencompraPeer::ORDENCOMPRA_FECHAAPAGAR)) {
         $modifiedColumns[':p' . $index++] = '`ordencompra_fechaapagar`';
     }
     $sql = sprintf('INSERT INTO `ordencompra` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`idordencompra`':
                     $stmt->bindValue($identifier, $this->idordencompra, PDO::PARAM_INT);
                     break;
                 case '`idproveedor`':
                     $stmt->bindValue($identifier, $this->idproveedor, PDO::PARAM_INT);
                     break;
                 case '`ordencompra_nofactura`':
                     $stmt->bindValue($identifier, $this->ordencompra_nofactura, PDO::PARAM_STR);
                     break;
                 case '`ordencompra_facturapdf`':
                     $stmt->bindValue($identifier, $this->ordencompra_facturapdf, PDO::PARAM_STR);
                     break;
                 case '`ordencompra_fecha`':
                     $stmt->bindValue($identifier, $this->ordencompra_fecha, PDO::PARAM_STR);
                     break;
                 case '`ordencompra_importe`':
                     $stmt->bindValue($identifier, $this->ordencompra_importe, PDO::PARAM_STR);
                     break;
                 case '`ordencompra_status`':
                     $stmt->bindValue($identifier, $this->ordencompra_status, PDO::PARAM_STR);
                     break;
                 case '`ordencompra_fechaapagar`':
                     $stmt->bindValue($identifier, $this->ordencompra_fechaapagar, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdordencompra($pk);
     $this->setNew(false);
 }
Example #9
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = JournalPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . JournalPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(JournalPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(JournalPeer::NAME)) {
         $modifiedColumns[':p' . $index++] = '`name`';
     }
     if ($this->isColumnModified(JournalPeer::DESCRIPTION)) {
         $modifiedColumns[':p' . $index++] = '`description`';
     }
     if ($this->isColumnModified(JournalPeer::ENABLE_COMMENTS)) {
         $modifiedColumns[':p' . $index++] = '`enable_comments`';
     }
     if ($this->isColumnModified(JournalPeer::NOTIFY_COMMENTS)) {
         $modifiedColumns[':p' . $index++] = '`notify_comments`';
     }
     if ($this->isColumnModified(JournalPeer::USE_CAPTCHA)) {
         $modifiedColumns[':p' . $index++] = '`use_captcha`';
     }
     if ($this->isColumnModified(JournalPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`created_at`';
     }
     if ($this->isColumnModified(JournalPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`updated_at`';
     }
     if ($this->isColumnModified(JournalPeer::CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`created_by`';
     }
     if ($this->isColumnModified(JournalPeer::UPDATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`updated_by`';
     }
     $sql = sprintf('INSERT INTO `journals` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`name`':
                     $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                     break;
                 case '`description`':
                     $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
                     break;
                 case '`enable_comments`':
                     $stmt->bindValue($identifier, (int) $this->enable_comments, PDO::PARAM_INT);
                     break;
                 case '`notify_comments`':
                     $stmt->bindValue($identifier, (int) $this->notify_comments, PDO::PARAM_INT);
                     break;
                 case '`use_captcha`':
                     $stmt->bindValue($identifier, (int) $this->use_captcha, PDO::PARAM_INT);
                     break;
                 case '`created_at`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`updated_at`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
                 case '`created_by`':
                     $stmt->bindValue($identifier, $this->created_by, PDO::PARAM_INT);
                     break;
                 case '`updated_by`':
                     $stmt->bindValue($identifier, $this->updated_by, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #10
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = BookingPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . BookingPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(BookingPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(BookingPeer::TRANSACTION_ID)) {
         $modifiedColumns[':p' . $index++] = '`transaction_id`';
     }
     if ($this->isColumnModified(BookingPeer::BOOKING_TYPE_ID)) {
         $modifiedColumns[':p' . $index++] = '`booking_type_id`';
     }
     if ($this->isColumnModified(BookingPeer::LABEL)) {
         $modifiedColumns[':p' . $index++] = '`label`';
     }
     if ($this->isColumnModified(BookingPeer::VALUE)) {
         $modifiedColumns[':p' . $index++] = '`value`';
     }
     $sql = sprintf('INSERT INTO `booking` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`transaction_id`':
                     $stmt->bindValue($identifier, $this->transaction_id, PDO::PARAM_INT);
                     break;
                 case '`booking_type_id`':
                     $stmt->bindValue($identifier, $this->booking_type_id, PDO::PARAM_INT);
                     break;
                 case '`label`':
                     $stmt->bindValue($identifier, $this->label, PDO::PARAM_STR);
                     break;
                 case '`value`':
                     $stmt->bindValue($identifier, $this->value, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = SupplierPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . SupplierPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(SupplierPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(SupplierPeer::NAMA_SUPPLIER)) {
         $modifiedColumns[':p' . $index++] = '`nama_supplier`';
     }
     if ($this->isColumnModified(SupplierPeer::ALAMAT)) {
         $modifiedColumns[':p' . $index++] = '`alamat`';
     }
     if ($this->isColumnModified(SupplierPeer::ID_KOTA)) {
         $modifiedColumns[':p' . $index++] = '`id_kota`';
     }
     if ($this->isColumnModified(SupplierPeer::TELP)) {
         $modifiedColumns[':p' . $index++] = '`telp`';
     }
     $sql = sprintf('INSERT INTO `supplier` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`nama_supplier`':
                     $stmt->bindValue($identifier, $this->nama_supplier, PDO::PARAM_STR);
                     break;
                 case '`alamat`':
                     $stmt->bindValue($identifier, $this->alamat, PDO::PARAM_STR);
                     break;
                 case '`id_kota`':
                     $stmt->bindValue($identifier, $this->id_kota, PDO::PARAM_INT);
                     break;
                 case '`telp`':
                     $stmt->bindValue($identifier, $this->telp, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = SubscriberPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . SubscriberPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(SubscriberPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(SubscriberPeer::NAME)) {
         $modifiedColumns[':p' . $index++] = '`name`';
     }
     if ($this->isColumnModified(SubscriberPeer::PREFERRED_LANGUAGE_ID)) {
         $modifiedColumns[':p' . $index++] = '`preferred_language_id`';
     }
     if ($this->isColumnModified(SubscriberPeer::EMAIL)) {
         $modifiedColumns[':p' . $index++] = '`email`';
     }
     if ($this->isColumnModified(SubscriberPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`created_at`';
     }
     if ($this->isColumnModified(SubscriberPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`updated_at`';
     }
     if ($this->isColumnModified(SubscriberPeer::CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`created_by`';
     }
     if ($this->isColumnModified(SubscriberPeer::UPDATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`updated_by`';
     }
     $sql = sprintf('INSERT INTO `subscribers` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`name`':
                     $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                     break;
                 case '`preferred_language_id`':
                     $stmt->bindValue($identifier, $this->preferred_language_id, PDO::PARAM_STR);
                     break;
                 case '`email`':
                     $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR);
                     break;
                 case '`created_at`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`updated_at`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
                 case '`created_by`':
                     $stmt->bindValue($identifier, $this->created_by, PDO::PARAM_INT);
                     break;
                 case '`updated_by`':
                     $stmt->bindValue($identifier, $this->updated_by, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #13
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = FacturaDetallePeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . FacturaDetallePeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(FacturaDetallePeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(FacturaDetallePeer::FACTURA_ID)) {
         $modifiedColumns[':p' . $index++] = '`FACTURA_ID`';
     }
     if ($this->isColumnModified(FacturaDetallePeer::PRODUCTO_ID)) {
         $modifiedColumns[':p' . $index++] = '`PRODUCTO_ID`';
     }
     if ($this->isColumnModified(FacturaDetallePeer::PROVEEDOR_ID)) {
         $modifiedColumns[':p' . $index++] = '`PROVEEDOR_ID`';
     }
     if ($this->isColumnModified(FacturaDetallePeer::CANTIDAD)) {
         $modifiedColumns[':p' . $index++] = '`CANTIDAD`';
     }
     if ($this->isColumnModified(FacturaDetallePeer::PRECIO_UNITARIO)) {
         $modifiedColumns[':p' . $index++] = '`PRECIO_UNITARIO`';
     }
     $sql = sprintf('INSERT INTO `factura_detalle` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`FACTURA_ID`':
                     $stmt->bindValue($identifier, $this->factura_id, PDO::PARAM_INT);
                     break;
                 case '`PRODUCTO_ID`':
                     $stmt->bindValue($identifier, $this->producto_id, PDO::PARAM_INT);
                     break;
                 case '`PROVEEDOR_ID`':
                     $stmt->bindValue($identifier, $this->proveedor_id, PDO::PARAM_INT);
                     break;
                 case '`CANTIDAD`':
                     $stmt->bindValue($identifier, $this->cantidad, PDO::PARAM_INT);
                     break;
                 case '`PRECIO_UNITARIO`':
                     $stmt->bindValue($identifier, $this->precio_unitario, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #14
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = PagePeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . PagePeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(PagePeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(PagePeer::NAME)) {
         $modifiedColumns[':p' . $index++] = '`name`';
     }
     if ($this->isColumnModified(PagePeer::IDENTIFIER)) {
         $modifiedColumns[':p' . $index++] = '`identifier`';
     }
     if ($this->isColumnModified(PagePeer::PAGE_TYPE)) {
         $modifiedColumns[':p' . $index++] = '`page_type`';
     }
     if ($this->isColumnModified(PagePeer::TEMPLATE_NAME)) {
         $modifiedColumns[':p' . $index++] = '`template_name`';
     }
     if ($this->isColumnModified(PagePeer::IS_INACTIVE)) {
         $modifiedColumns[':p' . $index++] = '`is_inactive`';
     }
     if ($this->isColumnModified(PagePeer::IS_FOLDER)) {
         $modifiedColumns[':p' . $index++] = '`is_folder`';
     }
     if ($this->isColumnModified(PagePeer::IS_HIDDEN)) {
         $modifiedColumns[':p' . $index++] = '`is_hidden`';
     }
     if ($this->isColumnModified(PagePeer::IS_PROTECTED)) {
         $modifiedColumns[':p' . $index++] = '`is_protected`';
     }
     if ($this->isColumnModified(PagePeer::CANONICAL_ID)) {
         $modifiedColumns[':p' . $index++] = '`canonical_id`';
     }
     if ($this->isColumnModified(PagePeer::TREE_LEFT)) {
         $modifiedColumns[':p' . $index++] = '`tree_left`';
     }
     if ($this->isColumnModified(PagePeer::TREE_RIGHT)) {
         $modifiedColumns[':p' . $index++] = '`tree_right`';
     }
     if ($this->isColumnModified(PagePeer::TREE_LEVEL)) {
         $modifiedColumns[':p' . $index++] = '`tree_level`';
     }
     if ($this->isColumnModified(PagePeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`created_at`';
     }
     if ($this->isColumnModified(PagePeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`updated_at`';
     }
     if ($this->isColumnModified(PagePeer::CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`created_by`';
     }
     if ($this->isColumnModified(PagePeer::UPDATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`updated_by`';
     }
     $sql = sprintf('INSERT INTO `pages` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`name`':
                     $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                     break;
                 case '`identifier`':
                     $stmt->bindValue($identifier, $this->identifier, PDO::PARAM_STR);
                     break;
                 case '`page_type`':
                     $stmt->bindValue($identifier, $this->page_type, PDO::PARAM_STR);
                     break;
                 case '`template_name`':
                     $stmt->bindValue($identifier, $this->template_name, PDO::PARAM_STR);
                     break;
                 case '`is_inactive`':
                     $stmt->bindValue($identifier, (int) $this->is_inactive, PDO::PARAM_INT);
                     break;
                 case '`is_folder`':
                     $stmt->bindValue($identifier, (int) $this->is_folder, PDO::PARAM_INT);
                     break;
                 case '`is_hidden`':
                     $stmt->bindValue($identifier, (int) $this->is_hidden, PDO::PARAM_INT);
                     break;
                 case '`is_protected`':
                     $stmt->bindValue($identifier, (int) $this->is_protected, PDO::PARAM_INT);
                     break;
                 case '`canonical_id`':
                     $stmt->bindValue($identifier, $this->canonical_id, PDO::PARAM_INT);
                     break;
                 case '`tree_left`':
                     $stmt->bindValue($identifier, $this->tree_left, PDO::PARAM_INT);
                     break;
                 case '`tree_right`':
                     $stmt->bindValue($identifier, $this->tree_right, PDO::PARAM_INT);
                     break;
                 case '`tree_level`':
                     $stmt->bindValue($identifier, $this->tree_level, PDO::PARAM_INT);
                     break;
                 case '`created_at`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`updated_at`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
                 case '`created_by`':
                     $stmt->bindValue($identifier, $this->created_by, PDO::PARAM_INT);
                     break;
                 case '`updated_by`':
                     $stmt->bindValue($identifier, $this->updated_by, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #15
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = TipoPeer::IDTIPO;
     if (null !== $this->idtipo) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . TipoPeer::IDTIPO . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(TipoPeer::IDTIPO)) {
         $modifiedColumns[':p' . $index++] = '`idtipo`';
     }
     if ($this->isColumnModified(TipoPeer::TIPO_NOMBRE)) {
         $modifiedColumns[':p' . $index++] = '`tipo_nombre`';
     }
     if ($this->isColumnModified(TipoPeer::TIPO_DESCRIPCION)) {
         $modifiedColumns[':p' . $index++] = '`tipo_descripcion`';
     }
     $sql = sprintf('INSERT INTO `tipo` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`idtipo`':
                     $stmt->bindValue($identifier, $this->idtipo, PDO::PARAM_INT);
                     break;
                 case '`tipo_nombre`':
                     $stmt->bindValue($identifier, $this->tipo_nombre, PDO::PARAM_STR);
                     break;
                 case '`tipo_descripcion`':
                     $stmt->bindValue($identifier, $this->tipo_descripcion, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdtipo($pk);
     $this->setNew(false);
 }
Example #16
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = JugadorMesaPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . JugadorMesaPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(JugadorMesaPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::MESA_ID)) {
         $modifiedColumns[':p' . $index++] = '`MESA_ID`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::ESTADO)) {
         $modifiedColumns[':p' . $index++] = '`ESTADO`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::JUGADOR_ID)) {
         $modifiedColumns[':p' . $index++] = '`JUGADOR_ID`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_BY`';
     }
     if ($this->isColumnModified(JugadorMesaPeer::UPDATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`UPDATED_BY`';
     }
     $sql = sprintf('INSERT INTO `jugador_mesa` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`MESA_ID`':
                     $stmt->bindValue($identifier, $this->mesa_id, PDO::PARAM_INT);
                     break;
                 case '`ESTADO`':
                     $stmt->bindValue($identifier, $this->estado, PDO::PARAM_STR);
                     break;
                 case '`JUGADOR_ID`':
                     $stmt->bindValue($identifier, $this->jugador_id, PDO::PARAM_INT);
                     break;
                 case '`CREATED_AT`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`UPDATED_AT`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
                 case '`CREATED_BY`':
                     $stmt->bindValue($identifier, $this->created_by, PDO::PARAM_STR);
                     break;
                 case '`UPDATED_BY`':
                     $stmt->bindValue($identifier, $this->updated_by, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #17
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = PacientePeer::IDPACIENTE;
     if (null !== $this->idpaciente) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . PacientePeer::IDPACIENTE . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(PacientePeer::IDPACIENTE)) {
         $modifiedColumns[':p' . $index++] = '`idpaciente`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_NOMBRE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_nombre`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_AP)) {
         $modifiedColumns[':p' . $index++] = '`paciente_ap`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_AM)) {
         $modifiedColumns[':p' . $index++] = '`paciente_am`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_CALLE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_calle`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_NOEXTERIOR)) {
         $modifiedColumns[':p' . $index++] = '`paciente_noexterior`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_NOINTERIOR)) {
         $modifiedColumns[':p' . $index++] = '`paciente_nointerior`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_COLONIA)) {
         $modifiedColumns[':p' . $index++] = '`paciente_colonia`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_CODIGOPOSTAL)) {
         $modifiedColumns[':p' . $index++] = '`paciente_codigopostal`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_CIUDAD)) {
         $modifiedColumns[':p' . $index++] = '`paciente_ciudad`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_ESTADO)) {
         $modifiedColumns[':p' . $index++] = '`paciente_estado`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_PAIS)) {
         $modifiedColumns[':p' . $index++] = '`paciente_pais`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_TELEFONO)) {
         $modifiedColumns[':p' . $index++] = '`paciente_telefono`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_TELEFONOCELULAR)) {
         $modifiedColumns[':p' . $index++] = '`paciente_telefonocelular`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_FECHANACIMIENTO)) {
         $modifiedColumns[':p' . $index++] = '`paciente_fechanacimiento`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_SEXO)) {
         $modifiedColumns[':p' . $index++] = '`paciente_sexo`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_ESTADOCIVIL)) {
         $modifiedColumns[':p' . $index++] = '`paciente_estadocivil`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_OCUPACION)) {
         $modifiedColumns[':p' . $index++] = '`paciente_ocupacion`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_CONYUGE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_conyuge`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_PADRE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_padre`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_MADRE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_madre`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_RESPONSABLE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_responsable`';
     }
     if ($this->isColumnModified(PacientePeer::PACIENTE_TELEFONORESPONSABLE)) {
         $modifiedColumns[':p' . $index++] = '`paciente_telefonoresponsable`';
     }
     $sql = sprintf('INSERT INTO `paciente` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`idpaciente`':
                     $stmt->bindValue($identifier, $this->idpaciente, PDO::PARAM_INT);
                     break;
                 case '`paciente_nombre`':
                     $stmt->bindValue($identifier, $this->paciente_nombre, PDO::PARAM_STR);
                     break;
                 case '`paciente_ap`':
                     $stmt->bindValue($identifier, $this->paciente_ap, PDO::PARAM_STR);
                     break;
                 case '`paciente_am`':
                     $stmt->bindValue($identifier, $this->paciente_am, PDO::PARAM_STR);
                     break;
                 case '`paciente_calle`':
                     $stmt->bindValue($identifier, $this->paciente_calle, PDO::PARAM_STR);
                     break;
                 case '`paciente_noexterior`':
                     $stmt->bindValue($identifier, $this->paciente_noexterior, PDO::PARAM_STR);
                     break;
                 case '`paciente_nointerior`':
                     $stmt->bindValue($identifier, $this->paciente_nointerior, PDO::PARAM_STR);
                     break;
                 case '`paciente_colonia`':
                     $stmt->bindValue($identifier, $this->paciente_colonia, PDO::PARAM_STR);
                     break;
                 case '`paciente_codigopostal`':
                     $stmt->bindValue($identifier, $this->paciente_codigopostal, PDO::PARAM_STR);
                     break;
                 case '`paciente_ciudad`':
                     $stmt->bindValue($identifier, $this->paciente_ciudad, PDO::PARAM_STR);
                     break;
                 case '`paciente_estado`':
                     $stmt->bindValue($identifier, $this->paciente_estado, PDO::PARAM_STR);
                     break;
                 case '`paciente_pais`':
                     $stmt->bindValue($identifier, $this->paciente_pais, PDO::PARAM_STR);
                     break;
                 case '`paciente_telefono`':
                     $stmt->bindValue($identifier, $this->paciente_telefono, PDO::PARAM_STR);
                     break;
                 case '`paciente_telefonocelular`':
                     $stmt->bindValue($identifier, $this->paciente_telefonocelular, PDO::PARAM_STR);
                     break;
                 case '`paciente_fechanacimiento`':
                     $stmt->bindValue($identifier, $this->paciente_fechanacimiento, PDO::PARAM_STR);
                     break;
                 case '`paciente_sexo`':
                     $stmt->bindValue($identifier, $this->paciente_sexo, PDO::PARAM_STR);
                     break;
                 case '`paciente_estadocivil`':
                     $stmt->bindValue($identifier, $this->paciente_estadocivil, PDO::PARAM_STR);
                     break;
                 case '`paciente_ocupacion`':
                     $stmt->bindValue($identifier, $this->paciente_ocupacion, PDO::PARAM_STR);
                     break;
                 case '`paciente_conyuge`':
                     $stmt->bindValue($identifier, $this->paciente_conyuge, PDO::PARAM_STR);
                     break;
                 case '`paciente_padre`':
                     $stmt->bindValue($identifier, $this->paciente_padre, PDO::PARAM_STR);
                     break;
                 case '`paciente_madre`':
                     $stmt->bindValue($identifier, $this->paciente_madre, PDO::PARAM_STR);
                     break;
                 case '`paciente_responsable`':
                     $stmt->bindValue($identifier, $this->paciente_responsable, PDO::PARAM_STR);
                     break;
                 case '`paciente_telefonoresponsable`':
                     $stmt->bindValue($identifier, $this->paciente_telefonoresponsable, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdpaciente($pk);
     $this->setNew(false);
 }
Example #18
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = ConsultaPeer::IDCONSULTA;
     if (null !== $this->idconsulta) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . ConsultaPeer::IDCONSULTA . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(ConsultaPeer::IDCONSULTA)) {
         $modifiedColumns[':p' . $index++] = '`idconsulta`';
     }
     if ($this->isColumnModified(ConsultaPeer::IDPACIENTE)) {
         $modifiedColumns[':p' . $index++] = '`idpaciente`';
     }
     if ($this->isColumnModified(ConsultaPeer::IDMEDICO)) {
         $modifiedColumns[':p' . $index++] = '`idmedico`';
     }
     if ($this->isColumnModified(ConsultaPeer::IDCONSULTORIO)) {
         $modifiedColumns[':p' . $index++] = '`idconsultorio`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_FECHA)) {
         $modifiedColumns[':p' . $index++] = '`consulta_fecha`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_HORA)) {
         $modifiedColumns[':p' . $index++] = '`consulta_hora`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_DIAGNOSTICO)) {
         $modifiedColumns[':p' . $index++] = '`consulta_diagnostico`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_OBSERVACIONES)) {
         $modifiedColumns[':p' . $index++] = '`consulta_observaciones`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_STATUS)) {
         $modifiedColumns[':p' . $index++] = '`consulta_status`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_TOTAL)) {
         $modifiedColumns[':p' . $index++] = '`consulta_total`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_TIPODEPAGO)) {
         $modifiedColumns[':p' . $index++] = '`consulta_tipodepago`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_REFERENCIAPAGO)) {
         $modifiedColumns[':p' . $index++] = '`consulta_referenciapago`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_FACTURADA)) {
         $modifiedColumns[':p' . $index++] = '`consulta_facturada`';
     }
     if ($this->isColumnModified(ConsultaPeer::CONSULTA_REGISTRADA)) {
         $modifiedColumns[':p' . $index++] = '`consulta_registrada`';
     }
     $sql = sprintf('INSERT INTO `consulta` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`idconsulta`':
                     $stmt->bindValue($identifier, $this->idconsulta, PDO::PARAM_INT);
                     break;
                 case '`idpaciente`':
                     $stmt->bindValue($identifier, $this->idpaciente, PDO::PARAM_INT);
                     break;
                 case '`idmedico`':
                     $stmt->bindValue($identifier, $this->idmedico, PDO::PARAM_INT);
                     break;
                 case '`idconsultorio`':
                     $stmt->bindValue($identifier, $this->idconsultorio, PDO::PARAM_INT);
                     break;
                 case '`consulta_fecha`':
                     $stmt->bindValue($identifier, $this->consulta_fecha, PDO::PARAM_STR);
                     break;
                 case '`consulta_hora`':
                     $stmt->bindValue($identifier, $this->consulta_hora, PDO::PARAM_STR);
                     break;
                 case '`consulta_diagnostico`':
                     $stmt->bindValue($identifier, $this->consulta_diagnostico, PDO::PARAM_STR);
                     break;
                 case '`consulta_observaciones`':
                     $stmt->bindValue($identifier, $this->consulta_observaciones, PDO::PARAM_STR);
                     break;
                 case '`consulta_status`':
                     $stmt->bindValue($identifier, $this->consulta_status, PDO::PARAM_STR);
                     break;
                 case '`consulta_total`':
                     $stmt->bindValue($identifier, $this->consulta_total, PDO::PARAM_STR);
                     break;
                 case '`consulta_tipodepago`':
                     $stmt->bindValue($identifier, $this->consulta_tipodepago, PDO::PARAM_STR);
                     break;
                 case '`consulta_referenciapago`':
                     $stmt->bindValue($identifier, $this->consulta_referenciapago, PDO::PARAM_STR);
                     break;
                 case '`consulta_facturada`':
                     $stmt->bindValue($identifier, (int) $this->consulta_facturada, PDO::PARAM_INT);
                     break;
                 case '`consulta_registrada`':
                     $stmt->bindValue($identifier, (int) $this->consulta_registrada, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdconsulta($pk);
     $this->setNew(false);
 }
Example #19
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = RightPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . RightPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(RightPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(RightPeer::ROLE_KEY)) {
         $modifiedColumns[':p' . $index++] = '`role_key`';
     }
     if ($this->isColumnModified(RightPeer::PAGE_ID)) {
         $modifiedColumns[':p' . $index++] = '`page_id`';
     }
     if ($this->isColumnModified(RightPeer::IS_INHERITED)) {
         $modifiedColumns[':p' . $index++] = '`is_inherited`';
     }
     if ($this->isColumnModified(RightPeer::MAY_EDIT_PAGE_DETAILS)) {
         $modifiedColumns[':p' . $index++] = '`may_edit_page_details`';
     }
     if ($this->isColumnModified(RightPeer::MAY_EDIT_PAGE_CONTENTS)) {
         $modifiedColumns[':p' . $index++] = '`may_edit_page_contents`';
     }
     if ($this->isColumnModified(RightPeer::MAY_DELETE)) {
         $modifiedColumns[':p' . $index++] = '`may_delete`';
     }
     if ($this->isColumnModified(RightPeer::MAY_CREATE_CHILDREN)) {
         $modifiedColumns[':p' . $index++] = '`may_create_children`';
     }
     if ($this->isColumnModified(RightPeer::MAY_VIEW_PAGE)) {
         $modifiedColumns[':p' . $index++] = '`may_view_page`';
     }
     if ($this->isColumnModified(RightPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`created_at`';
     }
     if ($this->isColumnModified(RightPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`updated_at`';
     }
     if ($this->isColumnModified(RightPeer::CREATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`created_by`';
     }
     if ($this->isColumnModified(RightPeer::UPDATED_BY)) {
         $modifiedColumns[':p' . $index++] = '`updated_by`';
     }
     $sql = sprintf('INSERT INTO `rights` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`role_key`':
                     $stmt->bindValue($identifier, $this->role_key, PDO::PARAM_STR);
                     break;
                 case '`page_id`':
                     $stmt->bindValue($identifier, $this->page_id, PDO::PARAM_INT);
                     break;
                 case '`is_inherited`':
                     $stmt->bindValue($identifier, (int) $this->is_inherited, PDO::PARAM_INT);
                     break;
                 case '`may_edit_page_details`':
                     $stmt->bindValue($identifier, (int) $this->may_edit_page_details, PDO::PARAM_INT);
                     break;
                 case '`may_edit_page_contents`':
                     $stmt->bindValue($identifier, (int) $this->may_edit_page_contents, PDO::PARAM_INT);
                     break;
                 case '`may_delete`':
                     $stmt->bindValue($identifier, (int) $this->may_delete, PDO::PARAM_INT);
                     break;
                 case '`may_create_children`':
                     $stmt->bindValue($identifier, (int) $this->may_create_children, PDO::PARAM_INT);
                     break;
                 case '`may_view_page`':
                     $stmt->bindValue($identifier, (int) $this->may_view_page, PDO::PARAM_INT);
                     break;
                 case '`created_at`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`updated_at`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
                 case '`created_by`':
                     $stmt->bindValue($identifier, $this->created_by, PDO::PARAM_INT);
                     break;
                 case '`updated_by`':
                     $stmt->bindValue($identifier, $this->updated_by, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #20
0
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = JobPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . JobPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(JobPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(JobPeer::USER_ID)) {
         $modifiedColumns[':p' . $index++] = '`USER_ID`';
     }
     if ($this->isColumnModified(JobPeer::CHART_ID)) {
         $modifiedColumns[':p' . $index++] = '`CHART_ID`';
     }
     if ($this->isColumnModified(JobPeer::STATUS)) {
         $modifiedColumns[':p' . $index++] = '`STATUS`';
     }
     if ($this->isColumnModified(JobPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
     }
     if ($this->isColumnModified(JobPeer::DONE_AT)) {
         $modifiedColumns[':p' . $index++] = '`DONE_AT`';
     }
     if ($this->isColumnModified(JobPeer::TYPE)) {
         $modifiedColumns[':p' . $index++] = '`TYPE`';
     }
     if ($this->isColumnModified(JobPeer::PARAMETER)) {
         $modifiedColumns[':p' . $index++] = '`PARAMETER`';
     }
     if ($this->isColumnModified(JobPeer::FAIL_REASON)) {
         $modifiedColumns[':p' . $index++] = '`FAIL_REASON`';
     }
     $sql = sprintf('INSERT INTO `job` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`USER_ID`':
                     $stmt->bindValue($identifier, $this->user_id, PDO::PARAM_INT);
                     break;
                 case '`CHART_ID`':
                     $stmt->bindValue($identifier, $this->chart_id, PDO::PARAM_STR);
                     break;
                 case '`STATUS`':
                     $stmt->bindValue($identifier, $this->status, PDO::PARAM_INT);
                     break;
                 case '`CREATED_AT`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`DONE_AT`':
                     $stmt->bindValue($identifier, $this->done_at, PDO::PARAM_STR);
                     break;
                 case '`TYPE`':
                     $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
                     break;
                 case '`PARAMETER`':
                     $stmt->bindValue($identifier, $this->parameter, PDO::PARAM_STR);
                     break;
                 case '`FAIL_REASON`':
                     $stmt->bindValue($identifier, $this->fail_reason, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #21
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = PluginPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . PluginPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(PluginPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(PluginPeer::ACCOUNT_ID)) {
         $modifiedColumns[':p' . $index++] = '`account_id`';
     }
     if ($this->isColumnModified(PluginPeer::ENTITY)) {
         $modifiedColumns[':p' . $index++] = '`entity`';
     }
     if ($this->isColumnModified(PluginPeer::EVENT)) {
         $modifiedColumns[':p' . $index++] = '`event`';
     }
     if ($this->isColumnModified(PluginPeer::PRIORITY)) {
         $modifiedColumns[':p' . $index++] = '`priority`';
     }
     if ($this->isColumnModified(PluginPeer::IDENTIFIER)) {
         $modifiedColumns[':p' . $index++] = '`identifier`';
     }
     if ($this->isColumnModified(PluginPeer::NAME)) {
         $modifiedColumns[':p' . $index++] = '`name`';
     }
     if ($this->isColumnModified(PluginPeer::CODE)) {
         $modifiedColumns[':p' . $index++] = '`code`';
     }
     if ($this->isColumnModified(PluginPeer::ACTIVE)) {
         $modifiedColumns[':p' . $index++] = '`active`';
     }
     if ($this->isColumnModified(PluginPeer::INTERVAL)) {
         $modifiedColumns[':p' . $index++] = '`interval`';
     }
     if ($this->isColumnModified(PluginPeer::START)) {
         $modifiedColumns[':p' . $index++] = '`start`';
     }
     if ($this->isColumnModified(PluginPeer::LAST_EXECUTION_TIME)) {
         $modifiedColumns[':p' . $index++] = '`last_execution_time`';
     }
     $sql = sprintf('INSERT INTO `plugin` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`account_id`':
                     $stmt->bindValue($identifier, $this->account_id, PDO::PARAM_INT);
                     break;
                 case '`entity`':
                     $stmt->bindValue($identifier, $this->entity, PDO::PARAM_STR);
                     break;
                 case '`event`':
                     $stmt->bindValue($identifier, $this->event, PDO::PARAM_STR);
                     break;
                 case '`priority`':
                     $stmt->bindValue($identifier, $this->priority, PDO::PARAM_INT);
                     break;
                 case '`identifier`':
                     $stmt->bindValue($identifier, $this->identifier, PDO::PARAM_STR);
                     break;
                 case '`name`':
                     $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                     break;
                 case '`code`':
                     $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
                     break;
                 case '`active`':
                     $stmt->bindValue($identifier, $this->active, PDO::PARAM_INT);
                     break;
                 case '`interval`':
                     $stmt->bindValue($identifier, $this->interval, PDO::PARAM_INT);
                     break;
                 case '`start`':
                     $stmt->bindValue($identifier, $this->start, PDO::PARAM_INT);
                     break;
                 case '`last_execution_time`':
                     $stmt->bindValue($identifier, $this->last_execution_time, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #22
0
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = AgendaPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . AgendaPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(AgendaPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(AgendaPeer::PROGRAMACION)) {
         $modifiedColumns[':p' . $index++] = '`PROGRAMACION`';
     }
     if ($this->isColumnModified(AgendaPeer::FECHAESTADO)) {
         $modifiedColumns[':p' . $index++] = '`FECHAESTADO`';
     }
     if ($this->isColumnModified(AgendaPeer::HORA)) {
         $modifiedColumns[':p' . $index++] = '`HORA`';
     }
     if ($this->isColumnModified(AgendaPeer::HORAESTADO)) {
         $modifiedColumns[':p' . $index++] = '`HORAESTADO`';
     }
     if ($this->isColumnModified(AgendaPeer::INICIO)) {
         $modifiedColumns[':p' . $index++] = '`INICIO`';
     }
     if ($this->isColumnModified(AgendaPeer::LAST_TIME)) {
         $modifiedColumns[':p' . $index++] = '`LAST_TIME`';
     }
     if ($this->isColumnModified(AgendaPeer::INGRESO)) {
         $modifiedColumns[':p' . $index++] = '`INGRESO`';
     }
     if ($this->isColumnModified(AgendaPeer::SALA_ID)) {
         $modifiedColumns[':p' . $index++] = '`SALA_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::QUIROFANO_ID)) {
         $modifiedColumns[':p' . $index++] = '`QUIROFANO_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::EGRESO)) {
         $modifiedColumns[':p' . $index++] = '`EGRESO`';
     }
     if ($this->isColumnModified(AgendaPeer::CIE9MC)) {
         $modifiedColumns[':p' . $index++] = '`CIE9MC`';
     }
     if ($this->isColumnModified(AgendaPeer::CIE9MC_ID)) {
         $modifiedColumns[':p' . $index++] = '`CIE9MC_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::CX_REALIZADA)) {
         $modifiedColumns[':p' . $index++] = '`CX_REALIZADA`';
     }
     if ($this->isColumnModified(AgendaPeer::CX_REALIZADA_ID)) {
         $modifiedColumns[':p' . $index++] = '`CX_REALIZADA_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::TIPO_CX)) {
         $modifiedColumns[':p' . $index++] = '`TIPO_CX`';
     }
     if ($this->isColumnModified(AgendaPeer::DIAGNOSTICO)) {
         $modifiedColumns[':p' . $index++] = '`DIAGNOSTICO`';
     }
     if ($this->isColumnModified(AgendaPeer::DIAGNOSTICO_ID)) {
         $modifiedColumns[':p' . $index++] = '`DIAGNOSTICO_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::MEDICO_NAME)) {
         $modifiedColumns[':p' . $index++] = '`MEDICO_NAME`';
     }
     if ($this->isColumnModified(AgendaPeer::PACIENTE_NAME)) {
         $modifiedColumns[':p' . $index++] = '`PACIENTE_NAME`';
     }
     if ($this->isColumnModified(AgendaPeer::PACIENTE_ID)) {
         $modifiedColumns[':p' . $index++] = '`PACIENTE_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::EDAD)) {
         $modifiedColumns[':p' . $index++] = '`EDAD`';
     }
     if ($this->isColumnModified(AgendaPeer::GENERO)) {
         $modifiedColumns[':p' . $index++] = '`GENERO`';
     }
     if ($this->isColumnModified(AgendaPeer::GENERO_ID)) {
         $modifiedColumns[':p' . $index++] = '`GENERO_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::REGISTRO)) {
         $modifiedColumns[':p' . $index++] = '`REGISTRO`';
     }
     if ($this->isColumnModified(AgendaPeer::SERVICIO)) {
         $modifiedColumns[':p' . $index++] = '`SERVICIO`';
     }
     if ($this->isColumnModified(AgendaPeer::ANESTESIA_ID)) {
         $modifiedColumns[':p' . $index++] = '`ANESTESIA_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::ANESTESIA_EMPLEADA)) {
         $modifiedColumns[':p' . $index++] = '`ANESTESIA_EMPLEADA`';
     }
     if ($this->isColumnModified(AgendaPeer::EV_ADVERSOS_ANESTESIA)) {
         $modifiedColumns[':p' . $index++] = '`EV_ADVERSOS_ANESTESIA`';
     }
     if ($this->isColumnModified(AgendaPeer::OBSERVACIONES)) {
         $modifiedColumns[':p' . $index++] = '`OBSERVACIONES`';
     }
     if ($this->isColumnModified(AgendaPeer::REQUERIMIENTO)) {
         $modifiedColumns[':p' . $index++] = '`REQUERIMIENTO`';
     }
     if ($this->isColumnModified(AgendaPeer::REQ_INSUMOS)) {
         $modifiedColumns[':p' . $index++] = '`REQ_INSUMOS`';
     }
     if ($this->isColumnModified(AgendaPeer::REQ_HEMODERIV)) {
         $modifiedColumns[':p' . $index++] = '`REQ_HEMODERIV`';
     }
     if ($this->isColumnModified(AgendaPeer::REQ_LABORATORIO)) {
         $modifiedColumns[':p' . $index++] = '`REQ_LABORATORIO`';
     }
     if ($this->isColumnModified(AgendaPeer::REQ_ANESTESICO)) {
         $modifiedColumns[':p' . $index++] = '`REQ_ANESTESICO`';
     }
     if ($this->isColumnModified(AgendaPeer::STATUS)) {
         $modifiedColumns[':p' . $index++] = '`STATUS`';
     }
     if ($this->isColumnModified(AgendaPeer::CAUSA_DIFERIDO_ID)) {
         $modifiedColumns[':p' . $index++] = '`CAUSA_DIFERIDO_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::SOLICITADO)) {
         $modifiedColumns[':p' . $index++] = '`SOLICITADO`';
     }
     if ($this->isColumnModified(AgendaPeer::RIESGOQX_ID)) {
         $modifiedColumns[':p' . $index++] = '`RIESGOQX_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::CONTAMINACIONQX_ID)) {
         $modifiedColumns[':p' . $index++] = '`CONTAMINACIONQX_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::EVENTOQX_ID)) {
         $modifiedColumns[':p' . $index++] = '`EVENTOQX_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::COMPLICACIONES)) {
         $modifiedColumns[':p' . $index++] = '`COMPLICACIONES`';
     }
     if ($this->isColumnModified(AgendaPeer::VAL_PRE_ANESTESICA)) {
         $modifiedColumns[':p' . $index++] = '`VAL_PRE_ANESTESICA`';
     }
     if ($this->isColumnModified(AgendaPeer::REINTERVENCION)) {
         $modifiedColumns[':p' . $index++] = '`REINTERVENCION`';
     }
     if ($this->isColumnModified(AgendaPeer::PERMISOS)) {
         $modifiedColumns[':p' . $index++] = '`PERMISOS`';
     }
     if ($this->isColumnModified(AgendaPeer::TIPO_PROC_ID)) {
         $modifiedColumns[':p' . $index++] = '`TIPO_PROC_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::ATENCION_ID)) {
         $modifiedColumns[':p' . $index++] = '`ATENCION_ID`';
     }
     if ($this->isColumnModified(AgendaPeer::TIEMPO_FUERA)) {
         $modifiedColumns[':p' . $index++] = '`TIEMPO_FUERA`';
     }
     if ($this->isColumnModified(AgendaPeer::PROCEDENCIA)) {
         $modifiedColumns[':p' . $index++] = '`PROCEDENCIA`';
     }
     if ($this->isColumnModified(AgendaPeer::CLASIFICACIONQX)) {
         $modifiedColumns[':p' . $index++] = '`CLASIFICACIONQX`';
     }
     if ($this->isColumnModified(AgendaPeer::REGION_PX)) {
         $modifiedColumns[':p' . $index++] = '`REGION_PX`';
     }
     if ($this->isColumnModified(AgendaPeer::EXTENSION_PX)) {
         $modifiedColumns[':p' . $index++] = '`EXTENSION_PX`';
     }
     if ($this->isColumnModified(AgendaPeer::ANEXO_DETALLE)) {
         $modifiedColumns[':p' . $index++] = '`ANEXO_DETALLE`';
     }
     if ($this->isColumnModified(AgendaPeer::DESTINO_PX)) {
         $modifiedColumns[':p' . $index++] = '`DESTINO_PX`';
     }
     if ($this->isColumnModified(AgendaPeer::LIBERACION_SALA)) {
         $modifiedColumns[':p' . $index++] = '`LIBERACION_SALA`';
     }
     if ($this->isColumnModified(AgendaPeer::TIEMPO_EST)) {
         $modifiedColumns[':p' . $index++] = '`TIEMPO_EST`';
     }
     if ($this->isColumnModified(AgendaPeer::RIESGO_QX_PRE)) {
         $modifiedColumns[':p' . $index++] = '`RIESGO_QX_PRE`';
     }
     if ($this->isColumnModified(AgendaPeer::SHOW_IN_INDEX)) {
         $modifiedColumns[':p' . $index++] = '`SHOW_IN_INDEX`';
     }
     if ($this->isColumnModified(AgendaPeer::PROTOCOLO)) {
         $modifiedColumns[':p' . $index++] = '`PROTOCOLO`';
     }
     if ($this->isColumnModified(AgendaPeer::CANCELADA)) {
         $modifiedColumns[':p' . $index++] = '`CANCELADA`';
     }
     if ($this->isColumnModified(AgendaPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
     }
     if ($this->isColumnModified(AgendaPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
     }
     $sql = sprintf('INSERT INTO `hc_agenda` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`PROGRAMACION`':
                     $stmt->bindValue($identifier, $this->programacion, PDO::PARAM_STR);
                     break;
                 case '`FECHAESTADO`':
                     $stmt->bindValue($identifier, $this->fechaestado, PDO::PARAM_STR);
                     break;
                 case '`HORA`':
                     $stmt->bindValue($identifier, $this->hora, PDO::PARAM_STR);
                     break;
                 case '`HORAESTADO`':
                     $stmt->bindValue($identifier, $this->horaestado, PDO::PARAM_STR);
                     break;
                 case '`INICIO`':
                     $stmt->bindValue($identifier, $this->inicio, PDO::PARAM_STR);
                     break;
                 case '`LAST_TIME`':
                     $stmt->bindValue($identifier, $this->last_time, PDO::PARAM_STR);
                     break;
                 case '`INGRESO`':
                     $stmt->bindValue($identifier, $this->ingreso, PDO::PARAM_STR);
                     break;
                 case '`SALA_ID`':
                     $stmt->bindValue($identifier, $this->sala_id, PDO::PARAM_INT);
                     break;
                 case '`QUIROFANO_ID`':
                     $stmt->bindValue($identifier, $this->quirofano_id, PDO::PARAM_INT);
                     break;
                 case '`EGRESO`':
                     $stmt->bindValue($identifier, $this->egreso, PDO::PARAM_STR);
                     break;
                 case '`CIE9MC`':
                     $stmt->bindValue($identifier, $this->cie9mc, PDO::PARAM_STR);
                     break;
                 case '`CIE9MC_ID`':
                     $stmt->bindValue($identifier, $this->cie9mc_id, PDO::PARAM_STR);
                     break;
                 case '`CX_REALIZADA`':
                     $stmt->bindValue($identifier, $this->cx_realizada, PDO::PARAM_STR);
                     break;
                 case '`CX_REALIZADA_ID`':
                     $stmt->bindValue($identifier, $this->cx_realizada_id, PDO::PARAM_STR);
                     break;
                 case '`TIPO_CX`':
                     $stmt->bindValue($identifier, $this->tipo_cx, PDO::PARAM_INT);
                     break;
                 case '`DIAGNOSTICO`':
                     $stmt->bindValue($identifier, $this->diagnostico, PDO::PARAM_STR);
                     break;
                 case '`DIAGNOSTICO_ID`':
                     $stmt->bindValue($identifier, $this->diagnostico_id, PDO::PARAM_STR);
                     break;
                 case '`MEDICO_NAME`':
                     $stmt->bindValue($identifier, $this->medico_name, PDO::PARAM_STR);
                     break;
                 case '`PACIENTE_NAME`':
                     $stmt->bindValue($identifier, $this->paciente_name, PDO::PARAM_STR);
                     break;
                 case '`PACIENTE_ID`':
                     $stmt->bindValue($identifier, $this->paciente_id, PDO::PARAM_INT);
                     break;
                 case '`EDAD`':
                     $stmt->bindValue($identifier, $this->edad, PDO::PARAM_STR);
                     break;
                 case '`GENERO`':
                     $stmt->bindValue($identifier, $this->genero, PDO::PARAM_STR);
                     break;
                 case '`GENERO_ID`':
                     $stmt->bindValue($identifier, $this->genero_id, PDO::PARAM_INT);
                     break;
                 case '`REGISTRO`':
                     $stmt->bindValue($identifier, $this->registro, PDO::PARAM_STR);
                     break;
                 case '`SERVICIO`':
                     $stmt->bindValue($identifier, $this->servicio, PDO::PARAM_INT);
                     break;
                 case '`ANESTESIA_ID`':
                     $stmt->bindValue($identifier, $this->anestesia_id, PDO::PARAM_INT);
                     break;
                 case '`ANESTESIA_EMPLEADA`':
                     $stmt->bindValue($identifier, $this->anestesia_empleada, PDO::PARAM_STR);
                     break;
                 case '`EV_ADVERSOS_ANESTESIA`':
                     $stmt->bindValue($identifier, $this->ev_adversos_anestesia, PDO::PARAM_STR);
                     break;
                 case '`OBSERVACIONES`':
                     $stmt->bindValue($identifier, $this->observaciones, PDO::PARAM_STR);
                     break;
                 case '`REQUERIMIENTO`':
                     $stmt->bindValue($identifier, $this->requerimiento, PDO::PARAM_STR);
                     break;
                 case '`REQ_INSUMOS`':
                     $stmt->bindValue($identifier, $this->req_insumos, PDO::PARAM_STR);
                     break;
                 case '`REQ_HEMODERIV`':
                     $stmt->bindValue($identifier, $this->req_hemoderiv, PDO::PARAM_STR);
                     break;
                 case '`REQ_LABORATORIO`':
                     $stmt->bindValue($identifier, $this->req_laboratorio, PDO::PARAM_STR);
                     break;
                 case '`REQ_ANESTESICO`':
                     $stmt->bindValue($identifier, $this->req_anestesico, PDO::PARAM_STR);
                     break;
                 case '`STATUS`':
                     $stmt->bindValue($identifier, $this->status, PDO::PARAM_INT);
                     break;
                 case '`CAUSA_DIFERIDO_ID`':
                     $stmt->bindValue($identifier, $this->causa_diferido_id, PDO::PARAM_INT);
                     break;
                 case '`SOLICITADO`':
                     $stmt->bindValue($identifier, (int) $this->solicitado, PDO::PARAM_INT);
                     break;
                 case '`RIESGOQX_ID`':
                     $stmt->bindValue($identifier, $this->riesgoqx_id, PDO::PARAM_INT);
                     break;
                 case '`CONTAMINACIONQX_ID`':
                     $stmt->bindValue($identifier, $this->contaminacionqx_id, PDO::PARAM_INT);
                     break;
                 case '`EVENTOQX_ID`':
                     $stmt->bindValue($identifier, $this->eventoqx_id, PDO::PARAM_INT);
                     break;
                 case '`COMPLICACIONES`':
                     $stmt->bindValue($identifier, $this->complicaciones, PDO::PARAM_STR);
                     break;
                 case '`VAL_PRE_ANESTESICA`':
                     $stmt->bindValue($identifier, $this->val_pre_anestesica, PDO::PARAM_STR);
                     break;
                 case '`REINTERVENCION`':
                     $stmt->bindValue($identifier, (int) $this->reintervencion, PDO::PARAM_INT);
                     break;
                 case '`PERMISOS`':
                     $stmt->bindValue($identifier, $this->permisos, PDO::PARAM_STR);
                     break;
                 case '`TIPO_PROC_ID`':
                     $stmt->bindValue($identifier, $this->tipo_proc_id, PDO::PARAM_INT);
                     break;
                 case '`ATENCION_ID`':
                     $stmt->bindValue($identifier, $this->atencion_id, PDO::PARAM_INT);
                     break;
                 case '`TIEMPO_FUERA`':
                     $stmt->bindValue($identifier, (int) $this->tiempo_fuera, PDO::PARAM_INT);
                     break;
                 case '`PROCEDENCIA`':
                     $stmt->bindValue($identifier, $this->procedencia, PDO::PARAM_STR);
                     break;
                 case '`CLASIFICACIONQX`':
                     $stmt->bindValue($identifier, $this->clasificacionqx, PDO::PARAM_INT);
                     break;
                 case '`REGION_PX`':
                     $stmt->bindValue($identifier, $this->region_px, PDO::PARAM_INT);
                     break;
                 case '`EXTENSION_PX`':
                     $stmt->bindValue($identifier, $this->extension_px, PDO::PARAM_INT);
                     break;
                 case '`ANEXO_DETALLE`':
                     $stmt->bindValue($identifier, $this->anexo_detalle, PDO::PARAM_INT);
                     break;
                 case '`DESTINO_PX`':
                     $stmt->bindValue($identifier, $this->destino_px, PDO::PARAM_INT);
                     break;
                 case '`LIBERACION_SALA`':
                     $stmt->bindValue($identifier, $this->liberacion_sala, PDO::PARAM_STR);
                     break;
                 case '`TIEMPO_EST`':
                     $stmt->bindValue($identifier, $this->tiempo_est, PDO::PARAM_STR);
                     break;
                 case '`RIESGO_QX_PRE`':
                     $stmt->bindValue($identifier, $this->riesgo_qx_pre, PDO::PARAM_STR);
                     break;
                 case '`SHOW_IN_INDEX`':
                     $stmt->bindValue($identifier, (int) $this->show_in_index, PDO::PARAM_INT);
                     break;
                 case '`PROTOCOLO`':
                     $stmt->bindValue($identifier, (int) $this->protocolo, PDO::PARAM_INT);
                     break;
                 case '`CANCELADA`':
                     $stmt->bindValue($identifier, (int) $this->cancelada, PDO::PARAM_INT);
                     break;
                 case '`CREATED_AT`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`UPDATED_AT`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = Slider_maePeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . Slider_maePeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(Slider_maePeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(Slider_maePeer::ID_LIBRO)) {
         $modifiedColumns[':p' . $index++] = '`ID_LIBRO`';
     }
     if ($this->isColumnModified(Slider_maePeer::POSICION)) {
         $modifiedColumns[':p' . $index++] = '`POSICION`';
     }
     if ($this->isColumnModified(Slider_maePeer::ID_CATEGORIA)) {
         $modifiedColumns[':p' . $index++] = '`ID_CATEGORIA`';
     }
     $sql = sprintf('INSERT INTO `slider_mae` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`ID_LIBRO`':
                     $stmt->bindValue($identifier, $this->id_libro, PDO::PARAM_INT);
                     break;
                 case '`POSICION`':
                     $stmt->bindValue($identifier, $this->posicion, PDO::PARAM_INT);
                     break;
                 case '`ID_CATEGORIA`':
                     $stmt->bindValue($identifier, $this->id_categoria, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #24
0
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = BookPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . BookPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(BookPeer::ISBN)) {
         $modifiedColumns[':p' . $index++] = '`ISBN`';
     }
     if ($this->isColumnModified(BookPeer::TITLE)) {
         $modifiedColumns[':p' . $index++] = '`TITLE`';
     }
     if ($this->isColumnModified(BookPeer::AUTHOR)) {
         $modifiedColumns[':p' . $index++] = '`AUTHOR`';
     }
     if ($this->isColumnModified(BookPeer::PUBLISHER)) {
         $modifiedColumns[':p' . $index++] = '`PUBLISHER`';
     }
     if ($this->isColumnModified(BookPeer::EDITION)) {
         $modifiedColumns[':p' . $index++] = '`EDITION`';
     }
     if ($this->isColumnModified(BookPeer::EDITION_NUM)) {
         $modifiedColumns[':p' . $index++] = '`EDITION_NUM`';
     }
     if ($this->isColumnModified(BookPeer::PUBDATE)) {
         $modifiedColumns[':p' . $index++] = '`PUBDATE`';
     }
     if ($this->isColumnModified(BookPeer::IS_PAPERBACK)) {
         $modifiedColumns[':p' . $index++] = '`IS_PAPERBACK`';
     }
     if ($this->isColumnModified(BookPeer::IMAGE_URL)) {
         $modifiedColumns[':p' . $index++] = '`IMAGE_URL`';
     }
     if ($this->isColumnModified(BookPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(BookPeer::CREATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
     }
     if ($this->isColumnModified(BookPeer::UPDATED_AT)) {
         $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
     }
     $sql = sprintf('INSERT INTO `book` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ISBN`':
                     $stmt->bindValue($identifier, $this->isbn, PDO::PARAM_STR);
                     break;
                 case '`TITLE`':
                     $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                     break;
                 case '`AUTHOR`':
                     $stmt->bindValue($identifier, $this->author, PDO::PARAM_STR);
                     break;
                 case '`PUBLISHER`':
                     $stmt->bindValue($identifier, $this->publisher, PDO::PARAM_STR);
                     break;
                 case '`EDITION`':
                     $stmt->bindValue($identifier, $this->edition, PDO::PARAM_STR);
                     break;
                 case '`EDITION_NUM`':
                     $stmt->bindValue($identifier, $this->edition_num, PDO::PARAM_STR);
                     break;
                 case '`PUBDATE`':
                     $stmt->bindValue($identifier, $this->pubdate, PDO::PARAM_STR);
                     break;
                 case '`IS_PAPERBACK`':
                     $stmt->bindValue($identifier, (int) $this->is_paperback, PDO::PARAM_INT);
                     break;
                 case '`IMAGE_URL`':
                     $stmt->bindValue($identifier, $this->image_url, PDO::PARAM_STR);
                     break;
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`CREATED_AT`':
                     $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
                     break;
                 case '`UPDATED_AT`':
                     $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = VentaPeer::IDVENTA;
     if (null !== $this->idventa) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . VentaPeer::IDVENTA . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(VentaPeer::IDVENTA)) {
         $modifiedColumns[':p' . $index++] = '`IDVENTA`';
     }
     if ($this->isColumnModified(VentaPeer::FECHA)) {
         $modifiedColumns[':p' . $index++] = '`FECHA`';
     }
     if ($this->isColumnModified(VentaPeer::IDCLIENTE)) {
         $modifiedColumns[':p' . $index++] = '`IDCLIENTE`';
     }
     if ($this->isColumnModified(VentaPeer::IDPRODUCTO)) {
         $modifiedColumns[':p' . $index++] = '`IDPRODUCTO`';
     }
     $sql = sprintf('INSERT INTO `venta` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`IDVENTA`':
                     $stmt->bindValue($identifier, $this->idventa, PDO::PARAM_INT);
                     break;
                 case '`FECHA`':
                     $stmt->bindValue($identifier, $this->fecha, PDO::PARAM_STR);
                     break;
                 case '`IDCLIENTE`':
                     $stmt->bindValue($identifier, $this->idcliente, PDO::PARAM_INT);
                     break;
                 case '`IDPRODUCTO`':
                     $stmt->bindValue($identifier, $this->idproducto, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdventa($pk);
     $this->setNew(false);
 }
	/**
	 * Insert the row in the database.
	 *
	 * @param      PropelPDO $con
	 *
	 * @throws     PropelException
	 * @see        doSave()
	 */
	protected function doInsert(PropelPDO $con)
	{
		$modifiedColumns = array();
		$index = 0;

		$this->modifiedColumns[] = EdtHorairesEtablissementPeer::ID_HORAIRE_ETABLISSEMENT;
		if (null !== $this->id_horaire_etablissement) {
			throw new PropelException('Cannot insert a value for auto-increment primary key (' . EdtHorairesEtablissementPeer::ID_HORAIRE_ETABLISSEMENT . ')');
		}

		 // check the columns in natural order for more readable SQL queries
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::ID_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'ID_HORAIRE_ETABLISSEMENT';
		}
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::DATE_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'DATE_HORAIRE_ETABLISSEMENT';
		}
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::JOUR_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'JOUR_HORAIRE_ETABLISSEMENT';
		}
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::OUVERTURE_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'OUVERTURE_HORAIRE_ETABLISSEMENT';
		}
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::FERMETURE_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'FERMETURE_HORAIRE_ETABLISSEMENT';
		}
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::PAUSE_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'PAUSE_HORAIRE_ETABLISSEMENT';
		}
		if ($this->isColumnModified(EdtHorairesEtablissementPeer::OUVERT_HORAIRE_ETABLISSEMENT)) {
			$modifiedColumns[':p' . $index++]  = 'OUVERT_HORAIRE_ETABLISSEMENT';
		}

		$sql = sprintf(
			'INSERT INTO horaires_etablissement (%s) VALUES (%s)',
			implode(', ', $modifiedColumns),
			implode(', ', array_keys($modifiedColumns))
		);

		try {
			$stmt = $con->prepare($sql);
			foreach ($modifiedColumns as $identifier => $columnName) {
				switch ($columnName) {
					case 'ID_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, $this->id_horaire_etablissement, PDO::PARAM_INT);
						break;
					case 'DATE_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, $this->date_horaire_etablissement, PDO::PARAM_STR);
						break;
					case 'JOUR_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, $this->jour_horaire_etablissement, PDO::PARAM_STR);
						break;
					case 'OUVERTURE_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, $this->ouverture_horaire_etablissement, PDO::PARAM_STR);
						break;
					case 'FERMETURE_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, $this->fermeture_horaire_etablissement, PDO::PARAM_STR);
						break;
					case 'PAUSE_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, $this->pause_horaire_etablissement, PDO::PARAM_STR);
						break;
					case 'OUVERT_HORAIRE_ETABLISSEMENT':
						$stmt->bindValue($identifier, (int) $this->ouvert_horaire_etablissement, PDO::PARAM_INT);
						break;
				}
			}
			$stmt->execute();
		} catch (Exception $e) {
			Propel::log($e->getMessage(), Propel::LOG_ERR);
			throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
		}

		try {
			$pk = $con->lastInsertId();
		} catch (Exception $e) {
			throw new PropelException('Unable to get autoincrement id.', $e);
		}
		$this->setIdHoraireEtablissement($pk);

		$this->setNew(false);
	}
 /**
  * Insert the row in the database.
  *
  * @param PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = DetailBarangMasukPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . DetailBarangMasukPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(DetailBarangMasukPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`id`';
     }
     if ($this->isColumnModified(DetailBarangMasukPeer::ID_BARANG_MASUK)) {
         $modifiedColumns[':p' . $index++] = '`id_barang_masuk`';
     }
     if ($this->isColumnModified(DetailBarangMasukPeer::ID_BARANG)) {
         $modifiedColumns[':p' . $index++] = '`id_barang`';
     }
     if ($this->isColumnModified(DetailBarangMasukPeer::HARGA)) {
         $modifiedColumns[':p' . $index++] = '`harga`';
     }
     $sql = sprintf('INSERT INTO `detail_barang_masuk` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`id`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`id_barang_masuk`':
                     $stmt->bindValue($identifier, $this->id_barang_masuk, PDO::PARAM_INT);
                     break;
                 case '`id_barang`':
                     $stmt->bindValue($identifier, $this->id_barang, PDO::PARAM_INT);
                     break;
                 case '`harga`':
                     $stmt->bindValue($identifier, $this->harga, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws     PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = RegistrocompraPeer::IDCOMPRA;
     if (null !== $this->idcompra) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . RegistrocompraPeer::IDCOMPRA . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(RegistrocompraPeer::IDCOMPRA)) {
         $modifiedColumns[':p' . $index++] = '`IDCOMPRA`';
     }
     if ($this->isColumnModified(RegistrocompraPeer::FECHA)) {
         $modifiedColumns[':p' . $index++] = '`FECHA`';
     }
     if ($this->isColumnModified(RegistrocompraPeer::IDPROVEE)) {
         $modifiedColumns[':p' . $index++] = '`IDPROVEE`';
     }
     if ($this->isColumnModified(RegistrocompraPeer::N_FACTURA)) {
         $modifiedColumns[':p' . $index++] = '`N_FACTURA`';
     }
     if ($this->isColumnModified(RegistrocompraPeer::VALOR)) {
         $modifiedColumns[':p' . $index++] = '`VALOR`';
     }
     if ($this->isColumnModified(RegistrocompraPeer::REMITO)) {
         $modifiedColumns[':p' . $index++] = '`REMITO`';
     }
     if ($this->isColumnModified(RegistrocompraPeer::IDEMPLEADO)) {
         $modifiedColumns[':p' . $index++] = '`IDEMPLEADO`';
     }
     $sql = sprintf('INSERT INTO `registroCompra` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`IDCOMPRA`':
                     $stmt->bindValue($identifier, $this->idcompra, PDO::PARAM_INT);
                     break;
                 case '`FECHA`':
                     $stmt->bindValue($identifier, $this->fecha, PDO::PARAM_STR);
                     break;
                 case '`IDPROVEE`':
                     $stmt->bindValue($identifier, $this->idprovee, PDO::PARAM_INT);
                     break;
                 case '`N_FACTURA`':
                     $stmt->bindValue($identifier, $this->n_factura, PDO::PARAM_STR);
                     break;
                 case '`VALOR`':
                     $stmt->bindValue($identifier, $this->valor, PDO::PARAM_STR);
                     break;
                 case '`REMITO`':
                     $stmt->bindValue($identifier, $this->remito, PDO::PARAM_STR);
                     break;
                 case '`IDEMPLEADO`':
                     $stmt->bindValue($identifier, $this->idempleado, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setIdcompra($pk);
     $this->setNew(false);
 }
Example #29
0
 /**
  * Insert the row in the database.
  *
  * @param      PropelPDO $con
  *
  * @throws PropelException
  * @see        doSave()
  */
 protected function doInsert(PropelPDO $con)
 {
     $modifiedColumns = array();
     $index = 0;
     $this->modifiedColumns[] = CountryPeer::ID;
     if (null !== $this->id) {
         throw new PropelException('Cannot insert a value for auto-increment primary key (' . CountryPeer::ID . ')');
     }
     // check the columns in natural order for more readable SQL queries
     if ($this->isColumnModified(CountryPeer::ID)) {
         $modifiedColumns[':p' . $index++] = '`ID`';
     }
     if ($this->isColumnModified(CountryPeer::NAME)) {
         $modifiedColumns[':p' . $index++] = '`NAME`';
     }
     if ($this->isColumnModified(CountryPeer::ISO_CODE)) {
         $modifiedColumns[':p' . $index++] = '`ISO_CODE`';
     }
     if ($this->isColumnModified(CountryPeer::ISO_SHORT_CODE)) {
         $modifiedColumns[':p' . $index++] = '`ISO_SHORT_CODE`';
     }
     if ($this->isColumnModified(CountryPeer::DEMONYM)) {
         $modifiedColumns[':p' . $index++] = '`DEMONYM`';
     }
     if ($this->isColumnModified(CountryPeer::DEFAULT_CURRENCY_ID)) {
         $modifiedColumns[':p' . $index++] = '`DEFAULT_CURRENCY_ID`';
     }
     $sql = sprintf('INSERT INTO `country` (%s) VALUES (%s)', implode(', ', $modifiedColumns), implode(', ', array_keys($modifiedColumns)));
     try {
         $stmt = $con->prepare($sql);
         foreach ($modifiedColumns as $identifier => $columnName) {
             switch ($columnName) {
                 case '`ID`':
                     $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                     break;
                 case '`NAME`':
                     $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                     break;
                 case '`ISO_CODE`':
                     $stmt->bindValue($identifier, $this->iso_code, PDO::PARAM_STR);
                     break;
                 case '`ISO_SHORT_CODE`':
                     $stmt->bindValue($identifier, $this->iso_short_code, PDO::PARAM_STR);
                     break;
                 case '`DEMONYM`':
                     $stmt->bindValue($identifier, $this->demonym, PDO::PARAM_STR);
                     break;
                 case '`DEFAULT_CURRENCY_ID`':
                     $stmt->bindValue($identifier, $this->default_currency_id, PDO::PARAM_INT);
                     break;
             }
         }
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
     }
     try {
         $pk = $con->lastInsertId();
     } catch (Exception $e) {
         throw new PropelException('Unable to get autoincrement id.', $e);
     }
     $this->setId($pk);
     $this->setNew(false);
 }
Example #30
0
	/**
	 * Insert the row in the database.
	 *
	 * @param      PropelPDO $con
	 *
	 * @throws     PropelException
	 * @see        doSave()
	 */
	protected function doInsert(PropelPDO $con)
	{
		$modifiedColumns = array();
		$index = 0;

		$this->modifiedColumns[] = ElevePeer::ID_ELEVE;
		if (null !== $this->id_eleve) {
			throw new PropelException('Cannot insert a value for auto-increment primary key (' . ElevePeer::ID_ELEVE . ')');
		}

		 // check the columns in natural order for more readable SQL queries
		if ($this->isColumnModified(ElevePeer::NO_GEP)) {
			$modifiedColumns[':p' . $index++]  = 'NO_GEP';
		}
		if ($this->isColumnModified(ElevePeer::LOGIN)) {
			$modifiedColumns[':p' . $index++]  = 'LOGIN';
		}
		if ($this->isColumnModified(ElevePeer::NOM)) {
			$modifiedColumns[':p' . $index++]  = 'NOM';
		}
		if ($this->isColumnModified(ElevePeer::PRENOM)) {
			$modifiedColumns[':p' . $index++]  = 'PRENOM';
		}
		if ($this->isColumnModified(ElevePeer::SEXE)) {
			$modifiedColumns[':p' . $index++]  = 'SEXE';
		}
		if ($this->isColumnModified(ElevePeer::NAISSANCE)) {
			$modifiedColumns[':p' . $index++]  = 'NAISSANCE';
		}
		if ($this->isColumnModified(ElevePeer::LIEU_NAISSANCE)) {
			$modifiedColumns[':p' . $index++]  = 'LIEU_NAISSANCE';
		}
		if ($this->isColumnModified(ElevePeer::ELENOET)) {
			$modifiedColumns[':p' . $index++]  = 'ELENOET';
		}
		if ($this->isColumnModified(ElevePeer::ERENO)) {
			$modifiedColumns[':p' . $index++]  = 'ERENO';
		}
		if ($this->isColumnModified(ElevePeer::ELE_ID)) {
			$modifiedColumns[':p' . $index++]  = 'ELE_ID';
		}
		if ($this->isColumnModified(ElevePeer::EMAIL)) {
			$modifiedColumns[':p' . $index++]  = 'EMAIL';
		}
		if ($this->isColumnModified(ElevePeer::ID_ELEVE)) {
			$modifiedColumns[':p' . $index++]  = 'ID_ELEVE';
		}
		if ($this->isColumnModified(ElevePeer::DATE_SORTIE)) {
			$modifiedColumns[':p' . $index++]  = 'DATE_SORTIE';
		}
		if ($this->isColumnModified(ElevePeer::MEF_CODE)) {
			$modifiedColumns[':p' . $index++]  = 'MEF_CODE';
		}

		$sql = sprintf(
			'INSERT INTO eleves (%s) VALUES (%s)',
			implode(', ', $modifiedColumns),
			implode(', ', array_keys($modifiedColumns))
		);

		try {
			$stmt = $con->prepare($sql);
			foreach ($modifiedColumns as $identifier => $columnName) {
				switch ($columnName) {
					case 'NO_GEP':
						$stmt->bindValue($identifier, $this->no_gep, PDO::PARAM_STR);
						break;
					case 'LOGIN':
						$stmt->bindValue($identifier, $this->login, PDO::PARAM_STR);
						break;
					case 'NOM':
						$stmt->bindValue($identifier, $this->nom, PDO::PARAM_STR);
						break;
					case 'PRENOM':
						$stmt->bindValue($identifier, $this->prenom, PDO::PARAM_STR);
						break;
					case 'SEXE':
						$stmt->bindValue($identifier, $this->sexe, PDO::PARAM_STR);
						break;
					case 'NAISSANCE':
						$stmt->bindValue($identifier, $this->naissance, PDO::PARAM_STR);
						break;
					case 'LIEU_NAISSANCE':
						$stmt->bindValue($identifier, $this->lieu_naissance, PDO::PARAM_STR);
						break;
					case 'ELENOET':
						$stmt->bindValue($identifier, $this->elenoet, PDO::PARAM_STR);
						break;
					case 'ERENO':
						$stmt->bindValue($identifier, $this->ereno, PDO::PARAM_STR);
						break;
					case 'ELE_ID':
						$stmt->bindValue($identifier, $this->ele_id, PDO::PARAM_STR);
						break;
					case 'EMAIL':
						$stmt->bindValue($identifier, $this->email, PDO::PARAM_STR);
						break;
					case 'ID_ELEVE':
						$stmt->bindValue($identifier, $this->id_eleve, PDO::PARAM_INT);
						break;
					case 'DATE_SORTIE':
						$stmt->bindValue($identifier, $this->date_sortie, PDO::PARAM_STR);
						break;
					case 'MEF_CODE':
						$stmt->bindValue($identifier, $this->mef_code, PDO::PARAM_INT);
						break;
				}
			}
			$stmt->execute();
		} catch (Exception $e) {
			Propel::log($e->getMessage(), Propel::LOG_ERR);
			throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
		}

		try {
			$pk = $con->lastInsertId();
		} catch (Exception $e) {
			throw new PropelException('Unable to get autoincrement id.', $e);
		}
		$this->setId($pk);

		$this->setNew(false);
	}