class MyCustomElement extends BaseElement
{
private static $
class MyCustomElement extends BaseElement
{
private static $has_many = [
'AccordionItems' => AccordionItem::class
];
public function addTextContentForSearch()
{
$titles = [];
foreach($this->AccordionItems() as $item) {
$titles[] = $item->Title;
}
return implode(' ', $titles);
}
}
class MyCustomElement extends BaseElement
{
public function updateTextContentForSearch($string)
{
// Remove any occurrence of forbiddenWord in the final string
return = str_replace('forbiddenWord', '', $string);
}
}