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

IBX-7911: Used strict getters for content tree loading code paths #347

Merged
merged 20 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
aa9a7a4
Introduced dedicated getter for Content item Id
alongosz Feb 13, 2024
65bb33d
Introduced Value Object strict getters and deprecated magic ones
alongosz Mar 8, 2024
3a115e9
Replaced usages of magic getters with strict ones relevant to the issue
alongosz Mar 8, 2024
631a80b
Fixed ContentDomainMapper::buildDomainFields union type argument issue
alongosz May 23, 2024
4a0dde7
Simplified Contracts Values\Content\Content::getId implementation
alongosz May 24, 2024
5617a21
Fixed `@property-read` deprecation message to follow the convention
alongosz May 24, 2024
089b420
Added missing Contracts Content\Location::getPath getter
alongosz May 24, 2024
3fce712
Improved deprecation message for ContentDomainMapper::buildDomainFields
alongosz May 24, 2024
38302bd
[Tests] Added coverage for strict getters
alongosz May 23, 2024
85080cc
[Tests] Aligned tests with the changes
alongosz May 23, 2024
fd88c0d
[Tests] Added coverage for strict getters of SimplifiedRequest
alongosz May 24, 2024
c4bea96
[Tests] Dropped obsolete `->with()` call from UserTest
alongosz May 24, 2024
72ba83d
[Tests] Introduced symfony/phpunit-bridge deprecations helper
alongosz May 24, 2024
7a9278d
[Tests] Added coverage for the new deprecation message
alongosz May 24, 2024
d4dffb9
[PHPStan] Aligned baseline with the changes
alongosz May 23, 2024
6f2708b
[PHPStan] Aligned baseline with the changes
alongosz May 24, 2024
7869457
Moved `Location::$path` magic getter logic to `Location::getPath()`
alongosz May 24, 2024
6b519c0
[Tests] Added coverage for `Location::getPath()`
alongosz May 24, 2024
49808a9
[PHPStan] Aligned baseline with the changes
alongosz May 24, 2024
e6b2575
[PHPStan] Updated baseline after PHPStan release
alongosz May 24, 2024
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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"ibexa/code-style": "^1.0",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"symfony/phpunit-bridge": "^5.1",
"symfony/phpunit-bridge": "^5.4",
"symfony/proxy-manager-bridge": "^5.3",
"symfony/runtime": "^5.3.0",
"phpstan/phpstan": "^1.2",
Expand Down
123 changes: 29 additions & 94 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20230,16 +20230,6 @@ parameters:
count: 1
path: src/lib/Repository/Mapper/ContentDomainMapper.php

-
message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Mapper\\\\ContentDomainMapper\\:\\:buildDomainFields\\(\\) has parameter \\$prioritizedLanguages with no value type specified in iterable type array\\.$#"
count: 1
path: src/lib/Repository/Mapper/ContentDomainMapper.php

-
message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Mapper\\\\ContentDomainMapper\\:\\:buildDomainFields\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/lib/Repository/Mapper/ContentDomainMapper.php

-
message: "#^Method Ibexa\\\\Core\\\\Repository\\\\Mapper\\\\ContentDomainMapper\\:\\:buildLocation\\(\\) has parameter \\$prioritizedLanguages with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -47765,11 +47755,6 @@ parameters:
count: 1
path: tests/lib/MVC/Symfony/Security/UserTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\MVC\\\\Symfony\\\\Security\\\\UserTest\\:\\:testToString\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/MVC/Symfony/Security/UserTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\MVC\\\\Symfony\\\\Security\\\\UserWrappedTest\\:\\:testGetSetAPIUser\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -58886,79 +58871,79 @@ parameters:
path: tests/lib/Repository/Service/Mock/ContentTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:getContentHandlerMock\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:getContentHandlerMock\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:getLanguageHandlerMock\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Language\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:getLanguageHandlerMock\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Language\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:getTypeHandlerMock\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Type\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:getTypeHandlerMock\\(\\) should return Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Type\\\\Handler&PHPUnit\\\\Framework\\\\MockObject\\\\MockObject but returns PHPUnit\\\\Framework\\\\MockObject\\\\MockObject\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:providerForBuildLocationDomainObjectsOnSearchResult\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:providerForBuildLocationDomainObjectsOnSearchResult\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:providerForBuildVersionInfo\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:providerForBuildVersionInfo\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$contentIds with no value type specified in iterable type array\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$contentIds with no value type specified in iterable type array\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$contentInfoList with no value type specified in iterable type array\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$contentInfoList with no value type specified in iterable type array\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$languageFilter with no value type specified in iterable type array\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$locationHits with no value type specified in iterable type array\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationDomainObjectsOnSearchResult\\(\\) has parameter \\$locationHits with no value type specified in iterable type array\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationWithContentForRootLocation\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationWithContentForRootLocation\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationWithContentIsAlignedWithBuildLocation\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationWithContentIsAlignedWithBuildLocation\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildLocationWithContentThrowsInvalidArgumentException\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildLocationWithContentThrowsInvalidArgumentException\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\DomainMapperTest\\:\\:testBuildVersionInfo\\(\\) has no return type specified\\.$#"
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Service\\\\Mock\\\\ContentDomainMapperTest\\:\\:testBuildVersionInfo\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Parameter \\#2 \\$locationHandler of class Ibexa\\\\Core\\\\Repository\\\\Mapper\\\\ContentDomainMapper constructor expects Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Location\\\\Handler, PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#"
count: 1
path: tests/lib/Repository/Service/Mock/DomainMapperTest.php
path: tests/lib/Repository/Service/Mock/ContentDomainMapperTest.php

-
message: "#^Call to an undefined method Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\User\\\\Handler\\:\\:expects\\(\\)\\.$#"
Expand Down Expand Up @@ -61400,31 +61385,6 @@ parameters:
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\LocationTest\\:\\:testIsPropertySet\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\LocationTest\\:\\:testMissingProperty\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\LocationTest\\:\\:testNewClass\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\LocationTest\\:\\:testReadOnlyProperty\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\LocationTest\\:\\:testUnsetProperty\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/LocationTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Query\\\\Aggregation\\\\RangeTest\\:\\:dataProviderForTestToString\\(\\) return type has no value type specified in iterable type iterable\\.$#"
count: 1
Expand Down Expand Up @@ -61505,31 +61465,6 @@ parameters:
count: 1
path: tests/lib/Repository/Values/Content/TrashItemTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\VersionInfoTest\\:\\:createVersionInfoWithStatus\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/VersionInfoTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\VersionInfoTest\\:\\:createVersionInfoWithStatus\\(\\) has parameter \\$status with no type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/VersionInfoTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\VersionInfoTest\\:\\:testIsArchived\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/VersionInfoTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\VersionInfoTest\\:\\:testIsDraft\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/VersionInfoTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\Content\\\\VersionInfoTest\\:\\:testIsPublished\\(\\) has no return type specified\\.$#"
count: 1
path: tests/lib/Repository/Values/Content/VersionInfoTest.php

-
message: "#^Method Ibexa\\\\Tests\\\\Core\\\\Repository\\\\Values\\\\ContentType\\\\ContentTypeDraftTest\\:\\:testObjectProperties\\(\\) has no return type specified\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions phpunit-integration-legacy-solr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<env name="KERNEL_CLASS" value="Ibexa\Contracts\Solr\Test\IbexaSolrTestKernel"/>
<env name="SEARCH_ENGINE" value="solr"/>
<env name="DATABASE_URL" value="sqlite://:memory:" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<testsuites>
<!-- Search service is used all over the place, so we must run entire integration test suite -->
Expand Down
1 change: 1 addition & 0 deletions phpunit-integration-legacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<env name="DATABASE_URL" value="sqlite://:memory:" />
<env name="KERNEL_CLASS" value="Ibexa\Contracts\Core\Test\IbexaTestKernel"/>
<env name="SEARCH_ENGINE" value="legacy"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<testsuites>
<testsuite name="integration_core">
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<php>
<ini name="error_reporting" value="-1" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[total]=576&amp;verbose=0"/>
</php>
<testsuites>
<testsuite name="unit_core">
Expand All @@ -33,4 +33,7 @@
<directory>tests/bundle/LegacySearchEngineBundle</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
</phpunit>
14 changes: 12 additions & 2 deletions src/contracts/Repository/Values/Content/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@
/**
* this class represents a content object in a specific version.
*
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo convenience getter for getVersionInfo()->getContentInfo()
* @property-read int $id convenience getter for retrieving the contentId: $versionInfo->contentInfo->id
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Content::getContentInfo()} instead.
* @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Content::getId()} instead.
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo calls getVersionInfo()
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $fields access fields, calls getFields()
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\Thumbnail|null $thumbnail calls getThumbnail()
*/
abstract class Content extends ValueObject
{
public function getId(): int
{
return $this->getContentInfo()->getId();
}

public function getContentInfo(): ContentInfo
{
return $this->getVersionInfo()->getContentInfo();
}

/**
* Returns the VersionInfo for this version.
*
Expand Down
16 changes: 13 additions & 3 deletions src/contracts/Repository/Values/Content/ContentInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
/**
* This class provides all version independent information of the Content object.
*
* @property-read int $id @deprecated Use {@see ContentInfo::getId} instead. The unique id of the Content object
* @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentInfo::getId()} instead.
* @property-read int $contentTypeId The unique id of the content type item the Content object is an instance of
* @property-read string $name the computed name (via name schema) in the main language of the Content object
* @property-read string $name @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentInfo::getName()} instead.
* @property-read int $sectionId @deprecated 4.6.2 Use {@see ContentInfo::getSectionId} instead. The section to which the Content object is assigned
* @property-read int $currentVersionNo Current Version number is the version number of the published version or the version number of a newly created draft (which is 1).
* @property-read bool $published true if there exists a published version false otherwise
Expand All @@ -29,7 +29,7 @@
* @property-read string $mainLanguageCode The main language code of the Content object. If the available flag is set to true the Content is shown in this language if the requested language does not exist.
* @property-read int|null $mainLocationId @deprecated Use {@see ContentInfo::getMainLocationId} instead
* @property-read int $status status of the Content object
* @property-read bool $isHidden status of the Content object
* @property-read bool $isHidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentInfo::isHidden()} instead.
*/
class ContentInfo extends ValueObject
{
Expand Down Expand Up @@ -185,6 +185,11 @@ public function isTrashed(): bool
return $this->status === self::STATUS_TRASHED;
}

public function isHidden(): bool
{
return $this->isHidden;
}

public function getContentType(): ContentType
{
return $this->contentType;
Expand Down Expand Up @@ -229,6 +234,11 @@ public function getId(): int
{
return $this->id;
}

public function getName(): string
{
return $this->name;
}
}

class_alias(ContentInfo::class, 'eZ\Publish\API\Repository\Values\Content\ContentInfo');
Loading
Loading