Ejemplo n.º 1
0
 /**
  * Применяет условия выборки по типам
  * @param ISelectBuilder $selectBuilder
  */
 protected function applyTypeConditions(ISelectBuilder $selectBuilder)
 {
     $types = $this->getSelectionTypes();
     if (count($types)) {
         $typeField = $this->collection->getObjectTypeField();
         $typeFieldColumn = $this->collection->getSourceAlias() . ISelector::FIELD_SEPARATOR . $typeField->getColumnName();
         $typeConditionPlaceholder = ':type' . self::PLACEHOLDER_SEPARATOR . $this->collection->getName();
         $typeConditions = [];
         foreach ($types as $typeName) {
             $typeConditions[] = $this->collection->getName() . IObjectType::PATH_SEPARATOR . $typeName;
         }
         $selectBuilder->expr($typeFieldColumn, 'IN', $typeConditionPlaceholder);
         $selectBuilder->bindArray($typeConditionPlaceholder, $typeConditions);
     }
 }
Ejemplo n.º 2
0
 /**
  * Прнименяет условие на выборку "IN"
  * @param ISelectBuilder $selectBuilder
  * @return $this
  */
 protected function applyInCondition(ISelectBuilder $selectBuilder)
 {
     $selectBuilder->expr($this->fieldColumn, $this->operator, $this->placeholder);
     $selectBuilder->bindArray($this->placeholder, $this->expression);
     return $this;
 }