1<?php
2
3
4namespace ComboStrap;
5
6
7class AliasType extends MetadataText
8{
9
10
11    private const PROPERTY_NAME = "alias-type";
12    private const PERSISTENT_NAME = "type";
13    const REDIRECT = "redirect";
14    const ALIAS_TYPE_VALUES = [AliasType::SYNONYM, AliasType::REDIRECT];
15    const SYNONYM = "synonym";
16    const DEFAULT = self::REDIRECT;
17
18    public static function createForParent(Aliases $parent): AliasType
19    {
20        return new AliasType($parent);
21    }
22
23    public function getDescription(): string
24    {
25        return "The type of the alias";
26    }
27
28    public function getLabel(): string
29    {
30        return "Alias Type";
31    }
32
33    public static function getName(): string
34    {
35        return self::PROPERTY_NAME;
36    }
37
38    public static function getPersistentName(): string
39    {
40        return self::PERSISTENT_NAME;
41    }
42
43
44    public function getPersistenceType(): string
45    {
46        return DataType::TEXT_TYPE_VALUE;
47    }
48
49    public function getMutable(): bool
50    {
51        return true;
52    }
53
54    public function getPossibleValues(): ?array
55    {
56        return AliasType::ALIAS_TYPE_VALUES;
57    }
58
59
60    public function getDefaultValue(): string
61    {
62        return AliasType::DEFAULT;
63    }
64
65
66}
67