mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-11 20:06:14 -04:00
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 ipl\Orm\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);
|
|
}
|
|
}
|