* {"name"="username", "dataType"="string", "required"=true, "description"="username"}
* }
* )
+ *
* @return array
*/
public function getSaltAction($username)
* {"name"="tags", "dataType"="string", "required"=false, "format"="api%2Crest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."},
* }
* )
+ *
* @return Entry
*/
public function getEntriesAction(Request $request)
}
/**
- * Retrieve a single entry
+ * Retrieve a single entry.
*
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
+ *
* @return Entry
*/
public function getEntryAction(Entry $entry)
}
/**
- * Create an entry
+ * Create an entry.
*
* @ApiDoc(
* parameters={
* {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
* }
* )
+ *
* @return Entry
*/
public function postEntriesAction(Request $request)
}
/**
- * Change several properties of an entry
+ * Change several properties of an entry.
*
* @ApiDoc(
* requirements={
* {"name"="star", "dataType"="boolean", "required"=false, "format"="true or false", "description"="starred the entry."},
* }
* )
+ *
* @return Entry
*/
public function patchEntriesAction(Entry $entry, Request $request)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
- $title = $request->request->get("title");
- $isArchived = $request->request->get("archive");
- $isStarred = $request->request->get("star");
+ $title = $request->request->get('title');
+ $isArchived = $request->request->get('archive');
+ $isStarred = $request->request->get('star');
if (!is_null($title)) {
$entry->setTitle($title);
}
/**
- * Delete **permanently** an entry
+ * Delete **permanently** an entry.
*
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
+ *
* @return Entry
*/
public function deleteEntriesAction(Entry $entry)
}
/**
- * Retrieve all tags for an entry
+ * Retrieve all tags for an entry.
*
* @ApiDoc(
* requirements={
}
/**
- * Add one or more tags to an entry
+ * Add one or more tags to an entry.
*
* @ApiDoc(
* requirements={
}
/**
- * Permanently remove one tag for an entry
+ * Permanently remove one tag for an entry.
*
* @ApiDoc(
* requirements={
}
/**
- * Retrieve all tags
+ * Retrieve all tags.
*
* @ApiDoc()
*/
}
/**
- * Permanently remove one tag from **every** entry
+ * Permanently remove one tag from **every** entry.
*
* @ApiDoc(
* requirements={
/**
* Validate that the first id is equal to the second one.
- * If not, throw exception. It means a user try to access information from an other user
+ * If not, throw exception. It means a user try to access information from an other user.
*
- * @param integer $requestUserId User id from the requested source
- * @param integer $currentUserId User id from the retrieved source
+ * @param int $requestUserId User id from the requested source
+ * @param int $currentUserId User id from the retrieved source
*/
private function validateUserAccess($requestUserId, $currentUserId)
{
/**
* Send a JSON Response.
- * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string
+ * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string.
*
* @param string $json
*