Check a single condition for a single element.
array $element: The element which should be checked.
array $condition: An associative array containing:
bool Returns whether the condition matches with the element.
public function match($element, $condition) {
$value = $element[$condition['field']];
switch ($condition['operator']) {
case '=':
return $value == $condition['value'];
case 'IN':
return in_array($value, $condition['value']);
}
return FALSE;
}