parent
7227e10824
commit
7106de5aa2
|
@ -3,13 +3,16 @@
|
|||
|
||||
namespace Icinga\Authentication\UserGroup;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Data\Filter\Filter;
|
||||
use Icinga\Data\Inspectable;
|
||||
use Icinga\Data\Inspection;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
use Icinga\Repository\DbRepository;
|
||||
use Icinga\Repository\RepositoryQuery;
|
||||
use Icinga\User;
|
||||
|
||||
class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterface
|
||||
class DbUserGroupBackend extends DbRepository implements Inspectable, UserGroupBackendInterface
|
||||
{
|
||||
/**
|
||||
* The query columns being provided
|
||||
|
@ -300,4 +303,23 @@ class DbUserGroupBackend extends DbRepository implements UserGroupBackendInterfa
|
|||
|
||||
return $groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inspect this object to gain extended information about its health
|
||||
*
|
||||
* @return Inspection The inspection result
|
||||
*/
|
||||
public function inspect()
|
||||
{
|
||||
$insp = new Inspection('Db User Group Backend');
|
||||
$insp->write($this->ds->inspect());
|
||||
|
||||
try {
|
||||
$insp->write(sprintf('%s group(s)', $this->select()->count()));
|
||||
} catch (Exception $e) {
|
||||
$insp->error(sprintf('Query failed: %s', $e->getMessage()));
|
||||
}
|
||||
|
||||
return $insp;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue