1<?php
2
3
4namespace ComboStrap;
5
6/**
7 * Class LowQualityPageIndicator
8 * @package ComboStrap
9 * Tells if the page can be of low quality or not
10 * By default, it can
11 */
12class LowQualityPageOverwrite extends MetadataBoolean
13{
14
15    /**
16     * An indicator in the meta
17     * that set a boolean to true or false
18     * to tell if a page may be of low quality
19     */
20    public const PROPERTY_NAME = 'low_quality_page';
21    public const CAN_BE_LOW_QUALITY_PAGE_DEFAULT = true;
22
23    public static function createForPage(Page $page)
24    {
25        return (new LowQualityPageOverwrite())
26            ->setResource($page);
27    }
28
29    public function getTab(): string
30    {
31        return MetaManagerForm::TAB_QUALITY_VALUE;
32    }
33
34    public function getDescription(): string
35    {
36        return "If checked, this page will never be a low quality page";
37    }
38
39    public function getLabel(): string
40    {
41        return "Prevent this page to become a low quality page";
42    }
43
44    public static function getName(): string
45    {
46        return self::PROPERTY_NAME;
47    }
48
49    public function getPersistenceType(): string
50    {
51        return Metadata::PERSISTENT_METADATA;
52    }
53
54    public function getMutable(): bool
55    {
56        return true;
57    }
58
59    public function getDefaultValue(): bool
60    {
61        /**
62         * A page can be of low quality by default
63         */
64        return self::CAN_BE_LOW_QUALITY_PAGE_DEFAULT;
65    }
66
67    public function getCanonical(): string
68    {
69        return "low_quality_page";
70    }
71
72
73}
74