-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBX-1260: As a Developer, I want to extend Content Type Create/Update…
… views
- Loading branch information
Showing
3 changed files
with
172 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\View; | ||
|
||
use eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft; | ||
use eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup; | ||
use eZ\Publish\Core\MVC\Symfony\View\BaseView; | ||
use Symfony\Component\Form\FormInterface; | ||
|
||
final class ContentTypeCreateView extends BaseView | ||
{ | ||
/** @var \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup */ | ||
private $contentTypeGroup; | ||
|
||
/** @var \eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft */ | ||
private $contentTypeDraft; | ||
|
||
/** @var \Symfony\Component\Form\FormInterface */ | ||
private $form; | ||
|
||
public function getContentTypeGroup(): ContentTypeGroup | ||
{ | ||
return $this->contentTypeGroup; | ||
} | ||
|
||
public function setContentTypeGroup(ContentTypeGroup $contentTypeGroup): void | ||
{ | ||
$this->contentTypeGroup = $contentTypeGroup; | ||
} | ||
|
||
public function getContentTypeDraft(): ContentTypeDraft | ||
{ | ||
return $this->contentTypeDraft; | ||
} | ||
|
||
public function setContentTypeDraft(ContentTypeDraft $contentTypeDraft): void | ||
{ | ||
$this->contentTypeDraft = $contentTypeDraft; | ||
} | ||
|
||
public function getForm(): FormInterface | ||
{ | ||
return $this->form; | ||
} | ||
|
||
public function setForm(FormInterface $form): void | ||
{ | ||
$this->form = $form; | ||
} | ||
|
||
/** | ||
* @return array<string,mixed> | ||
*/ | ||
protected function getInternalParameters(): array | ||
{ | ||
return [ | ||
'content_type_group' => $this->contentTypeGroup, | ||
'content_type' => $this->contentTypeDraft, | ||
'form' => $this->form ? $this->form->createView() : null, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\AdminUi\View; | ||
|
||
use eZ\Publish\API\Repository\Values\Content\Language; | ||
use eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft; | ||
use eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup; | ||
use eZ\Publish\Core\MVC\Symfony\View\BaseView; | ||
use Symfony\Component\Form\FormInterface; | ||
|
||
final class ContentTypeEditView extends BaseView | ||
{ | ||
/** @var \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup */ | ||
private $contentTypeGroup; | ||
|
||
/** @var \eZ\Publish\API\Repository\Values\ContentType\ContentTypeDraft */ | ||
private $contentTypeDraft; | ||
|
||
/** @var \eZ\Publish\API\Repository\Values\Content\Language */ | ||
private $language; | ||
|
||
/** @var \Symfony\Component\Form\FormInterface */ | ||
private $form; | ||
|
||
public function getContentTypeGroup(): ContentTypeGroup | ||
{ | ||
return $this->contentTypeGroup; | ||
} | ||
|
||
public function setContentTypeGroup(ContentTypeGroup $contentTypeGroup): void | ||
{ | ||
$this->contentTypeGroup = $contentTypeGroup; | ||
} | ||
|
||
public function getContentTypeDraft(): ContentTypeDraft | ||
{ | ||
return $this->contentTypeDraft; | ||
} | ||
|
||
public function setContentTypeDraft(ContentTypeDraft $contentTypeDraft): void | ||
{ | ||
$this->contentTypeDraft = $contentTypeDraft; | ||
} | ||
|
||
public function getLanguage(): ?Language | ||
{ | ||
return $this->language; | ||
} | ||
|
||
public function setLanguage(?Language $language): void | ||
{ | ||
$this->language = $language; | ||
} | ||
|
||
public function getForm(): FormInterface | ||
{ | ||
return $this->form; | ||
} | ||
|
||
public function setForm(FormInterface $form): void | ||
{ | ||
$this->form = $form; | ||
} | ||
|
||
/** | ||
* @return array<string,mixed> | ||
*/ | ||
protected function getInternalParameters(): array | ||
{ | ||
return [ | ||
'content_type_group' => $this->contentTypeGroup, | ||
'content_type' => $this->contentTypeDraft, | ||
'form' => $this->form ? $this->form->createView() : null, | ||
'language_code' => $this->language->languageCode, | ||
]; | ||
} | ||
} |