$feed_id , ':token' => $token ); $stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql); $stmt->execute($params); $row = $stmt->fetch(PDO::FETCH_ASSOC); $stmt->closeCursor(); if ( ! $row) throw new NotFoundHttpException('Feed not found.'); $this->feed_id = (int) $row['feed_id']; $this->usr_id = (int) $row['usr_id']; $this->app = $app; return $this; } /** * * @return User_Adapter */ public function get_user() { if ( ! $this->user) $this->user = User_Adapter::getInstance($this->usr_id, $this->app); return $this->user; } /** * * @return Feed_Adapter */ public function get_feed() { if ( ! $this->feed) $this->feed = Feed_Adapter::load_with_user($this->app, $this->get_user(), $this->feed_id); return $this->feed; } }