BookStack\Repos\TagRepo::getEntity PHP Method

getEntity() public method

Get an entity instance of its particular type.
public getEntity ( $entityType, $entityId, string $action = 'view' )
$entityType
$entityId
$action string
    public function getEntity($entityType, $entityId, $action = 'view')
    {
        $entityInstance = $this->entity->getEntityInstance($entityType);
        $searchQuery = $entityInstance->where('id', '=', $entityId)->with('tags');
        $searchQuery = $this->permissionService->enforceEntityRestrictions($searchQuery, $action);
        return $searchQuery->first();
    }