From 07df5914ef66c27bdc9889dadcc72859831ae793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Parafi=C5=84ski?= Date: Wed, 20 Feb 2019 14:52:19 +0100 Subject: [PATCH] EZP-29990: Use contentTypeDraftMapper as dependency --- src/bundle/Controller/ContentTypeController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bundle/Controller/ContentTypeController.php b/src/bundle/Controller/ContentTypeController.php index 21ee661314..4254aa187f 100644 --- a/src/bundle/Controller/ContentTypeController.php +++ b/src/bundle/Controller/ContentTypeController.php @@ -75,6 +75,9 @@ class ContentTypeController extends Controller /** @var \EzSystems\EzPlatformAdminUi\Form\Factory\ContentTypeFormFactory */ private $contentTypeFormFactory; + /** @var \EzSystems\RepositoryForms\Data\Mapper\ContentTypeDraftMapper */ + private $contentTypeDraftMapper; + /** * @param \EzSystems\EzPlatformAdminUi\Notification\NotificationHandlerInterface $notificationHandler * @param \Symfony\Component\Translation\TranslatorInterface $translator @@ -99,7 +102,8 @@ public function __construct( int $defaultPaginationLimit, UserService $userService, LanguageService $languageService, - ContentTypeFormFactory $contentTypeFormFactory + ContentTypeFormFactory $contentTypeFormFactory, + ContentTypeDraftMapper $contentTypeDraftMapper ) { $this->notificationHandler = $notificationHandler; $this->translator = $translator; @@ -112,6 +116,7 @@ public function __construct( $this->userService = $userService; $this->languageService = $languageService; $this->contentTypeFormFactory = $contentTypeFormFactory; + $this->contentTypeDraftMapper = $contentTypeDraftMapper; } /** @@ -623,7 +628,7 @@ public function createUpdateForm( Language $language = null, ?Language $baseLanguage = null ): FormInterface { - $contentTypeData = (new ContentTypeDraftMapper())->mapToFormData( + $contentTypeData = $this->contentTypeDraftMapper->mapToFormData( $contentTypeDraft, [ 'language' => $language,