public function destroy() { // poista kommentit Comment::delete_all_from_recipe($this->id); //poista ainesosat Ingredient::delete_from_recipe($this->id); Ingredient::delete_unused(); //poista avainsanat Keyword::delete_junctions($this->id); Keyword::delete_unused(); $query = DB::connection()->prepare("DELETE FROM Recipe WHERE id = :id"); $query->execute(array('id' => $this->id)); }