-
Notifications
You must be signed in to change notification settings - Fork 87
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
IBX-7418: ContentName
search criterion added
#2364
Conversation
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 think the example is wrong, where is it coming from?
According to the constructor only string value is accepted - meaning that multiple values (arrays) are not valid arguments (see: https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/Query/Criterion/ContentName.php#L16)
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 think the example is wrong, where is it coming from?
According to the constructor only string value is accepted - meaning that multiple values (arrays) are not valid arguments (see: https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/Query/Criterion/ContentName.php#L16)
I confirm what Marek wrote.
Why do we have such inconsistency? In description int(s) representing the Content name
. Next in PHP example array of strings ['laptop', 'tablet']
. Finally, REST examples with a single string value.
Examples from original PR (ibexa/core#312) are clear. String value supporting wildcards.
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.
The example is still not correct.
Your example:
$query->query = new Criterion\ContentName(['laptop', 'tablet']);
passes an array with two values (laptop, tablet)
According to the code only a single value is accepted (https://github.com/ibexa/core/blob/main/src/contracts/Repository/Values/Content/Query/Criterion/ContentName.php#L16) (string $value
means that arrays are not allowed).
Please take a look at the examples in ibexa/core#312 - single arguments are given.
new ContentName('phrase');
new ContentName('phra*');
new ContentName('*phrase*');
new ContentName('phr*se*');
are all valid
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.
Looks good now, thank you!
* ContentName search criterion added * mkdocs updated * Fixes after review * Fixes * Fix * typo * Fix
ContentName
search criterion added in dev-doc.Checklist