-
Couldn't load subscription status.
- Fork 16
IBX-7603: Added missing subfield for ezurl #137
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f616e1f
IBX-7603: Added missing subfield for ezurl
mateuszdebinski b278248
IBX-7603: A new flag has been introduced that generates a different s…
mateuszdebinski f0db3d6
Used DecoratingFieldDefinitionMapper for UrlFieldDefinitionMapper, re…
mateuszdebinski 98faf30
Restored support PHP 7.3
mateuszdebinski d41943d
Corrected code for PHP 7.3, changed parameter to default false
mateuszdebinski b203ffe
Restored UrlFieldInput
mateuszdebinski 73617fb
Corrected CS
mateuszdebinski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
55 changes: 55 additions & 0 deletions
55
src/Schema/Domain/Content/Mapper/FieldDefinition/UrlFieldDefinitionMapper.php
This file contains hidden or 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,55 @@ | ||
| <?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\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition; | ||
|
|
||
| use EzSystems\EzPlatformGraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper; | ||
| use EzSystems\EzPlatformGraphQL\Schema\Domain\Content\Mapper\FieldDefinition\FieldDefinitionMapper; | ||
| use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition; | ||
|
|
||
| final class UrlFieldDefinitionMapper extends DecoratingFieldDefinitionMapper implements FieldDefinitionMapper | ||
| { | ||
| private const FIELD_TYPE_IDENTIFIER = 'ezurl'; | ||
|
|
||
| /** @var bool */ | ||
| private $shouldExtendUrlInputType; | ||
konradoboza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public function __construct( | ||
| FieldDefinitionMapper $innerMapper, | ||
| bool $shouldExtendUrlInputType | ||
| ) { | ||
| parent::__construct($innerMapper); | ||
| $this->shouldExtendUrlInputType = $shouldExtendUrlInputType; | ||
| } | ||
|
|
||
| public function mapToFieldValueType(FieldDefinition $fieldDefinition): string | ||
| { | ||
| $type = parent::mapToFieldValueType($fieldDefinition); | ||
| if (!$this->canMap($fieldDefinition)) { | ||
| return $type; | ||
| } | ||
|
|
||
| if ($this->shouldExtendUrlInputType) { | ||
| $type = 'UrlFieldValue'; | ||
| } else { | ||
| @trigger_error( | ||
| 'The return type `string` for the URL field has been deprecated since version 3.3 ' . | ||
| 'and will be removed in version 5.0. To start receiving `UrlFieldInput` instead of the deprecated ' . | ||
| '`string`, set the parameter `ibexa.graphql.schema.should.extend.ezurl` to `true`.', | ||
| E_USER_DEPRECATED | ||
| ); | ||
| } | ||
|
|
||
| return $type; | ||
| } | ||
|
|
||
| protected function getFieldTypeIdentifier(): string | ||
| { | ||
| return self::FIELD_TYPE_IDENTIFIER; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.