This commit is contained in:
Romain Neutron
2012-04-26 00:55:53 +02:00
parent edbfff226e
commit ade22295ad
631 changed files with 92375 additions and 101763 deletions

View File

@@ -18,46 +18,45 @@
class Feed_TokenAggregate extends Feed_Token
{
/**
*
* @param appbox $appbox
* @param string $token
* @return Feed_TokenAggregate
*/
public function __construct(appbox &$appbox, $token)
{
/**
*
* @param appbox $appbox
* @param string $token
* @return Feed_TokenAggregate
*/
public function __construct(appbox &$appbox, $token)
{
$sql = 'SELECT usr_id FROM feed_tokens
$sql = 'SELECT usr_id FROM feed_tokens
WHERE aggregated = "1" AND token = :token';
$params = array(
':token' => $token
);
$params = array(
':token' => $token
);
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute($params);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
if (!$row)
throw new Exception_FeedNotFound($token);
if ( ! $row)
throw new Exception_FeedNotFound($token);
$this->usr_id = $row['usr_id'];
$this->appbox = $appbox;
$this->usr_id = $row['usr_id'];
$this->appbox = $appbox;
return $this;
}
return $this;
}
/**
*
* @return Feed_Aggregate
*/
public function get_feed()
{
if (!$this->feed)
$this->feed = Feed_Aggregate::load_with_user($this->appbox, $this->get_user());
return $this->feed;
}
/**
*
* @return Feed_Aggregate
*/
public function get_feed()
{
if ( ! $this->feed)
$this->feed = Feed_Aggregate::load_with_user($this->appbox, $this->get_user());
return $this->feed;
}
}