Skip to content

Commit

Permalink
EZP-29990: Use contentTypeDraftMapper as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Feb 20, 2019
1 parent c7eb122 commit 07df591
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bundle/Controller/ContentTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -112,6 +116,7 @@ public function __construct(
$this->userService = $userService;
$this->languageService = $languageService;
$this->contentTypeFormFactory = $contentTypeFormFactory;
$this->contentTypeDraftMapper = $contentTypeDraftMapper;
}

/**
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 07df591

Please sign in to comment.