1 | <?php |
||
8 | class Project extends HasContent |
||
9 | { |
||
10 | use Sluggable, SoftDeletes; |
||
11 | |||
12 | /** |
||
13 | * The table associated with the model. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $table = 'projects'; |
||
18 | |||
19 | /** |
||
20 | * The attributes that are mass assignable. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $fillable = [ |
||
25 | 'name', 'slug', 'type', 'visible', 'order', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Return all visible projects. |
||
30 | * |
||
31 | * @param bool $group If true, group projects by 'type'. |
||
32 | * @param bool $order If true, order projects by 'order'. |
||
33 | * |
||
34 | * @return \Illuminate\Support\Collection |
||
35 | */ |
||
36 | public static function allVisible($group = true, $order = true) |
||
42 | |||
43 | /** |
||
44 | * Return all hidden projects. |
||
45 | * |
||
46 | * @param bool $group If true, group projects by 'type'. |
||
47 | * @param bool $order If true, order projects by 'order'. |
||
48 | * |
||
49 | * @return \Illuminate\Support\Collection |
||
50 | */ |
||
51 | public static function allHidden($group = true, $order = true) |
||
57 | |||
58 | /** |
||
59 | * Return all projects grouped by 'type'. |
||
60 | * |
||
61 | * @param bool $order If true, order projects by 'order'. |
||
62 | * |
||
63 | * @return \Illuminate\Support\Collection |
||
64 | */ |
||
65 | public static function allGrouped($order = true) |
||
71 | |||
72 | /** |
||
73 | * Return all projects ordered by 'order'. |
||
74 | * |
||
75 | * @return \Illuminate\Support\Collection |
||
76 | */ |
||
77 | public static function allOrdered() |
||
83 | |||
84 | /** |
||
85 | * Get all projects with given block name. |
||
86 | * |
||
87 | * @param string $blockName Name of block. |
||
88 | * |
||
89 | * @return \Illuminate\Support\Collection |
||
90 | */ |
||
91 | public static function hasBlockNamed($blockName) |
||
95 | |||
96 | /** |
||
97 | * Get all projects with given image name. |
||
98 | * |
||
99 | * @param string $imageName Name of image. |
||
100 | * |
||
101 | * @return \Illuminate\Support\Collection |
||
102 | */ |
||
103 | public static function hasImageNamed($imageName) |
||
107 | |||
108 | /** |
||
109 | * Get all projects with given link name. |
||
110 | * |
||
111 | * @param string $linkName Name of link. |
||
112 | * |
||
113 | * @return \Illuminate\Support\Collection |
||
114 | */ |
||
115 | public static function hasLinkNamed($linkName) |
||
119 | |||
120 | /** |
||
121 | * Return the project id. |
||
122 | * |
||
123 | * @return int |
||
124 | */ |
||
125 | public function id() |
||
129 | |||
130 | /** |
||
131 | * Return the project name. |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | public function name() |
||
139 | |||
140 | /** |
||
141 | * Return the project type. |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | public function type() |
||
149 | |||
150 | /** |
||
151 | * Return the project slug. |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function slug() |
||
159 | |||
160 | /** |
||
161 | * Return the project order value. |
||
162 | * |
||
163 | * @return int |
||
164 | */ |
||
165 | public function order() |
||
169 | |||
170 | /** |
||
171 | * Get formatted text of block with project name or first block. |
||
172 | * |
||
173 | * @return \Larafolio\Models\TextBlock |
||
174 | */ |
||
175 | public function getProjectBlock() |
||
185 | |||
186 | /** |
||
187 | * Get formatted text of block with project name or first block. |
||
188 | * |
||
189 | * @param bool $formatted If true, return formatted text. |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | public function getProjectBlockText($formatted = true) |
||
205 | |||
206 | /** |
||
207 | * Get url of small image with project name or first image in collection. |
||
208 | * |
||
209 | * @return \Larafolio\Models\Image |
||
210 | */ |
||
211 | public function getProjectImage() |
||
221 | |||
222 | /** |
||
223 | * Get url of small image with project name or first image in collection. |
||
224 | * |
||
225 | * @param string $size The size of the image, name of image cache filter. |
||
226 | * |
||
227 | * @return string |
||
228 | */ |
||
229 | public function getProjectImageUrl($size = 'small') |
||
239 | } |
||
240 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read 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.