Ejemplo n.º 1
0
 /**
  * @param \Generated\Shared\Transfer\ClauseTransfer $clauseTransfer
  *
  * @throws \Spryker\Zed\Discount\Business\Exception\QueryStringException
  *
  * @return void
  */
 protected function validateComparatorOperators(ClauseTransfer $clauseTransfer)
 {
     if ($this->comparatorOperators->isExistingComparator($clauseTransfer) === false) {
         throw new QueryStringException(sprintf('Could not find value "%s" as comparator operator.', $clauseTransfer->getOperator()));
     }
     $this->comparatorOperators->isValidComparatorValue($clauseTransfer);
 }
Ejemplo n.º 2
0
 /**
  * @param string $token
  *
  * @return bool
  */
 protected function isComparator($token)
 {
     if (in_array($token, $this->getCompoundComparatorExpressions(), true)) {
         return true;
     }
     $clauseTransfer = new ClauseTransfer();
     $clauseTransfer->setOperator($token);
     return $this->comparatorOperators->isExistingComparator($clauseTransfer);
 }