1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Ninja/Transformers/TaskStatusTransformer.php

27 lines
623 B
PHP
Raw Normal View History

2019-01-30 11:45:46 +01:00
<?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,
]);
}
}