Standardizing things

This commit is contained in:
James Brooks
2016-08-10 10:46:45 +01:00
parent 943f7623a4
commit a947cffcb8
8 changed files with 20 additions and 20 deletions

View File

@@ -107,7 +107,7 @@ class Component extends Model implements HasPresenter
];
/**
* Components can belong to a group.
* Get the group relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
@@ -117,7 +117,7 @@ class Component extends Model implements HasPresenter
}
/**
* Lookup all of the incidents reported on the component.
* Get the incidents relation.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
@@ -127,7 +127,7 @@ class Component extends Model implements HasPresenter
}
/**
* Components can have many tags.
* Get the tags relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/

View File

@@ -93,7 +93,7 @@ class ComponentGroup extends Model implements HasPresenter
protected $with = ['enabled_components', 'enabled_components_lowest'];
/**
* A group can have many components.
* Get the components relation.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/

View File

@@ -91,6 +91,16 @@ class Incident extends Model implements HasPresenter
'message',
];
/**
* Get the component relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function component()
{
return $this->belongsTo(Component::class, 'component_id', 'id');
}
/**
* Finds all visible incidents.
*
@@ -131,16 +141,6 @@ class Incident extends Model implements HasPresenter
});
}
/**
* An incident belongs to a component.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function component()
{
return $this->belongsTo(Component::class, 'component_id', 'id');
}
/**
* Returns whether the "incident" is scheduled or not.
*

View File

@@ -117,7 +117,7 @@ class Metric extends Model implements HasPresenter
];
/**
* Metrics contain many metric points.
* Get the points relation.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/

View File

@@ -63,7 +63,7 @@ class MetricPoint extends Model implements HasPresenter
];
/**
* A metric point belongs to a metric unit.
* Get the metric relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/

View File

@@ -71,7 +71,7 @@ class Subscriber extends Model implements HasPresenter
}
/**
* A subscriber has many subscriptions.
* Get the subscriptions relation.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/

View File

@@ -50,7 +50,7 @@ class Subscription extends Model
];
/**
* A subscription belongs to a subscriber.
* Get the subscriber relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
@@ -60,7 +60,7 @@ class Subscription extends Model
}
/**
* A subscription has one component.
* Get the component relation.
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/

View File

@@ -45,7 +45,7 @@ class Tag extends Model
}
/**
* Tags can have many components.
* Get the components relation.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/