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