/** * 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; }
/** * 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; }