| Total Complexity | 4 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class ElementContent extends BaseElement |
||
| 13 | { |
||
| 14 | private static $icon = 'font-icon-block-content'; |
||
|
|
|||
| 15 | |||
| 16 | private static $db = [ |
||
| 17 | 'HTML' => 'HTMLText' |
||
| 18 | ]; |
||
| 19 | |||
| 20 | private static $table_name = 'ElementContent'; |
||
| 21 | |||
| 22 | private static $singular_name = 'content block'; |
||
| 23 | |||
| 24 | private static $plural_name = 'content blocks'; |
||
| 25 | |||
| 26 | private static $description = 'HTML text block'; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Re-title the HTML field to Content |
||
| 30 | * |
||
| 31 | * {@inheritDoc} |
||
| 32 | */ |
||
| 33 | public function getCMSFields() |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getSummary() |
||
| 45 | { |
||
| 46 | return DBField::create_field('HTMLText', $this->HTML)->Summary(20); |
||
| 47 | } |
||
| 48 | |||
| 49 | protected function provideBlockSchema() |
||
| 50 | { |
||
| 51 | $blockSchema = parent::provideBlockSchema(); |
||
| 52 | $blockSchema['content'] = $this->getSummary(); |
||
| 53 | return $blockSchema; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function getType() |
||
| 59 | } |
||
| 60 | } |
||
| 61 |