예제 #1
0
 /**
  * Insert large object from stream
  *
  * @access public
  * @param  string           $blobColumn
  * @param  resource|string  $blobDescriptor
  * @param  array            $data
  * @return bool
  */
 public function insertFromStream($blobColumn, &$blobDescriptor, array $data = array())
 {
     $columns = array_merge(array($blobColumn), array_keys($data));
     $this->db->startTransaction();
     $result = $this->db->getStatementHandler()->withSql(InsertBuilder::getInstance($this->db, $this->conditionBuilder)->withTable($this->name)->withColumns($columns)->build())->withNamedParams($data)->withLobParam($blobColumn, $blobDescriptor)->execute();
     $this->db->closeTransaction();
     return $result !== false;
 }
예제 #2
0
파일: Table.php 프로젝트: fguillot/picodb
 /**
  * Insert
  *
  * @access public
  * @param  array    $data
  * @return boolean
  */
 public function insert(array $data)
 {
     return $this->db->getStatementHandler()->withSql(InsertBuilder::getInstance($this->db, $this->conditionBuilder)->withTable($this->name)->withColumns(array_keys($data))->build())->withNamedParams($data)->execute() !== false;
 }