Skip to content

Commit f623af9

Browse files
committed
REFACTOR: Remove getType() override to allow extensibility
- Remove getType() method override so element inherits BaseElement::getType() - Add $singular_name = 'Media' and $plural_name = 'Media Blocks' - Allows extensions to customize display name via $singular_name Fixes #32 Related: dynamic/silverstripe-essentials-tools#68
1 parent 796562e commit f623af9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Elements/ElementOembed.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313

1414
class ElementOembed extends BaseElement
1515
{
16+
/**
17+
* @var string
18+
*/
19+
private static $singular_name = 'Media';
20+
21+
/**
22+
* @var string
23+
*/
24+
private static $plural_name = 'Media Blocks';
25+
1626
/**
1727
* @var string
1828
*/
@@ -163,14 +173,6 @@ protected function provideBlockSchema()
163173
return $blockSchema;
164174
}
165175

166-
/**
167-
* @return string
168-
*/
169-
public function getType()
170-
{
171-
return _t(__CLASS__ . '.BlockType', 'Media');
172-
}
173-
174176
/**
175177
* isolate src from EmbedHTML for more control over iframe attributes
176178
*

0 commit comments

Comments
 (0)