summaryrefslogtreecommitdiff
path: root/app/Api/Link.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-16 21:07:29 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-16 21:07:29 -0400
commitb1e2ca00ce7375ffcbe5e927135c8892036e6bd6 (patch)
tree07ce453261f6493de7c901cfd8b4f0d9af85556d /app/Api/Link.php
parent4514bc1d4b4abff23902e46da76e70f13a3647eb (diff)
Rename Api classes
Diffstat (limited to 'app/Api/Link.php')
-rw-r--r--app/Api/Link.php111
1 files changed, 0 insertions, 111 deletions
diff --git a/app/Api/Link.php b/app/Api/Link.php
deleted file mode 100644
index 23a9916d..00000000
--- a/app/Api/Link.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-namespace Kanboard\Api;
-
-/**
- * Link API controller
- *
- * @package api
- * @author Frederic Guillot
- */
-class Link extends \Kanboard\Core\Base
-{
- /**
- * Get a link by id
- *
- * @access public
- * @param integer $link_id Link id
- * @return array
- */
- public function getLinkById($link_id)
- {
- return $this->link->getById($link_id);
- }
-
- /**
- * Get a link by name
- *
- * @access public
- * @param string $label
- * @return array
- */
- public function getLinkByLabel($label)
- {
- return $this->link->getByLabel($label);
- }
-
- /**
- * Get the opposite link id
- *
- * @access public
- * @param integer $link_id Link id
- * @return integer
- */
- public function getOppositeLinkId($link_id)
- {
- return $this->link->getOppositeLinkId($link_id);
- }
-
- /**
- * Get all links
- *
- * @access public
- * @return array
- */
- public function getAllLinks()
- {
- return $this->link->getAll();
- }
-
- /**
- * Create a new link label
- *
- * @access public
- * @param string $label
- * @param string $opposite_label
- * @return boolean|integer
- */
- public function createLink($label, $opposite_label = '')
- {
- $values = array(
- 'label' => $label,
- 'opposite_label' => $opposite_label,
- );
-
- list($valid, ) = $this->linkValidator->validateCreation($values);
- return $valid ? $this->link->create($label, $opposite_label) : false;
- }
-
- /**
- * Update a link
- *
- * @access public
- * @param integer $link_id
- * @param integer $opposite_link_id
- * @param string $label
- * @return boolean
- */
- public function updateLink($link_id, $opposite_link_id, $label)
- {
- $values = array(
- 'id' => $link_id,
- 'opposite_id' => $opposite_link_id,
- 'label' => $label,
- );
-
- list($valid, ) = $this->linkValidator->validateModification($values);
- return $valid && $this->link->update($values);
- }
-
- /**
- * Remove a link a the relation to its opposite
- *
- * @access public
- * @param integer $link_id
- * @return boolean
- */
- public function removeLink($link_id)
- {
- return $this->link->remove($link_id);
- }
-}