add /developers/ route

This commit is contained in:
Nicolas Le Goff
2012-07-13 16:52:15 +02:00
committed by Ysolyne Gresille
parent 07795e873e
commit 6cb75ecec5
20 changed files with 1635 additions and 935 deletions

View File

@@ -281,8 +281,9 @@ class API_OAuth2_Account
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
if ( ! $row)
if ( ! $row) {
throw new Exception_NotFound();
}
return new self($appbox, $row['api_account_id']);
}

View File

@@ -145,6 +145,11 @@ class API_OAuth2_Application
$stmt = $this->appbox->get_connection()->prepare($sql);
$stmt->execute(array(':application_id' => $this->id));
if (0 === $stmt->rowCount()) {
throw new \Exception_NotFound(sprintf('Application with id %d not found', $this->id));
}
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
$this->creator = ! $row['creator'] ? null : User_Adapter::getInstance($row['creator'], $this->appbox);