From 9bb5f561c27a7cf68497e19d953b0ba7824d5f18 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 11 Mar 2021 21:23:41 +0100 Subject: [PATCH] draft ::with() function for models --- Controller/BackendController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index d0fc519..42b3e25 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -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