mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Implemented new design in entity selector
- Also showed entity path in search. - Cleaned popular entity fetch logic. - Cleaned entity selector JS code a little
This commit is contained in:
@ -84,4 +84,23 @@ class EntityProvider
|
||||
$type = strtolower($type);
|
||||
return $this->all()[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the morph classes, as an array, for a single or multiple types.
|
||||
* @param string|array $types
|
||||
* @return array<string>
|
||||
*/
|
||||
public function getMorphClasses($types)
|
||||
{
|
||||
if (is_string($types)) {
|
||||
$types = [$types];
|
||||
}
|
||||
|
||||
$morphClasses = [];
|
||||
foreach ($types as $type) {
|
||||
$model = $this->get($type);
|
||||
$morphClasses[] = $model->getMorphClass();
|
||||
}
|
||||
return $morphClasses;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user