1<?php
2
3/**
4 * Class ilMMCustomItemStorage
5 *
6 * @author Fabian Schmid <fs@studer-raimann.ch>
7 */
8class ilMMCustomItemStorage extends CachedActiveRecord
9{
10
11    /**
12     * @var string
13     *
14     * @con_is_primary true
15     * @con_is_unique  true
16     * @con_has_field  true
17     * @con_fieldtype  text
18     * @con_length     256
19     */
20    protected $identifier = '';
21    /**
22     * @var string
23     *
24     * @con_has_field  true
25     * @con_fieldtype  text
26     * @con_length     128
27     */
28    protected $type = '';
29    /**
30     * @var string
31     *
32     * @con_has_field  true
33     * @con_fieldtype  text
34     * @con_length     4000
35     */
36    protected $action = "";
37    /**
38     * @var string
39     *
40     * @con_has_field  true
41     * @con_fieldtype  text
42     * @con_length     4000
43     */
44    protected $default_title = "";
45    /**
46     * @var bool
47     *
48     * @con_has_field  true
49     * @con_fieldtype  integer
50     * @con_length     1
51     */
52    protected $top_item = false;
53    /**
54     * @var string
55     */
56    protected $connector_container_name = "il_mm_custom_items";
57
58
59    /**
60     * @return string
61     */
62    public function getIdentifier() : string
63    {
64        return $this->identifier;
65    }
66
67
68    /**
69     * @param string $identifier
70     *
71     * @return ilMMCustomItemStorage
72     */
73    public function setIdentifier(string $identifier) : ilMMCustomItemStorage
74    {
75        $this->identifier = $identifier;
76
77        return $this;
78    }
79
80
81    /**
82     * @return string
83     */
84    public function getType() : string
85    {
86        return $this->type;
87    }
88
89
90    /**
91     * @param string $type
92     *
93     * @return ilMMCustomItemStorage
94     */
95    public function setType(string $type) : ilMMCustomItemStorage
96    {
97        $this->type = $type;
98
99        return $this;
100    }
101
102
103    /**
104     * @return bool
105     */
106    public function isTopItem() : bool
107    {
108        return $this->top_item;
109    }
110
111
112    /**
113     * @param bool $top_item
114     *
115     * @return ilMMCustomItemStorage
116     */
117    public function setTopItem(bool $top_item) : ilMMCustomItemStorage
118    {
119        $this->top_item = $top_item;
120
121        return $this;
122    }
123
124
125    /**
126     * @return string
127     */
128    public function getAction() : string
129    {
130        return $this->action;
131    }
132
133
134    /**
135     * @param string $action
136     *
137     * @return ilMMCustomItemStorage
138     */
139    public function setAction(string $action) : ilMMCustomItemStorage
140    {
141        $this->action = $action;
142
143        return $this;
144    }
145
146
147    /**
148     * @return string
149     */
150    public function getDefaultTitle() : string
151    {
152        return $this->default_title;
153    }
154
155
156    /**
157     * @param string $default_title
158     *
159     * @return ilMMCustomItemStorage
160     */
161    public function setDefaultTitle(string $default_title) : ilMMCustomItemStorage
162    {
163        $this->default_title = $default_title;
164
165        return $this;
166    }
167
168
169    /**
170     * @inheritDoc
171     */
172    public function getCache() : ilGlobalCache
173    {
174        return ilGlobalCache::getInstance(ilGlobalCache::COMP_GLOBAL_SCREEN);
175    }
176}
177