| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class CategoryAsset extends Asset { |
||
| 7 | |||
| 8 | public $name = 'Article Category'; |
||
| 9 | public $shortname = 'ArticleCategory'; |
||
| 10 | /* assets that can be children, a value means it is limited to that many children, -1 means unlimited */ |
||
| 11 | public $accept = ItemAsset::class; |
||
| 12 | public $accept_limit = "-1"; |
||
| 13 | |||
| 14 | // map our value as equal to whatever the title property is set on save. |
||
| 15 | public $value_equals = 'category'; |
||
| 16 | |||
| 17 | |||
| 18 | public $properties = array( |
||
| 19 | 'category' => array( |
||
| 20 | 'name' => 'Category', |
||
| 21 | 'type' => self::STRING, |
||
| 22 | 'required' => true |
||
| 23 | ), |
||
| 24 | 'status' => array( |
||
| 25 | 'name' => 'Published', |
||
| 26 | 'type' => self::DROPDOWN, |
||
| 27 | 'options' => ['published' => 'Published', 'unpublished' => 'Unpublished'], |
||
| 28 | 'published' => ['published'] |
||
| 29 | ), |
||
| 30 | |||
| 31 | ); |
||
| 32 | |||
| 33 | public static function about() { |
||
| 34 | return 'This is a category to which Article Items are assigned. <br/> |
||
| 35 | Assigning Article Items to such a category makes them easier to manage and maintain, and also |
||
| 36 | makes it easier for your audience to find them.'; |
||
| 37 | } |
||
| 38 | |||
| 39 | |||
| 40 | /** |
||
| 41 | * generate the route for this asset |
||
| 42 | */ |
||
| 43 | public static function route($record, $path = null){ |
||
| 46 | } |
||
| 47 | } |
||
| 48 |