Daniia/Daniia.php
final public function insertGetId(array $datas) {
      $this->connection();
      $this->last_id = NULL;
      if ( $this->driver=='pgsql' ) {
         $this->insert( $datas, TRUE );
         if ( @$this->data[0] ) {
            $this->last_id = @$this->data[0]->{$this->primaryKey};
         }
      }
      else {
         $this->insert( $datas );
         $this->last_id = $this->id_conn->lastInsertId();
      }
      return (int) $this->last_id;
   }
final public function insertGetId(array $datas) {
      $this->connection();
      $this->last_id = NULL;
      if ( $this->driver=='pgsql' ) {
         $this->insert( $datas, TRUE );
         if ( @$this->data[0] ) {
            $this->last_id = @$this->data[0]->{$this->primaryKey};
         }
      }
      else {
         $this->insert( $datas );
         $this->last_id = $this->id_conn->lastInsertId();
      }
      return (int) $this->last_id;
   }
final public function insertGetId ( array $ datas ) { $ this -> connection ( ) ; $ this -> last_id = NULL ; if ( $ this -> driver == 'pgsql' ) { $ this -> insert ( $ datas , TRUE ) ; if ( @ $ this -> data [ 0 ] ) { $ this -> last_id = @ $ this -> data [ 0 ] -> { $ this -> primaryKey } ; } } else { $ this -> insert ( $ datas ) ; $ this -> last_id = $ this -> id_conn -> lastInsertId ( ) ; } return ( int ) $ this -> last_id ; }
inserta y luego retorna la clave primaria del registro
@author Carlos Garcia
@param $datas Array
@return integer
inserta y luego retorna la clave primaria del registro