diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 3a23377..f81872b 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -90,8 +90,8 @@ final class ApiController extends Controller $card->description = Markdown::parse((string) ($request->getData('plain') ?? '')); $card->style = (string) ($request->getData('style') ?? ''); $card->setColumn((int) $request->getData('column')); - $card->setOrder((int) ($request->getData('order') ?? 1)); - $card->setRef((int) ($request->getData('ref') ?? 0)); + $card->order = (int) ($request->getData('order') ?? 1); + $card->ref = (int) ($request->getData('ref') ?? 0); $card->setStatus((int) ($request->getData('status') ?? CardStatus::ACTIVE)); $card->setType((int) ($request->getData('type') ?? CardType::TEXT)); $card->createdBy = new NullAccount($request->header->account); @@ -289,7 +289,7 @@ final class ApiController extends Controller $board->name = (string) $request->getData('title'); $board->description = Markdown::parse((string) ($request->getData('plain') ?? '')); $board->descriptionRaw = (string) ($request->getData('plain') ?? ''); - $board->setOrder((int) ($request->getData('order') ?? 1)); + $board->order = (int) ($request->getData('order') ?? 1); $board->setStatus((int) ($request->getData('status') ?? BoardStatus::ACTIVE)); $board->createdBy = new NullAccount($request->header->account); @@ -374,7 +374,7 @@ final class ApiController extends Controller $board->name = $request->getData('title') ?? $board->name; $board->description = Markdown::parse((string) ($request->getData('plain') ?? $board->descriptionRaw)); $board->descriptionRaw = (string) ($request->getData('plain') ?? $board->descriptionRaw); - $board->setOrder((int) ($request->getData('order') ?? $board->order)); + $board->order = (int) ($request->getData('order') ?? $board->order); $board->setStatus((int) ($request->getData('status') ?? $board->getStatus())); $board->style = (string) ($request->getData('style') ?? $board->style); @@ -422,7 +422,7 @@ final class ApiController extends Controller $column = new KanbanColumn(); $column->name = (string) $request->getData('title'); $column->setBoard((int) $request->getData('board')); - $column->setOrder((int) ($request->getData('order') ?? 1)); + $column->order = (int) ($request->getData('order') ?? 1); return $column; } diff --git a/Models/KanbanCard.php b/Models/KanbanCard.php index b6876f1..21470d8 100755 --- a/Models/KanbanCard.php +++ b/Models/KanbanCard.php @@ -126,7 +126,7 @@ class KanbanCard implements \JsonSerializable * @var int * @since 1.0.0 */ - private int $ref = 0; + public int $ref = 0; /** * Created by. @@ -261,32 +261,6 @@ class KanbanCard implements \JsonSerializable $this->type = $type; } - /** - * Get the reference if the card references another object (e.g. task, calendar etc.) - * - * @return int - * - * @since 1.0.0 - */ - public function getRef() : int - { - return $this->ref; - } - - /** - * Set the reference - * - * @param int $ref Reference - * - * @return void - * - * @since 1.0.0 - */ - public function setRef(int $ref) : void - { - $this->ref = $ref; - } - /** * Count the amount of comments in a card * diff --git a/Models/KanbanColumn.php b/Models/KanbanColumn.php index 77dd840..eb619f3 100755 --- a/Models/KanbanColumn.php +++ b/Models/KanbanColumn.php @@ -46,7 +46,7 @@ class KanbanColumn implements \JsonSerializable * @var int * @since 1.0.0 */ - private int $order = 0; + public int $order = 0; /** * Board. @@ -76,32 +76,6 @@ class KanbanColumn implements \JsonSerializable return $this->id; } - /** - * Get the order - * - * @return int - * - * @since 1.0.0 - */ - public function getOrder() : int - { - return $this->order; - } - - /** - * Set the order - * - * @param int $order Order - * - * @return void - * - * @since 1.0.0 - */ - public function setOrder(int $order) : void - { - $this->order = $order; - } - /** * Get the board this column belongs to * diff --git a/tests/Models/3KanbanColumnMapperTest.php b/tests/Models/3KanbanColumnMapperTest.php index 353edd2..af052f6 100755 --- a/tests/Models/3KanbanColumnMapperTest.php +++ b/tests/Models/3KanbanColumnMapperTest.php @@ -33,7 +33,7 @@ class KanbanColumnMapperTest extends \PHPUnit\Framework\TestCase $column->name = 'Some Column'; $column->setBoard(1); - $column->setOrder(1); + $column->order = 1; $id = KanbanColumnMapper::create($column); self::assertGreaterThan(0, $column->getId()); @@ -58,7 +58,7 @@ class KanbanColumnMapperTest extends \PHPUnit\Framework\TestCase $column->name = $text->generateText(\mt_rand(3, 7)); $column->setBoard(1); - $column->setOrder($i + 1); + $column->order = $i + 1; $id = KanbanColumnMapper::create($column); } diff --git a/tests/Models/4KanbanCardMapperTest.php b/tests/Models/4KanbanCardMapperTest.php index ba1f29d..fcafd3d 100755 --- a/tests/Models/4KanbanCardMapperTest.php +++ b/tests/Models/4KanbanCardMapperTest.php @@ -40,7 +40,7 @@ class KanbanCardMapperTest extends \PHPUnit\Framework\TestCase $card->description = 'This is some card description'; $card->setStatus(CardStatus::ACTIVE); $card->setType(CardType::TEXT); - $card->setOrder(1); + $card->order = 1; $card->setColumn(1); $card->createdBy = new NullAccount(1); $card->addTag(new Tag()); @@ -73,7 +73,7 @@ class KanbanCardMapperTest extends \PHPUnit\Framework\TestCase $card->setStatus(CardStatus::ACTIVE); $card->setType(CardType::TASK); $card->setRef(1); - $card->setOrder(1); + $card->order = 1; $card->setColumn(1); $card->createdBy = new NullAccount(1); $card->addTag(new Tag()); @@ -99,7 +99,7 @@ class KanbanCardMapperTest extends \PHPUnit\Framework\TestCase $card->description = $text->generateText(\mt_rand(20, 100)); $card->setStatus(CardStatus::ACTIVE); $card->setType(CardType::TEXT); - $card->setOrder(\mt_rand(1, 10)); + $card->order = \mt_rand(1, 10); $card->setColumn(\mt_rand(1, 4)); $card->createdBy = new NullAccount(1); $card->addTag(new NullTag(1)); diff --git a/tests/Models/KanbanCardTest.php b/tests/Models/KanbanCardTest.php index 62b17ff..56bfd6f 100755 --- a/tests/Models/KanbanCardTest.php +++ b/tests/Models/KanbanCardTest.php @@ -59,7 +59,7 @@ class KanbanCardTest extends \PHPUnit\Framework\TestCase $card->name = 'Name'; $card->description = 'Description'; $card->setColumn(1); - $card->setOrder(2); + $card->order = 2; $card->createdBy = new NullAccount(1); $card->addComment(5); $card->addMedia($m = new NullMedia(7)); diff --git a/tests/Models/KanbanColumnTest.php b/tests/Models/KanbanColumnTest.php index 71cd6fc..ad52b40 100755 --- a/tests/Models/KanbanColumnTest.php +++ b/tests/Models/KanbanColumnTest.php @@ -46,7 +46,7 @@ class KanbanColumnTest extends \PHPUnit\Framework\TestCase $column = new KanbanColumn(); $column->name = 'Name'; - $column->setOrder(2); + $column->order = 2; $column->setBoard(3); $column->addCard(new KanbanCard());