Metric/MetricPoint relationship

This commit is contained in:
James Brooks
2014-12-01 08:52:34 +00:00
parent 964c85cea8
commit 093620e4ca

View File

@@ -13,6 +13,14 @@ class Metric extends Eloquent implements \Dingo\Api\Transformer\TransformableInt
protected $fillable = ['name', 'suffix', 'description', 'display_chart'];
/**
* Metrics contain many metric points.
* @return Illuminate\Database\Eloquent\Builder
*/
public function points() {
return $this->hasMany('MetricPoint', 'metric_id', 'id');
}
/**
* Determines whether a chart should be shown.
* @return bool