2024-09-02 09:27:55 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Icingadb\Model;
|
|
|
|
|
|
|
|
|
|
use ipl\Orm\Behavior\Binary;
|
|
|
|
|
use ipl\Orm\Behavior\BoolCast;
|
|
|
|
|
use ipl\Orm\Behaviors;
|
|
|
|
|
use ipl\Orm\Model;
|
2025-05-20 08:46:39 -04:00
|
|
|
use ipl\Orm\Relations;
|
2024-09-02 09:27:55 -04:00
|
|
|
|
|
|
|
|
/**
|
2024-12-17 08:49:00 -05:00
|
|
|
* Dependency edge state model.
|
2024-09-02 09:27:55 -04:00
|
|
|
*
|
|
|
|
|
* @property string $id
|
2024-12-18 09:32:44 -05:00
|
|
|
* @property string $environment_id
|
2024-09-02 09:27:55 -04:00
|
|
|
* @property bool $failed
|
|
|
|
|
*/
|
2024-12-17 08:49:00 -05:00
|
|
|
class DependencyEdgeState extends Model
|
2024-09-02 09:27:55 -04:00
|
|
|
{
|
|
|
|
|
public function getTableName(): string
|
|
|
|
|
{
|
2024-12-17 08:49:00 -05:00
|
|
|
return 'dependency_edge_state';
|
2024-09-02 09:27:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getKeyName(): string
|
|
|
|
|
{
|
|
|
|
|
return 'id';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getColumns(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2024-12-18 09:32:44 -05:00
|
|
|
'environment_id',
|
2024-09-02 09:27:55 -04:00
|
|
|
'failed'
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function createBehaviors(Behaviors $behaviors): void
|
|
|
|
|
{
|
|
|
|
|
$behaviors->add(new Binary([
|
2024-12-18 09:32:44 -05:00
|
|
|
'id',
|
|
|
|
|
'environment_id'
|
2024-09-02 09:27:55 -04:00
|
|
|
]));
|
|
|
|
|
$behaviors->add(new BoolCast([
|
|
|
|
|
'failed'
|
|
|
|
|
]));
|
|
|
|
|
}
|
2025-05-20 08:46:39 -04:00
|
|
|
|
|
|
|
|
public function createRelations(Relations $relations)
|
|
|
|
|
{
|
|
|
|
|
$relations->hasMany('edge', DependencyEdge::class);
|
|
|
|
|
}
|
2024-09-02 09:27:55 -04:00
|
|
|
}
|