Closed bakura10 closed 10 years ago
Yep. Totally possible :)
Nice :)
Before we tag a new release, we need to get the documentation updated for all the new operators. I'll do that when I get a minute.
Speaking about that, I've thought of a missing operator that would be useful: Exists operator. It would be used to make sure that a given key exist in the context:
$rb = new RuleBuilder;
$rule = $rb->create(
$rb->logicalAnd(
$rb['foo']->exists(),
$rb['bar']->exists()
)
);
$context = new Context(array(
'foo' => 5,
'bar' => null
));
$rule->execute($context); // return true
$context = new Context(array(
'foo' => 5
));
$rule->execute($context); // return false
However I'm not sure how this would make to current architecture as exists() operator would not take a right operand.
Done! Sorry that took so long :(
Hi,
Would it be possible to tag a new version? Latest version does not include the trait :).
Thanks!