/** * Inserts an entity to the given table and returns the ID of inserted row. * @param string $table Name of the table. * @param BaseEntity $entity The entity to be inserted. * @return string The ID of the last inserted row or sequence value. */ public function insertEntity($table, $entity) { $entity->preInsert(); return $this->insert($table, $entity->toArray()); }