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

Fix return type of QueryInterface::execute() #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sascha-egerer
Copy link
Owner

@sascha-egerer sascha-egerer commented May 22, 2024

The execute method has a boolean argument that
defines if a raw result should be returned.
This means that no object mapping is done but
an array containing the result values is returned.

It is now also supported to not just pass constant boolean values but a variable containing a boolean to the execute function. In this case it's not clear if a raw result or objects should be returned
so we do now return a union type containing both.

@sascha-egerer sascha-egerer force-pushed the bugfix/fix-query-execute-return-type branch from 0d06dc4 to 5bd227d Compare May 22, 2024 14:07
The `execute()` method has a boolean argument that
defines if a raw result should be returned.
This means that no object mapping is done but
an array containing the result values is returned.

It is now also supported to not just pass constant
boolean values but a variable containing a boolean
to the execute function. In this case it's not clear
if a raw result or objects should be returned
so we do now return a union type containing both.
@sascha-egerer sascha-egerer force-pushed the bugfix/fix-query-execute-return-type branch from 5bd227d to 82579a4 Compare May 22, 2024 14:37
@@ -6,12 +6,6 @@ namespace TYPO3\CMS\Extbase\Persistence;
*/
interface QueryInterface
{
/**
* @param bool $returnRawQueryResult
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<ModelType>|array<string, mixed>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have now updated the second type to be a list: b56227c

Do we then need changes to the DynamicReturnTypeExtension in this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants