Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored ContentType::isContainer property to method changed #491

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bundle/Core/Command/CopySubtreeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$targetLocation->getContentInfo()->contentTypeId
);

if (!$targetContentType->isContainer) {
if (!$targetContentType->isContainer()) {
throw new InvalidArgumentException(
'target-location-id',
'The selected Location cannot contain children'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* @property-read string $remoteId a global unique id of the content object
* @property-read string $urlAliasSchema URL alias schema. If nothing is provided, $nameSchema will be used instead.
* @property-read string $nameSchema The name schema.
* @property-read bool $isContainer @deprecated use strict getter {@see ContentType::isContainer} instead.
* @property-read string $mainLanguageCode the main language of the content type names and description used for fallback.
* @property-read bool $defaultAlwaysAvailable if an instance of a content type is created the always available flag is set by default this this value.
* @property-read string[] $languageCodes array of language codes used by content type translations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ final class ContentContainerSpecification implements ContentSpecification
{
public function isSatisfiedBy(Content $content): bool
{
return $content->getContentType()->isContainer;
return $content->getContentType()->isContainer();
}
}
2 changes: 1 addition & 1 deletion src/lib/Repository/LocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public function moveSubtree(APILocation $location, APILocation $newParentLocatio
);
}
$contentTypeId = $newParentLocation->contentInfo->contentTypeId;
if (!$this->contentTypeService->loadContentType($contentTypeId)->isContainer) {
if (!$this->contentTypeService->loadContentType($contentTypeId)->isContainer()) {
throw new InvalidArgumentException(
'$newParentLocation',
'Cannot move Location to a parent that is not a container'
Expand Down
3 changes: 2 additions & 1 deletion src/lib/Repository/Mapper/ContentTypeDomainMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function buildSPIContentTypeUpdateStruct(APIContentTypeDraft $contentType

$updateStruct->isContainer = $contentTypeUpdateStruct->isContainer !== null ?
$contentTypeUpdateStruct->isContainer :
$contentTypeDraft->isContainer;
$contentTypeDraft->isContainer();
$updateStruct->sortField = $contentTypeUpdateStruct->defaultSortField !== null ?
$contentTypeUpdateStruct->defaultSortField :
$contentTypeDraft->defaultSortField;
Expand Down Expand Up @@ -183,6 +183,7 @@ public function buildContentTypeDraftDomainObject(SPIContentType $spiContentType
return new ContentTypeDraft(
[
'innerContentType' => $this->buildContentTypeDomainObject($spiContentType),
'isContainer' => false,
]
);
}
Expand Down
Loading