1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/Ninja/Transformers/ProjectTransformer.php

19 lines
625 B
PHP
Raw Normal View History

2016-11-29 18:47:26 +01:00
<?php namespace App\Ninja\Transformers;
use App\Models\Project;
class ProjectTransformer extends EntityTransformer
{
public function transform(Project $project)
{
return array_merge($this->getDefaults($project), [
'id' => (int) $project->public_id,
'name' => $project->name,
'client_id' => $project->client ? (int) $project->client->public_id : null,
'updated_at' => $this->getTimestamp($project->updated_at),
'archived_at' => $this->getTimestamp($project->deleted_at),
'is_deleted' => (bool) $project->is_deleted,
]);
}
}