Files
cachet-docker/app/models/Component.php

29 lines
667 B
PHP

<?php
class Component extends Eloquent implements Dingo\Api\Transformer\TransformableInterface {
/**
* Lookup all of the incidents reported on the component.
* @return Illuminate\Database\Eloquent\Relations
*/
public function incidents() {
return $this->hasMany('Incident', 'component', 'id');
}
/**
* Looks up the human readable version of the status.
* @return string
*/
public function getHumanStatusAttribute() {
return Lang::get('component.status.' . $this->status);
}
/**
* Get the transformer instance.
*
* @return mixed
*/
public function getTransformer() {
return new ComponentTransformer();
}
}