Merge pull request #1323 from CachetHQ/first-query

Call first() on the query itself
This commit is contained in:
James Brooks
2016-01-03 15:29:31 +00:00

View File

@@ -24,7 +24,7 @@ class ComponentGroupPresenter extends AbstractPresenter
*/
public function lowest_status()
{
if ($component = $this->wrappedObject->enabled_components_lowest->first()) {
if ($component = $this->wrappedObject->enabled_components_lowest()->first()) {
return $component->status;
}
}
@@ -36,7 +36,7 @@ class ComponentGroupPresenter extends AbstractPresenter
*/
public function lowest_human_status()
{
if ($component = $this->wrappedObject->enabled_components_lowest->first()) {
if ($component = $this->wrappedObject->enabled_components_lowest()->first()) {
return $component->human_status;
}
}
@@ -48,7 +48,7 @@ class ComponentGroupPresenter extends AbstractPresenter
*/
public function lowest_status_color()
{
if ($component = $this->wrappedObject->enabled_components_lowest->first()) {
if ($component = $this->wrappedObject->enabled_components_lowest()->first()) {
return $component->status_color;
}
}