/** * @param string $table The table to insert into * @param array $data The data to add * @return int The id of the last inserted row */ public function insert($table, array $data) { $query = Peyote::insert($table)->columns(\array_keys($data))->values(\array_values($data)); $this->runQuery($query); return (int) $this->pdo->lastInsertId(); }
public function testInsert() { $this->assertInstanceOf("\\Peyote\\Insert", Peyote::insert('test')); }