| 1 | <?php |
||
| 15 | trait ThumbnailTrait |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array|null|ActiveRecord|Mediafile |
||
| 19 | */ |
||
| 20 | protected $thumbnailModel; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Get album thumb image. |
||
| 24 | * |
||
| 25 | * @param array $options |
||
| 26 | * |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function getDefaultThumbImage(array $options = []) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Get default url to thumbnail file. |
||
| 46 | * |
||
| 47 | * @return null|string |
||
| 48 | */ |
||
| 49 | public function getDefaultThumbUrl() |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get model's thumbnail. |
||
| 60 | * |
||
| 61 | * @return array|null|\yii\db\ActiveRecord|Mediafile |
||
| 62 | */ |
||
| 63 | public function getThumbnailModel() |
||
| 75 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: