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

Support message property filters + new operators #80

Merged
merged 5 commits into from
May 24, 2017

Conversation

prolic
Copy link
Member

@prolic prolic commented May 22, 2017

@prolic prolic changed the title [WIP] Support message property filters + new operators Support message property filters + new operators May 23, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 98.0% when pulling feab70d on message_property_filters into a352ec5 on master.

@codeliner
Copy link
Member

@oqq and @basz do you have time to take a second look?

LGTM but maybe you see some flaws that I don't see.

Copy link
Member

@basz basz left a comment

Choose a reason for hiding this comment

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

Apart from a few suggestions, lgtm

}

$where[] = "metadata->\"$.$field\" $operator $parameter";
$values[$parameter] = $value;
if (FieldType::METADATA()->is($fieldType)) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not;

Operator->is(...) for eadability?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's field type, not operator :)

$parameter = ':metadata_'.$key;
$parameters = [];

if (is_array($value)) {
Copy link
Member

Choose a reason for hiding this comment

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

Make array if not array, then loop through?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Copy link
Member Author

Choose a reason for hiding this comment

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

ah not ok, it's different behaviour, see the code below


$operatorStringEnd = '';

if (Operator::REGEX()->is($operator)) {
Copy link
Member

Choose a reason for hiding this comment

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

Operator->is(...)

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Copy link
Member Author

Choose a reason for hiding this comment

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

problem is auto complete missing then

Copy link
Member

Choose a reason for hiding this comment

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

/** @var FQCN $operator */? you against that?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 98.0% when pulling 6d926a4 on message_property_filters into a352ec5 on master.

@codeliner codeliner merged commit 12a3b2b into master May 24, 2017
@codeliner codeliner deleted the message_property_filters branch May 24, 2017 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants