Conditions | 4 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function KeepWordsTogether(?string $words = '') |
||
16 | { |
||
17 | $text = $this->owner->getValue(); |
||
18 | $replacers = WordsToKeepTogether::get(); |
||
19 | if ($words) { |
||
20 | $text = $this->replaceKeepWordsTogether($text, $words); |
||
21 | } |
||
22 | foreach ($replacers as $replacer) { |
||
23 | $text = $this->replaceKeepWordsTogether($text, $replacer->Title); |
||
24 | } |
||
25 | $field = DBField::create_field(DBHTMLText::class, $text); |
||
26 | if ($field instanceof DBHTMLText) { |
||
27 | $field->setProcessShortcodes(true); |
||
28 | } |
||
29 | |||
30 | return $field; |
||
31 | } |
||
43 |