1<?php
2
3namespace ComboStrap;
4
5use ComboStrap\Meta\Api\Metadata;
6use ComboStrap\Meta\Api\MetadataDateTime;
7
8/**
9 * Class ReplicationDate
10 * Modification date of the database row
11 */
12class ReplicationDate extends MetadataDateTime
13{
14
15    /**
16     * The attribute in the metadata and in the database
17     */
18    public const PROPERTY_NAME = "date_replication";
19    public const REPLICATION_CANONICAL = "replication";
20
21    public static function createFromPage(MarkupPath $page)
22    {
23        return (new ReplicationDate())
24            ->setResource($page);
25    }
26
27    static public function getTab(): string
28    {
29        return MetaManagerForm::TAB_INTEGRATION_VALUE;
30    }
31
32    static public function getDescription(): string
33    {
34        return "The modification date of the database row";
35    }
36
37    static public function getLabel(): string
38    {
39        return "Database Replication Date";
40    }
41
42    static public function getCanonical(): string
43    {
44        return self::REPLICATION_CANONICAL;
45    }
46
47    static public function getName(): string
48    {
49        return self::PROPERTY_NAME;
50    }
51
52    static public function getPersistenceType(): string
53    {
54        return Metadata::RUNTIME_METADATA;
55    }
56
57    static public function isMutable(): bool
58    {
59        return false;
60    }
61
62    /**
63     * @return mixed
64     * @throws ExceptionNotFound
65     */
66    public function getDefaultValue()
67    {
68        throw new ExceptionNotFound("No default replication date");
69    }
70
71    static public function isOnForm(): bool
72    {
73        return true;
74    }
75}
76