mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-11 20:06:14 -04:00
50 lines
942 B
PHP
50 lines
942 B
PHP
<?php
|
|
|
|
/* Icinga DB Web | (c) 2024 Icinga GmbH | GPLv2 */
|
|
|
|
namespace Icinga\Module\Icingadb\Model;
|
|
|
|
use DateTime;
|
|
use ipl\Orm\Behavior\Binary;
|
|
use ipl\Orm\Behavior\MillisecondTimestamp;
|
|
use ipl\Orm\Behaviors;
|
|
use ipl\Orm\Model;
|
|
|
|
/**
|
|
* Schema model
|
|
*
|
|
* @property string $id
|
|
* @property int $version
|
|
* @property DateTime $timestamp
|
|
*/
|
|
class Schema extends Model
|
|
{
|
|
public function getTableName(): string
|
|
{
|
|
return 'icingadb_schema';
|
|
}
|
|
|
|
public function getKeyName(): string
|
|
{
|
|
return 'id';
|
|
}
|
|
|
|
public function getColumns(): array
|
|
{
|
|
return [
|
|
'version',
|
|
'timestamp'
|
|
];
|
|
}
|
|
|
|
public function getDefaultSort(): array
|
|
{
|
|
return ['timestamp desc'];
|
|
}
|
|
|
|
public function createBehaviors(Behaviors $behaviors): void
|
|
{
|
|
$behaviors->add(new Binary(['id']));
|
|
$behaviors->add(new MillisecondTimestamp(['timestamp']));
|
|
}
|
|
}
|