Exemplo n.º 1
0
 /**
  * @param Dimension $dimension
  * @return string
  */
 private function generateExpression(Dimension $dimension)
 {
     $field = $dimension->getName();
     $value = $dimension->getValue();
     if ('scope' === $field) {
         $field = self::STORE_FIELD_NAME;
         $value = $this->scopeResolver->getScope($value)->getId();
     }
     return $this->conditionManager->generateCondition('search_index.' . $field, '=', $value);
 }
Exemplo n.º 2
0
 /**
  * @param Dimension $dimension
  * @param AdapterInterface $adapter
  * @return string
  */
 private function generateExpression(Dimension $dimension, AdapterInterface $adapter)
 {
     $identifier = $dimension->getName();
     $value = $dimension->getValue();
     if (self::DEFAULT_DIMENSION_NAME === $identifier) {
         $identifier = self::STORE_FIELD_NAME;
         $value = $this->scopeResolver->getScope($value)->getId();
     }
     return sprintf('%s = %s', $adapter->quoteIdentifier($identifier), $adapter->quote($value));
 }