draft ::with() function for models

This commit is contained in:
Dennis Eichhorn 2021-03-11 21:23:41 +01:00
parent 26c596d0dc
commit 9bb5f561c2

View File

@ -101,7 +101,7 @@ final class BackendController extends Controller
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005301001, $request, $response));
$path = \str_replace('+', ' ', (string) ($request->getData('path') ?? '/'));
$docs = EditorDocMapper::withConditional('language', $response->getLanguage())::getByVirtualPath($path, $request->header->account);
$docs = EditorDocMapper::with('language', $response->getLanguage())::getByVirtualPath($path, $request->header->account);
list($collection, $parent) = CollectionMapper::getCollectionsByPath($path);
@ -130,7 +130,7 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
/** @var \Modules\Editor\Models\EditorDoc $doc */
$doc = EditorDocMapper::withConditional('language', $response->getLanguage())::get((int) $request->getData('id'));
$doc = EditorDocMapper::with('language', $response->getLanguage())::get((int) $request->getData('id'));
$accountId = $request->header->account;
if ($doc->createdBy->getId() !== $accountId