[ENTITY][Note] Added function getRenderedSplit, return an array of paragraphs/line breaks
[PLUGINS][Favourite] Foreign keys now properly defined on schema [CARDS][Note] Note text is now hidden by default if too many paragraphs/line breaks are present, BlogCollection plugin will certainly need this feature
This commit is contained in:
@@ -286,6 +286,11 @@ class Note extends Entity
|
||||
return !\is_null($this->getLanguageId()) ? Language::getById($this->getLanguageId())->getLocale() : null;
|
||||
}
|
||||
|
||||
public function getRenderedSplit(): array
|
||||
{
|
||||
return preg_split('/(<\s*p\s*\/?>)|(<\s*br\s*\/?>)|(\s\s+)|(<\s*\/p\s*\/?>)/', $this->getRendered(), -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
public static function getAllNotesByActor(Actor $actor): array
|
||||
{
|
||||
// TODO: Enforce scoping on the notes before returning
|
||||
|
Reference in New Issue
Block a user