/** * Set Contains comparison. * * @param Value $value Value object to compare against * * @return boolean */ public function setContains(Value $value) { if (is_array($value->getValue())) { foreach ($this->value as $val) { if ($val instanceof Set && $val == $value->getSet()) { return true; } } return false; } return in_array($value->getValue(), $this->value); }
/** * @return array */ public function getParameters() { $params = []; if (is_array($v = $this->value->getValue()) && $this->value->getOperator() === 'BETWEEN') { foreach ($v as $index => $value) { $params[$this->value->getParameterKey($index)] = $value; } } elseif ($this->value->getOperator() === 'IS') { // conitnue... } elseif ($this->value->getOperator() === 'INSTANCE OF') { // conitnue... } else { $params[$this->value->getParameterKey()] = $this->value->getValue(); } return $params; }
/** * {@inheritDoc} */ public function walkValue(Value $value) { return $value->getValue(); }
public function exponentiate(Value $value) { if (!is_numeric($this->value) || !is_numeric($value->getValue())) { throw new \RuntimeException("Arithmetic: values must be numeric"); } return pow($this->value, $value->getValue()); }
/** * Less Than comparison. * * @param Value $value * @return boolean */ public function lessThan(Value $value) { return $this->value < $value->getValue(); }