mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-02-20 00:10:09 -05:00
* Auth: Add method `assertColumnRestrictions` * ObjectSuggestions: Do not suggest protected variables `assertColumnRestrictions` does not allow to use them anymore, hence we should not suggest them in searches as well to not to let the user run into an error by accepting a suggestion. Though, when fetching values as well, we still have to obfuscate, otherwise protected vars won't show up in details anymore. * Introduce Icinga\Module\Icingadb\Common\Model Must be used as base for all models, to ensure column restrictions are asserted on filters. * Utilize `Icinga\Module\Icingadb\Common\Model` where applicable
53 lines
1 KiB
PHP
53 lines
1 KiB
PHP
<?php
|
|
|
|
namespace Icinga\Module\Icingadb\Model;
|
|
|
|
use ipl\Orm\Behavior\Binary;
|
|
use ipl\Orm\Behavior\BoolCast;
|
|
use ipl\Orm\Behaviors;
|
|
use Icinga\Module\Icingadb\Common\Model;
|
|
use ipl\Orm\Relations;
|
|
|
|
/**
|
|
* Dependency edge state model.
|
|
*
|
|
* @property string $id
|
|
* @property string $environment_id
|
|
* @property bool $failed
|
|
*/
|
|
class DependencyEdgeState extends Model
|
|
{
|
|
public function getTableName(): string
|
|
{
|
|
return 'dependency_edge_state';
|
|
}
|
|
|
|
public function getKeyName(): string
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns(): array
|
|
{
|
|
return [
|
|
'environment_id',
|
|
'failed'
|
|
];
|
|
}
|
|
|
|
public function createBehaviors(Behaviors $behaviors): void
|
|
{
|
|
$behaviors->add(new Binary([
|
|
'id',
|
|
'environment_id'
|
|
]));
|
|
$behaviors->add(new BoolCast([
|
|
'failed'
|
|
]));
|
|
}
|
|
|
|
public function createRelations(Relations $relations)
|
|
{
|
|
$relations->hasMany('edge', DependencyEdge::class);
|
|
}
|
|
}
|