1 | <?php |
||
15 | class Line extends Model |
||
16 | { |
||
17 | use BaseTranslatable, Translatable; |
||
18 | |||
19 | public $table = 'squanto_lines'; |
||
20 | public $translatedAttributes = ['value']; |
||
21 | |||
22 | /** |
||
23 | * @param $key |
||
24 | * @return Line |
||
25 | */ |
||
26 | 27 | public static function make($key) |
|
39 | |||
40 | /** |
||
41 | * @param $key |
||
42 | * @return Line |
||
43 | */ |
||
44 | 3 | public static function findOrCreateByKey($key) |
|
52 | |||
53 | /** |
||
54 | * Save a translated value |
||
55 | * |
||
56 | * @param $locale |
||
57 | * @param $value |
||
58 | * @return $this |
||
59 | */ |
||
60 | 25 | public function saveValue($locale, $value) |
|
66 | |||
67 | /** |
||
68 | * Save a translated value |
||
69 | * |
||
70 | * @param $locale |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function removeValue($locale) |
||
79 | |||
80 | /** |
||
81 | * @param null $locale |
||
82 | * @param bool $fallback |
||
83 | * @return string |
||
84 | */ |
||
85 | 12 | public function getValue($locale = null, $fallback = true) |
|
89 | |||
90 | public static function findValue($key, $locale) |
||
98 | |||
99 | /** |
||
100 | * @param $key |
||
101 | * @return mixed |
||
102 | */ |
||
103 | 20 | public static function findByKey($key) |
|
107 | |||
108 | 6 | public function saveSuggestedType() |
|
118 | |||
119 | 5 | public function editInEditor() |
|
120 | { |
||
121 | 5 | return $this->type == LineType::EDITOR; |
|
122 | } |
||
123 | |||
124 | public function editInTextarea() |
||
128 | |||
129 | public function editInTextinput() |
||
133 | |||
134 | 5 | public function areParagraphsAllowed() |
|
135 | { |
||
136 | 5 | return (false !== strpos($this->allowed_html, '<p>')); |
|
137 | } |
||
138 | |||
139 | /** |
||
140 | * Get key - value pairs for all lines per locale |
||
141 | * |
||
142 | * @param $locale |
||
143 | * @return mixed |
||
144 | */ |
||
145 | 9 | public static function getValuesByLocale($locale) |
|
149 | |||
150 | 14 | public static function getValuesByLocaleAndPage($locale, $pagekey = null) |
|
174 | } |
||
175 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.