nextras / orm

Orm with clean object design, smart relationship loading and powerful collections.
https://nextras.org/orm
MIT License
310 stars 57 forks source link

ArrayCollectionHelper - invalid comparing #145

Closed f3l1x closed 8 years ago

f3l1x commented 8 years ago
const OPERATOR_EQUAL_OR_GREATER = '=>';
const OPERATOR_EQUAL_OR_SMALLER = '=<';

But parseCondition support only => OR =<

preg_match('#^([\w\\\]+(?:->\w+)*)(!|!=|<=|>=|=|>|<)?$#', $condition, $matches)

When I use => / =< it ends with (https://github.com/nextras/orm/blob/v1.1.4/src/Collection/Helpers/ConditionParserHelper.php#L28)

// ConditionParserHelper
throw new InvalidArgumentException('Unsupported condition format.');

When I use >= / <= it ends with (https://github.com/nextras/orm/blob/v1.1.4/src/Collection/Helpers/ArrayCollectionHelper.php#L94)

// ArrayCollectionHelper
throw new InvalidArgumentException();
hrach commented 8 years ago

oh, that's stupid :(

f3l1x commented 8 years ago

Thanks. :+1: