Utilize Icinga\Module\Icingadb\Common\Model where applicable

This commit is contained in:
Johannes Meyer 2025-09-02 11:04:40 +02:00
parent fa4191363b
commit 489c8c457c
57 changed files with 81 additions and 55 deletions

View file

@ -6,10 +6,10 @@ namespace Icinga\Module\Icingadb\Model;
use DateTime;
use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use ipl\Orm\Relations;
/**

View file

@ -4,10 +4,10 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Model;
use Icinga\Module\Icingadb\Model\Behavior\ActionAndNoteUrl;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use ipl\Orm\Relations;
/**

View file

@ -4,10 +4,10 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use ipl\Orm\Relations;
/**

View file

@ -4,9 +4,9 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use ipl\Orm\Relations;
/**

View file

@ -4,9 +4,9 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -10,7 +10,7 @@ use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -9,7 +9,7 @@ use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Contract\RewriteFilterBehavior;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Query;
use ipl\Orm\Relations;
use ipl\Stdlib\Filter;

View file

@ -10,7 +10,7 @@ use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -9,7 +9,7 @@ use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -8,7 +8,7 @@ use DateTime;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -9,7 +9,7 @@ use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,11 +6,11 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Auth;
use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use Icinga\Module\Icingadb\Common\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Defaults;
use ipl\Orm\Model;
use ipl\Orm\Relations;
use ipl\Orm\ResultSet;

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -4,8 +4,10 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Auth;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Query;
use ipl\Orm\Relations;
use ipl\Orm\UnionModel;
use ipl\Sql\Adapter\Pgsql;
@ -40,6 +42,17 @@ class Hostgroupsummary extends UnionModel
{
$q = parent::on($db);
$q->on(
Query::ON_SELECT_ASSEMBLED,
function () use ($q) {
$auth = new class () {
use Auth;
};
$auth->assertColumnRestrictions($q->getFilter());
}
);
$q->on($q::ON_SELECT_ASSEMBLED, function (Select $select) use ($q) {
$model = $q->getModel();

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -9,7 +9,7 @@ use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ActionAndNoteUrl;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -8,7 +8,7 @@ use Icinga\Module\Icingadb\Model\Behavior\Bitmask;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -9,7 +9,7 @@ use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -10,7 +10,7 @@ use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Defaults;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
use ipl\Orm\ResultSet;

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -4,8 +4,10 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Common\Auth;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Query;
use ipl\Orm\Relations;
use ipl\Orm\UnionModel;
use ipl\Sql\Adapter\Pgsql;
@ -35,6 +37,17 @@ class ServicegroupSummary extends UnionModel
{
$q = parent::on($db);
$q->on(
Query::ON_SELECT_ASSEMBLED,
function () use ($q) {
$auth = new class () {
use Auth;
};
$auth->assertColumnRestrictions($q->getFilter());
}
);
$q->on($q::ON_SELECT_ASSEMBLED, function (Select $select) use ($q) {
$model = $q->getModel();

View file

@ -10,7 +10,7 @@ use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Web\Widget\Icon;
/**

View file

@ -8,7 +8,7 @@ use DateTime;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -8,7 +8,7 @@ use Icinga\Module\Icingadb\Model\Behavior\Bitmask;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -7,7 +7,7 @@ namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**

View file

@ -6,7 +6,7 @@ namespace Icinga\Module\Icingadb\Model;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use Icinga\Module\Icingadb\Common\Model;
use ipl\Orm\Relations;
/**