public function save(NewRSS $news) { $statement = "INSERT INTO news_rss (title, link, position) VALUES (:title, :link, :position)"; try { $position = $this->total() + 1; $query = $this->session->prepare($statement); $query->bindParam(":title", $news->title()); $query->bindParam(":link", $news->link()); $query->bindParam(":position", $position); $query->execute(); } catch (PDOException $err) { throw new PDOException($err->getMessage()); } }