1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00
invoiceninja/app/Ninja/Transformers/TaskStatusTransformer.php
2019-01-30 22:25:37 +11:00

27 lines
623 B
PHP

<?php
namespace App\Ninja\Transformers;
use App\Models\Account;
use App\Models\TaskStatus;
/**
* @SWG\Definition(definition="Task", @SWG\Xml(name="Task"))
*/
class TaskStatusTransformer extends EntityTransformer
{
public function __construct(Account $account)
{
parent::__construct($account);
}
public function transform(TaskStatus $taskStatus)
{
return array_merge($this->getDefaults($taskStatus), [
'id' => (int) $taskStatus->public_id,
'name' => $taskStatus->name ?: '',
'sort_order' => (int) $taskStatus->sort_order + 1,
]);
}
}