-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update entity.rst #18905
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
Update entity.rst #18905
Conversation
@@ -49,7 +49,7 @@ Using a Custom Query for the Entities | |||
|
|||
If you want to create a custom query to use when fetching the entities | |||
(e.g. you only want to return some entities, or need to order them), use | |||
the `query_builder`_ option:: | |||
the `query_builder`_ option. Please note, that `query_builder` is used to compose data, not fetch real final results:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this change. In the description of the query_builder
option we have this:
The value of this option can either be a
QueryBuilder
object, a callable ornull
(which will load all entities). When using a callable, you will be passed theEntityRepository
of the entity as the only argument and should return aQueryBuilder
. Returningnull
in the Closure will result in loading all entities.
Maybe change this line to something like this:
the `query_builder`_ option. Please note, that `query_builder` is used to compose data, not fetch real final results:: | |
the `query_builder`_ option (which must be a `QueryBuilder` object, a closure returning a `QueryBuilder` object or `null` to load all entities):: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like a lot this proposal. @toci-to-ci do you like it too? If this is more clear for you now, we can merge this suggestion. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz There is a lot of questions (stackoverflow ie) WHY error apears when using 'query_builder', PPL are using EntityType in Form same as Repository and fetch data which generate error message. The sugestion of @xabbuch is OK, it is mentioned earlier in documentation how field can act,
I just want to point out, that 'query_builder' is different way to extract (prepare) data than typical EntityRepository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now merged. While merging it I reworded as suggested by @xabbuh.
query_builder option - more clear explained
2a2fb3b
to
a938b6d
Compare
Piotr, thanks for this contribution to make docs better. |
query_builder option - more clear explained