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

Laravel: Use Model::qualifyColumn() instead of $table.$column #6658

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

GromNaN
Copy link
Contributor

@GromNaN GromNaN commented Sep 21, 2024

Q A
Branch? 4.0
Tickets -
License MIT
Doc PR -

The function Model::qualifyColumn() does exactly the same as the existing code. But for MongoDB, we had to override this method as the column name (field name) cannot be prefixed with the table name (collection name). So we need this method to be used instead of having the logic hard coded.

For relations, we use the getQualifiedForeignKeyName that has the same mechanism for BelongsTo and HasOneOrManyThrough , but nothing for HasOneOrMany (I don't know why 😞).

@soyuka soyuka merged commit a6e3706 into api-platform:4.0 Sep 23, 2024
55 of 59 checks passed
@soyuka
Copy link
Member

soyuka commented Sep 23, 2024

Awesome thanks @GromNaN ! It's possible that within some filters we're using the same mechanics. With Doctrine we had to duplicate each filter, maybe that with Eloquent we can use the exact same filters?

@GromNaN GromNaN deleted the laravel-qualify branch September 23, 2024 12:58
@GromNaN
Copy link
Contributor Author

GromNaN commented Sep 23, 2024

It's possible that within some filters we're using the same mechanics. With Doctrine we had to duplicate each filter, maybe that with Eloquent we can use the exact same filters?

I haven't found any other place where the column name is prefixed.

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