- public function getEditor() {
- if($this->editor === null) {
- $editorRole = Role::getRole('editor');
- $this->editor = $editorRole->users->first();
+ protected function assertActivityExists(string $type, ?Entity $entity = null, string $detail = '')
+ {
+ $detailsToCheck = ['type' => $type];
+
+ if ($entity) {
+ $detailsToCheck['entity_type'] = $entity->getMorphClass();
+ $detailsToCheck['entity_id'] = $entity->id;