From 16e3d006e9e9386001881053f610657525feb188 Mon Sep 17 00:00:00 2001
From: ArthurHoaro <arthur@hoa.ro>
Date: Sat, 24 Dec 2016 10:30:21 +0100
Subject: REST API: implements getLink by ID service

See http://shaarli.github.io/api-documentation/#links-link-get
---
 .../api/exceptions/ApiLinkNotFoundException.php    | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 application/api/exceptions/ApiLinkNotFoundException.php

(limited to 'application/api/exceptions/ApiLinkNotFoundException.php')

diff --git a/application/api/exceptions/ApiLinkNotFoundException.php b/application/api/exceptions/ApiLinkNotFoundException.php
new file mode 100644
index 00000000..de7e14f5
--- /dev/null
+++ b/application/api/exceptions/ApiLinkNotFoundException.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace Shaarli\Api\Exceptions;
+
+
+use Slim\Http\Response;
+
+/**
+ * Class ApiLinkNotFoundException
+ *
+ * Link selected by ID couldn't be found, results in a 404 error.
+ *
+ * @package Shaarli\Api\Exceptions
+ */
+class ApiLinkNotFoundException extends ApiException
+{
+    /**
+     * ApiLinkNotFoundException constructor.
+     */
+    public function __construct()
+    {
+        $this->message = 'Link not found';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getApiResponse()
+    {
+        return $this->buildApiResponse(404);
+    }
+}
-- 
cgit v1.2.3