1<?php
2
3
4namespace ComboStrap;
5
6use ComboStrap\Meta\Api\Metadata;
7use ComboStrap\Meta\Api\MetadataMultiple;
8use ComboStrap\Meta\Field\PageImage;
9use ComboStrap\Meta\Field\PageImages;
10
11/**
12 * Class PageImageUsage
13 * @package ComboStrap
14 * The usage for the image of a page
15 * @deprecated
16 */
17class PageImageUsage extends MetadataMultiple
18{
19
20    public const PERSISTENT_NAME = "usage";  // storage name
21    const PROPERTY_NAME = "image-usage"; // unique property name
22
23    /**
24     * Constant values
25     */
26    public const ALL = "all";
27    public const FACEBOOK = "facebook";
28    public const SOCIAL = "social";
29    public const ICON = "icon";
30    public const TWITTER = "twitter";
31    public const GOOGLE = "google";
32    public const DEFAULT = PageImageUsage::ALL;
33
34
35    public static function getUsageValues(): array
36    {
37        return [
38            self::ALL,
39            self::FACEBOOK,
40            self::GOOGLE,
41            self::ICON,
42            PageImage::PAGE_IMAGE,
43            self::SOCIAL,
44            self::TWITTER,
45        ];
46
47    }
48
49    public static function createFromParent(PageImages $param): PageImageUsage
50    {
51        return new PageImageUsage($param);
52    }
53
54
55    static     public function getDescription(): string
56    {
57        return "The possible usages of the image";
58    }
59
60    static public function getLabel(): string
61    {
62        return "Usages";
63    }
64
65    static public function getName(): string
66    {
67        return self::PROPERTY_NAME;
68    }
69
70    static public function getPersistentName(): string
71    {
72        return self::PERSISTENT_NAME;
73    }
74
75
76    static public function isMutable(): bool
77    {
78        return true;
79    }
80
81
82    function getDefaultValue(): array
83    {
84        return [self::ALL];
85    }
86
87    static public function getPersistenceType(): string
88    {
89        return Metadata::PERSISTENT_METADATA;
90    }
91
92    static public function getFormControlWidth(): int
93    {
94        return 4;
95    }
96
97    public function getPossibleValues(): ?array
98    {
99        return static::getUsageValues();
100    }
101
102
103}
104