From 1fa482ebfe4e8300e41cc8b9ab07b57105a30e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edi=20Modri=C4=87?= Date: Fri, 13 Dec 2024 15:49:26 +0100 Subject: [PATCH] Rename methods --- lib/API/RelationService.php | 4 ++-- lib/API/Values/Content.php | 16 ++++++++-------- lib/Core/Site/RelationService.php | 4 ++-- lib/Core/Site/Values/Content.php | 32 +++++++++++++++---------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/API/RelationService.php b/lib/API/RelationService.php index 166310cd..0be37914 100644 --- a/lib/API/RelationService.php +++ b/lib/API/RelationService.php @@ -68,7 +68,7 @@ public function loadFieldRelationLocations( * * @return \Netgen\IbexaSiteApi\API\Values\Content[] */ - public function loadReverseRelations( + public function loadReverseFieldRelations( Content $content, string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], @@ -83,7 +83,7 @@ public function loadReverseRelations( * * @return \Netgen\IbexaSiteApi\API\Values\Location[] */ - public function loadReverseRelationLocations( + public function loadReverseFieldRelationLocations( Content $content, string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], diff --git a/lib/API/Values/Content.php b/lib/API/Values/Content.php index b588887c..b0209c48 100644 --- a/lib/API/Values/Content.php +++ b/lib/API/Values/Content.php @@ -201,14 +201,14 @@ abstract public function filterSudoFieldRelationLocations( * * @return \Netgen\IbexaSiteApi\API\Values\Content[] */ - abstract public function getReverseRelations(string $fieldDefinitionIdentifier, int $limit = 25): array; + abstract public function getReverseFieldRelations(string $fieldDefinitionIdentifier, int $limit = 25): array; /** * Return all reverse related Content from $fieldDefinitionIdentifier using repository sudo. * * @return \Netgen\IbexaSiteApi\API\Values\Content[] */ - abstract public function getSudoReverseRelations(string $fieldDefinitionIdentifier, int $limit = 25): array; + abstract public function getSudoReverseFieldRelations(string $fieldDefinitionIdentifier, int $limit = 25): array; /** * Return reverse related Content from $fieldDefinitionIdentifier field, @@ -218,7 +218,7 @@ abstract public function getSudoReverseRelations(string $fieldDefinitionIdentifi * * @return \Pagerfanta\Pagerfanta Pagerfanta instance iterating over Site API Content items */ - abstract public function filterReverseRelations( + abstract public function filterReverseFieldRelations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, @@ -233,7 +233,7 @@ abstract public function filterReverseRelations( * * @return \Pagerfanta\Pagerfanta Pagerfanta instance iterating over Site API Content items */ - abstract public function filterSudoReverseRelations( + abstract public function filterSudoReverseFieldRelations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, @@ -245,14 +245,14 @@ abstract public function filterSudoReverseRelations( * * @return \Netgen\IbexaSiteApi\API\Values\Location[] */ - abstract public function getReverseRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array; + abstract public function getReverseFieldRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array; /** * Return all reverse related Locations from $fieldDefinitionIdentifier using repository sudo. * * @return \Netgen\IbexaSiteApi\API\Values\Location[] */ - abstract public function getSudoReverseRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array; + abstract public function getSudoReverseFieldRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array; /** * Return reverse related Locations from $fieldDefinitionIdentifier field, @@ -262,7 +262,7 @@ abstract public function getSudoReverseRelationLocations(string $fieldDefinition * * @return \Pagerfanta\Pagerfanta Pagerfanta instance iterating over Site API Locations */ - abstract public function filterReverseRelationLocations( + abstract public function filterReverseFieldRelationLocations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, @@ -277,7 +277,7 @@ abstract public function filterReverseRelationLocations( * * @return \Pagerfanta\Pagerfanta Pagerfanta instance iterating over Site API Locations */ - abstract public function filterSudoReverseRelationLocations( + abstract public function filterSudoReverseFieldRelationLocations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, diff --git a/lib/Core/Site/RelationService.php b/lib/Core/Site/RelationService.php index cdab0a7a..df56c9a5 100644 --- a/lib/Core/Site/RelationService.php +++ b/lib/Core/Site/RelationService.php @@ -142,7 +142,7 @@ public function loadFieldRelationLocations( return $locations; } - public function loadReverseRelations( + public function loadReverseFieldRelations( Content $content, string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], @@ -169,7 +169,7 @@ public function loadReverseRelations( return $this->extractContentItems($result); } - public function loadReverseRelationLocations( + public function loadReverseFieldRelationLocations( Content $content, string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], diff --git a/lib/Core/Site/Values/Content.php b/lib/Core/Site/Values/Content.php index ab39085c..d8a69350 100644 --- a/lib/Core/Site/Values/Content.php +++ b/lib/Core/Site/Values/Content.php @@ -351,9 +351,9 @@ public function filterSudoFieldRelationLocations( ); } - public function getReverseRelations(string $fieldDefinitionIdentifier, int $limit = 25): array + public function getReverseFieldRelations(string $fieldDefinitionIdentifier, int $limit = 25): array { - return $this->site->getRelationService()->loadReverseRelations( + return $this->site->getRelationService()->loadReverseFieldRelations( $this, $fieldDefinitionIdentifier, [], @@ -361,20 +361,20 @@ public function getReverseRelations(string $fieldDefinitionIdentifier, int $limi ); } - public function getSudoReverseRelations(string $fieldDefinitionIdentifier, int $limit = 25): array + public function getSudoReverseFieldRelations(string $fieldDefinitionIdentifier, int $limit = 25): array { return $this->repository->sudo( - fn () => $this->getReverseRelations($fieldDefinitionIdentifier, $limit), + fn () => $this->getReverseFieldRelations($fieldDefinitionIdentifier, $limit), ); } - public function filterReverseRelations( + public function filterReverseFieldRelations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, int $currentPage = 1, ): Pagerfanta { - $relations = $this->site->getRelationService()->loadReverseRelations( + $relations = $this->site->getRelationService()->loadReverseFieldRelations( $this, $fieldDefinitionIdentifier, $contentTypeIdentifiers, @@ -389,14 +389,14 @@ public function filterReverseRelations( return $pager; } - public function filterSudoReverseRelations( + public function filterSudoReverseFieldRelations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, int $currentPage = 1, ): Pagerfanta { return $this->repository->sudo( - fn () => $this->filterReverseRelations( + fn () => $this->filterReverseFieldRelations( $fieldDefinitionIdentifier, $contentTypeIdentifiers, $maxPerPage, @@ -405,9 +405,9 @@ public function filterSudoReverseRelations( ); } - public function getReverseRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array + public function getReverseFieldRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array { - return $this->site->getRelationService()->loadReverseRelationLocations( + return $this->site->getRelationService()->loadReverseFieldRelationLocations( $this, $fieldDefinitionIdentifier, [], @@ -415,20 +415,20 @@ public function getReverseRelationLocations(string $fieldDefinitionIdentifier, i ); } - public function getSudoReverseRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array + public function getSudoReverseFieldRelationLocations(string $fieldDefinitionIdentifier, int $limit = 25): array { return $this->repository->sudo( - fn () => $this->getReverseRelationLocations($fieldDefinitionIdentifier, $limit), + fn () => $this->getReverseFieldRelationLocations($fieldDefinitionIdentifier, $limit), ); } - public function filterReverseRelationLocations( + public function filterReverseFieldRelationLocations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, int $currentPage = 1, ): Pagerfanta { - $relations = $this->site->getRelationService()->loadReverseRelationLocations( + $relations = $this->site->getRelationService()->loadReverseFieldRelationLocations( $this, $fieldDefinitionIdentifier, $contentTypeIdentifiers, @@ -443,14 +443,14 @@ public function filterReverseRelationLocations( return $pager; } - public function filterSudoReverseRelationLocations( + public function filterSudoReverseFieldRelationLocations( string $fieldDefinitionIdentifier, array $contentTypeIdentifiers = [], int $maxPerPage = 25, int $currentPage = 1, ): Pagerfanta { return $this->repository->sudo( - fn () => $this->filterReverseRelationLocations( + fn () => $this->filterReverseFieldRelationLocations( $fieldDefinitionIdentifier, $contentTypeIdentifiers, $maxPerPage,