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
add ResultLimit feature, implements ideas from #29 #57
Conversation
Quick feedback:
|
|
{ | ||
} | ||
|
||
public static function setFields($fields) |
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 suggest doing type hinting here array $fields
instead of the is_array()
check below
@rndstr: i sticked to isFieldSet as isFieldIncluded seems to be confusing to me, as the field is not yet included, we want to know if it should be or not. |
Thanks for the changes! I'm okay with ResultLimit being static for now I guess. But looking at the code, I see you are only checking for the |
|
Merged, thanks! |
this implements some things discussed in issue #29.
default is to return all fields. if fields parameter is set, only the defined fields are returned as long as there is a check in the code, where the field is added to the result. this can be done like:
these checks are implemented in Transport\Entity\Schedule\Connection for the fields "from", "to" and "journey" to show how this works.
Tree like fields are also possible, eg:
in that case, ResultLimit::includeField('from') returnes true, as there is a more specific field set.
any comments are appreciated.