| 1 | <?php |
||
| 14 | class Image extends \Model |
||
| 15 | { |
||
| 16 | static $cols = [ |
||
|
|
|||
| 17 | 'file_id' => ['type' => 'image'], |
||
| 18 | 'item_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'item'], |
||
| 19 | 'name' => ['type' => 'text'], |
||
| 20 | 'description' => ['type' => 'html'] |
||
| 21 | ]; |
||
| 22 | |||
| 23 | static function relations() |
||
| 36 | |||
| 37 | static $dataManagers = [ |
||
| 38 | 'manager' => [ |
||
| 39 | 'cols' => [ |
||
| 40 | 'file_id', 'name' |
||
| 41 | ] |
||
| 42 | ] |
||
| 43 | ]; |
||
| 44 | static $forms = [ |
||
| 45 | 'manager' => [ |
||
| 46 | 'map' => [ |
||
| 47 | ['name'], |
||
| 48 | ['item_id', 'file_id'], |
||
| 49 | ['description'] |
||
| 50 | ] |
||
| 51 | ] |
||
| 52 | ]; |
||
| 53 | |||
| 54 | } |
||
| 55 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.