Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function applyConditions(ISelectBuilder $selectBuilder)
 {
     $selectBuilder->begin($this->mode);
     foreach ($this->conditions as $fieldCondition) {
         $fieldCondition->apply($selectBuilder);
     }
     foreach ($this->getGroups() as $nextGroup) {
         $nextGroup->applyConditions($selectBuilder);
     }
     $selectBuilder->end();
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Прнименяет условие на выборку "BETWEEN"
  * @param ISelectBuilder $selectBuilder
  * @return $this
  */
 protected function applyBetweenCondition(ISelectBuilder $selectBuilder)
 {
     list($minValue, $maxValue) = $this->expression;
     $minPlaceholder = $this->placeholder . ISelector::PLACEHOLDER_SEPARATOR . 'min';
     $maxPlaceholder = $this->placeholder . ISelector::PLACEHOLDER_SEPARATOR . 'max';
     $selectBuilder->begin()->expr($this->fieldColumn, IFieldCondition::OPERATOR_EQMORE, $minPlaceholder)->expr($this->fieldColumn, IFieldCondition::OPERATOR_EQLESS, $maxPlaceholder)->bindValue($minPlaceholder, $minValue, $this->field->getDataType())->bindValue($maxPlaceholder, $maxValue, $this->field->getDataType())->end();
     return $this;
 }