public function columns_without_default_content();
/** * Inserts the according default content into the given table. * * @param Table $table Table object. * * @return void */ private function insert_default_content(Table $table) { $table_name = $table->name(); // Bail if the table is not empty. if ($this->db->query("SELECT 1 FROM {$table_name} LIMIT 1")) { return; } $default_content = $table->default_content_sql(); if (empty($default_content)) { return; } $columns = array_keys($table->schema()); $columns = array_diff($columns, $table->columns_without_default_content()); $columns = implode(',', $columns); $this->db->query("INSERT INTO {$table_name} ({$columns}) VALUES {$default_content}"); }