/** * Insert data * @param $data * @param $table * @return mixed */ protected function _insert($data, $table) { $result = $this->_multiInsert(array($data), $table); if ($result) { return $this->_db->insertid(); } return 0; }
/** * Returns the ID generated from the previous insert operation * * @return int */ public function insertid() { return $this->db->insertid(); }
/** * Test the JDatabaseMySQLi::query() method * * @return void * * @since 11.4 */ public function testQuery() { $this->object->setQuery("REPLACE INTO `jos_dbtest` SET `id` = 5, `title` = 'testTitle'"); $this->assertThat($this->object->query(), $this->isTrue(), __LINE__); $this->assertThat($this->object->insertid(), $this->equalTo(5), __LINE__); }