Move code to src folder

This commit is contained in:
Graham Campbell
2015-01-01 14:10:00 +00:00
parent 25af776e46
commit bf52b14bee
22 changed files with 1 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace CachetHQ\Cachet\Transformers;
use Component;
use League\Fractal\TransformerAbstract;
class ComponentTransformer extends TransformerAbstract
{
public function transform(Component $component)
{
return [
'id' => (int) $component->id,
'name' => $component->name,
'description' => $component->description,
'status_id' => (int) $component->status,
'status' => $component->humanStatus,
'incident_count' => $component->incidents()->count(),
'created_at' => $component->created_at->timestamp,
'updated_at' => $component->updated_at->timestamp,
];
}
}