Create and update a metric.

This commit is contained in:
James Brooks
2014-11-25 21:35:52 +00:00
parent f71639f226
commit 39bc6a1648
4 changed files with 88 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
class MetricTransformer extends \League\Fractal\TransformerAbstract {
public function transform(Metric $metric) {
return [
'id' => (int) $component->id,
'name' => $component->name,
'description' => $component->description,
'suffix' => $component->suffix,
'display' => $component->shouldDisplay,
'created_at' => $component->created_at->timestamp,
'updated_at' => $component->updated_at->timestamp,
];
}
}