icingadb-web/library/Icingadb/Model/DependencyEdgeState.php
Eric Lippmann 272e791390 License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-11 14:03:05 +01:00

56 lines
1.1 KiB
PHP

<?php
// SPDX-FileCopyrightText: 2024 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-3.0-or-later
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);
}
}