invoiceninja/app/Ninja/Presenters/ClientPresenter.php

29 lines
692 B
PHP
Raw Normal View History

2015-11-12 22:36:28 +02:00
<?php namespace App\Ninja\Presenters;
2016-05-23 12:26:08 +03:00
class ClientPresenter extends EntityPresenter {
2015-11-12 22:36:28 +02:00
public function country()
{
return $this->entity->country ? $this->entity->country->name : '';
}
2016-02-04 20:36:39 +02:00
public function status()
{
$class = $text = '';
if ($this->entity->is_deleted) {
$class = 'danger';
$text = trans('texts.deleted');
} elseif ($this->entity->trashed()) {
$class = 'warning';
$text = trans('texts.archived');
} else {
$class = 'success';
$text = trans('texts.active');
}
return "<span class=\"label label-{$class}\">{$text}</span>";
2016-02-23 23:32:39 +02:00
}
2016-05-23 12:26:08 +03:00
}