Remove unused variables
This commit is contained in:
@@ -75,7 +75,7 @@ class BoardController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function read($boardId) {
|
||||
return $this->boardService->find($this->userId, $boardId);
|
||||
return $this->boardService->find($boardId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ class BoardController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function update($id, $title, $color) {
|
||||
return $this->boardService->update($id, $title, $this->userId, $color);
|
||||
return $this->boardService->update($id, $title, $color);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ class BoardController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($boardId) {
|
||||
return $this->boardService->delete($this->userId, $boardId);
|
||||
return $this->boardService->delete($boardId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ class CardController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function read($cardId) {
|
||||
return $this->cardService->find($this->userId, $cardId);
|
||||
return $this->cardService->find($cardId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ class CardController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($cardId) {
|
||||
return $this->cardService->delete($this->userId, $cardId);
|
||||
return $this->cardService->delete($cardId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ class CardController extends Controller {
|
||||
* @param $labelId
|
||||
*/
|
||||
public function assignLabel($cardId, $labelId) {
|
||||
return $this->cardService->assignLabel($this->userId, $cardId, $labelId);
|
||||
return $this->cardService->assignLabel($cardId, $labelId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +148,7 @@ class CardController extends Controller {
|
||||
* @param $labelId
|
||||
*/
|
||||
public function removeLabel($cardId, $labelId) {
|
||||
return $this->cardService->removeLabel($this->userId, $cardId, $labelId);
|
||||
return $this->cardService->removeLabel($cardId, $labelId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class LabelController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function create($title, $color, $boardId) {
|
||||
return $this->labelService->create($title, $this->userId, $color, $boardId);
|
||||
return $this->labelService->create($title, $color, $boardId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,7 +63,7 @@ class LabelController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function update($id, $title, $color) {
|
||||
return $this->labelService->update($id, $title, $this->userId, $color);
|
||||
return $this->labelService->update($id, $title, $color);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ class LabelController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($labelId) {
|
||||
return $this->labelService->delete($this->userId, $labelId);
|
||||
return $this->labelService->delete($labelId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -104,6 +104,6 @@ class StackController extends Controller {
|
||||
* @return \OCP\AppFramework\Db\Entity
|
||||
*/
|
||||
public function delete($stackId) {
|
||||
return $this->stackService->delete($this->userId, $stackId);
|
||||
return $this->stackService->delete($stackId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ class BoardMapper extends DeckMapper implements IPermissionMapper {
|
||||
$sql = 'SELECT boards.id, title, owner, color, archived, 2 as shared FROM oc_deck_boards as boards ' .
|
||||
'INNER JOIN oc_deck_board_acl as acl ON boards.id=acl.board_id WHERE owner != ? AND type=\'group\' AND (';
|
||||
$countGroups = 0;
|
||||
// FIXME: group unused?
|
||||
foreach ($groups as $group) {
|
||||
$sql .= 'acl.participant = ? ';
|
||||
if(count($groups)>1 && $countGroups++<count($groups)-1)
|
||||
|
||||
@@ -50,6 +50,7 @@ abstract class DeckMapper extends Mapper {
|
||||
}
|
||||
|
||||
protected function execute($sql, array $params = [], $limit = null, $offset = null) {
|
||||
// FIXME: remove on release
|
||||
\OCP\Util::writeLog('deck', "DeckMapper SQL: " . $sql, \OCP\Util::DEBUG);
|
||||
return parent::execute($sql, $params, $limit, $offset);
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ class LabelMapper extends DeckMapper implements IPermissionMapper {
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function deleteLabelAssignments($labelId, $limit=null, $offset=null) {
|
||||
public function deleteLabelAssignments($labelId) {
|
||||
$sql = 'DELETE FROM `*PREFIX*deck_assigned_labels` WHERE label_id = ?';
|
||||
$stmt = $this->db->prepare($sql);
|
||||
$stmt->bindParam(1, $labelId, \PDO::PARAM_INT);
|
||||
$stmt->execute();
|
||||
}
|
||||
|
||||
public function deleteLabelAssignmentsForCard($cardId, $limit=null, $offset=null) {
|
||||
public function deleteLabelAssignmentsForCard($cardId) {
|
||||
$sql = 'DELETE FROM `*PREFIX*deck_assigned_labels` WHERE card_id = ?';
|
||||
$stmt = $this->db->prepare($sql);
|
||||
$stmt->bindParam(1, $cardId, \PDO::PARAM_INT);
|
||||
|
||||
@@ -61,7 +61,7 @@ class BoardService {
|
||||
return array_merge($userBoards, $groupBoards);
|
||||
}
|
||||
|
||||
public function find($userId, $boardId) {
|
||||
public function find($boardId) {
|
||||
$board = $this->boardMapper->find($boardId);
|
||||
return $board;
|
||||
}
|
||||
@@ -92,12 +92,12 @@ class BoardService {
|
||||
|
||||
}
|
||||
|
||||
public function delete($userId, $id) {
|
||||
return $this->boardMapper->delete($this->find($userId, $id));
|
||||
public function delete($id) {
|
||||
return $this->boardMapper->delete($this->find($id));
|
||||
}
|
||||
|
||||
public function update($id, $title, $userId, $color) {
|
||||
$board = $this->find($userId, $id);
|
||||
public function update($id, $title, $color) {
|
||||
$board = $this->find($id);
|
||||
$board->setTitle($title);
|
||||
$board->setColor($color);
|
||||
return $this->boardMapper->update($board);
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
|
||||
namespace OCA\Deck\Service;
|
||||
|
||||
|
||||
|
||||
|
||||
use \OCA\Deck\Db\Card;
|
||||
use \OCA\Deck\Db\CardMapper;
|
||||
use \OCA\Deck\CardArchivedException;
|
||||
@@ -35,12 +32,11 @@ class CardService {
|
||||
|
||||
private $cardMapper;
|
||||
|
||||
|
||||
public function __construct(CardMapper $cardMapper) {
|
||||
$this->cardMapper = $cardMapper;
|
||||
}
|
||||
|
||||
public function find($userId, $cardId) {
|
||||
public function find($cardId) {
|
||||
return $this->cardMapper->find($cardId);
|
||||
}
|
||||
public function create($title, $stackId, $type, $order, $owner) {
|
||||
@@ -54,7 +50,7 @@ class CardService {
|
||||
|
||||
}
|
||||
|
||||
public function delete($userId, $id) {
|
||||
public function delete($id) {
|
||||
return $this->cardMapper->delete($this->cardMapper->find($id));
|
||||
}
|
||||
|
||||
@@ -117,7 +113,7 @@ class CardService {
|
||||
return $this->cardMapper->update($card);
|
||||
}
|
||||
|
||||
public function assignLabel($userId, $cardId, $labelId) {
|
||||
public function assignLabel($cardId, $labelId) {
|
||||
$card = $this->cardMapper->find($cardId);
|
||||
if($card->getArchived()) {
|
||||
throw new CardArchivedException();
|
||||
@@ -125,7 +121,7 @@ class CardService {
|
||||
$this->cardMapper->assignLabel($cardId, $labelId);
|
||||
}
|
||||
|
||||
public function removeLabel($userId, $cardId, $labelId) {
|
||||
public function removeLabel($cardId, $labelId) {
|
||||
$card = $this->cardMapper->find($cardId);
|
||||
if($card->getArchived()) {
|
||||
throw new CardArchivedException();
|
||||
|
||||
@@ -43,12 +43,12 @@ class LabelService {
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function find($userId, $labelId) {
|
||||
public function find($labelId) {
|
||||
$label = $this->labelMapper->find($labelId);
|
||||
return $label;
|
||||
}
|
||||
|
||||
public function create($title, $userId, $color, $boardId) {
|
||||
public function create($title, $color, $boardId) {
|
||||
$label = new Label();
|
||||
$label->setTitle($title);
|
||||
$label->setColor($color);
|
||||
@@ -56,12 +56,12 @@ class LabelService {
|
||||
return $this->labelMapper->insert($label);
|
||||
}
|
||||
|
||||
public function delete($userId, $id) {
|
||||
return $this->labelMapper->delete($this->find($userId, $id));
|
||||
public function delete($id) {
|
||||
return $this->labelMapper->delete($this->find($id));
|
||||
}
|
||||
|
||||
public function update($id, $title, $userId, $color) {
|
||||
$label = $this->find($userId, $id);
|
||||
public function update($id, $title, $color) {
|
||||
$label = $this->find($id);
|
||||
$label->setTitle($title);
|
||||
$label->setColor($color);
|
||||
return $this->labelMapper->update($label);
|
||||
|
||||
@@ -90,7 +90,7 @@ class StackService {
|
||||
|
||||
}
|
||||
|
||||
public function delete($userId, $id) {
|
||||
public function delete($id) {
|
||||
return $this->stackMapper->delete($this->stackMapper->find($id));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user