| 1 | <?php |
||
| 5 | trait Resizable |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Method for returning specific thumbnail for model. |
||
| 9 | * |
||
| 10 | * @param string $type |
||
| 11 | * @param string $attribute |
||
| 12 | * |
||
| 13 | * @return string |
||
| 14 | */ |
||
| 15 | public function thumbnail($type, $attribute = 'image') |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Generate thumbnail URL. |
||
| 32 | * |
||
| 33 | * @param $image |
||
| 34 | * @param $type |
||
| 35 | * |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function getThumbnail($image, $type) |
||
| 49 | } |
||
| 50 |
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: