Test Setup Failed
Push — master ( e762f8...2f148a )
by
unknown
02:18
created

HtmlProperty::sqlType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Charcoal\Property;
4
5
// From 'charcoal-property'
6
use Charcoal\Property\TextProperty;
7
8
/**
9
 * HTML Property.
10
 *
11
 * The html property is a specialized string property.
12
 */
13
class HtmlProperty extends TextProperty
14
{
15
    const DEFAULT_LONG = true;
16
17
    /**
18
     * @var boolean
19
     */
20
    protected $long = self::DEFAULT_LONG;
21
22
    /**
23
     * The available filesystems (used in TinyMCE's elFinder media manager).
24
     *
25
     * @var string
26
     */
27
    private $filesystem = '';
28
29
    /**
30
     * @return string
31
     */
32
    public function type()
33
    {
34
        return 'html';
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getFilesystem()
41
    {
42
        return $this->filesystem;
43
    }
44
45
    /**
46
     * @param string $filesystem The file system.
47
     * @return self
48
     */
49
    public function setFilesystem($filesystem)
50
    {
51
        $this->filesystem = $filesystem;
52
53
        return $this;
54
    }
55
56
    /**
57
     * Unlike strings' default upper limit of 255, HTML has no default max length (0).
58
     *
59
     * @see StringProperty::defaultMaxLength()
60
     * @return integer
61
     */
62
    public function defaultMaxLength()
63
    {
64
        return 0;
65
    }
66
67
    /**
68
     * Unlike the parent's String Property, HTML property obviously always allow HTML.
69
     *
70
     * @see StringProperty::allowHtml()
71
     * @return boolean
72
     */
73
    public function getAllowHtml()
74
    {
75
        return true;
76
    }
77
}
78