public function walkNumComparisonConstraint(QOM\PropertyValueInterface $propertyOperand, QOM\LiteralInterface $literalOperand, $operator) { $alias = $this->getTableAlias($propertyOperand->getSelectorName() . '.' . $propertyOperand->getPropertyName()); $property = $propertyOperand->getPropertyName(); return $this->sqlXpathExtractNumValue($alias, $property) . " " . $operator . " " . $literalOperand->getLiteralValue(); }
public function walkNumComparisonConstraint(QOM\PropertyValueInterface $propertyOperand, QOM\LiteralInterface $literalOperand, $operator) { $alias = $this->getTableAlias($propertyOperand->getSelectorName() . '.' . $propertyOperand->getPropertyName()); $property = $propertyOperand->getPropertyName(); if ($this->platform instanceof MySqlPlatform && '=' === $operator) { return sprintf('0 != FIND_IN_SET("%s", REPLACE(EXTRACTVALUE(%s.props, \'//sv:property[@sv:name="%s"]/sv:value\'), " ", ","))', $literalOperand->getLiteralValue(), $alias, $property); } return sprintf('%s %s %s', $this->sqlXpathExtractNumValue($alias, $property), $operator, $literalOperand->getLiteralValue()); }
/** * PropertyValue ::= [selectorName'.'] propertyName // If only one selector exists * * @param QOM\PropertyValueInterface $value * @return string */ protected function convertPropertyValue(QOM\PropertyValueInterface $value) { return $this->generator->evalPropertyValue($value->getPropertyName(), $value->getSelectorName()); }