original_string: protected function _addConditions(array $conditions, array $types)
      {
          $operators = ['and', 'or', 'xor'];
  
          $typeMap = $this->getTypeMap()->setTypes($types);
  
          foreach ($conditions as $k => $c) {
              $numericKey = is_numeric($k);
  
              if ($this->isCallable($c)) {
                  $expr = new static([], $typeMap);
                  $c = $c($expr, $this);
              }
  
              if ($numericKey && empty($c)) {
                  continue;
              }
  
              $isArray = is_array($c);
              $isOperator = in_array(strtolower($k), $operators);
              $isNot = strtolower($k) === 'not';
  
              if (($isOperator || $isNot) && ($isArray || $c instanceof Countable) && count($c) === 0) {
                  continue;
              }
  
              if ($numericKey && $c instanceof ExpressionInterface) {
                  $this->_conditions[] = $c;
                  continue;
              }
  
              if ($numericKey && is_string($c)) {
                  $this->_conditions[] = $c;
                  continue;
              }
  
              if ($numericKey && $isArray || $isOperator) {
                  $this->_conditions[] = new static($c, $typeMap, $numericKey ? 'AND' : $k);
                  continue;
              }
  
              if ($isNot) {
                  $this->_conditions[] = new UnaryExpression('NOT', new static($c, $typeMap));
                  continue;
              }
  
              if (!$numericKey) {
                  $this->_conditions[] = $this->_parseCondition($k, $c);
              }
          }
      }
code: protected function _addConditions(array $conditions, array $types)
      {
          $operators = ['and', 'or', 'xor'];
  
          $typeMap = $this->getTypeMap()->setTypes($types);
  
          foreach ($conditions as $k => $c) {
              $numericKey = is_numeric($k);
  
              if ($this->isCallable($c)) {
                  $expr = new static([], $typeMap);
                  $c = $c($expr, $this);
              }
  
              if ($numericKey && empty($c)) {
                  continue;
              }
  
              $isArray = is_array($c);
              $isOperator = in_array(strtolower($k), $operators);
              $isNot = strtolower($k) === 'not';
  
              if (($isOperator || $isNot) && ($isArray || $c instanceof Countable) && count($c) === 0) {
                  continue;
              }
  
              if ($numericKey && $c instanceof ExpressionInterface) {
                  $this->_conditions[] = $c;
                  continue;
              }
  
              if ($numericKey && is_string($c)) {
                  $this->_conditions[] = $c;
                  continue;
              }
  
              if ($numericKey && $isArray || $isOperator) {
                  $this->_conditions[] = new static($c, $typeMap, $numericKey ? 'AND' : $k);
                  continue;
              }
  
              if ($isNot) {
                  $this->_conditions[] = new UnaryExpression('NOT', new static($c, $typeMap));
                  continue;
              }
  
              if (!$numericKey) {
                  $this->_conditions[] = $this->_parseCondition($k, $c);
              }
          }
      }
code_tokens: protected function _addConditions ( array $ conditions , array $ types ) { $ operators = [ 'and' , 'or' , 'xor' ] ; $ typeMap = $ this -> getTypeMap ( ) -> setTypes ( $ types ) ; foreach ( $ conditions as $ k => $ c ) { $ numericKey = is_numeric ( $ k ) ; if ( $ this -> isCallable ( $ c ) ) { $ expr = new static ( [ ] , $ typeMap ) ; $ c = $ c ( $ expr , $ this ) ; } if ( $ numericKey && empty ( $ c ) ) { continue ; } $ isArray = is_array ( $ c ) ; $ isOperator = in_array ( strtolower ( $ k ) , $ operators ) ; $ isNot = strtolower ( $ k ) === 'not' ; if ( ( $ isOperator || $ isNot ) && ( $ isArray || $ c instanceof Countable ) && count ( $ c ) === 0 ) { continue ; } if ( $ numericKey && $ c instanceof ExpressionInterface ) { $ this -> _conditions [ ] = $ c ; continue ; } if ( $ numericKey && is_string ( $ c ) ) { $ this -> _conditions [ ] = $ c ; continue ; } if ( $ numericKey && $ isArray || $ isOperator ) { $ this -> _conditions [ ] = new static ( $ c , $ typeMap , $ numericKey ? 'AND' : $ k ) ; continue ; } if ( $ isNot ) { $ this -> _conditions [ ] = new UnaryExpression ( 'NOT' , new static ( $ c , $ typeMap ) ) ; continue ; } if ( ! $ numericKey ) { $ this -> _conditions [ ] = $ this -> _parseCondition ( $ k , $ c ) ; } } }
docstring: Auxiliary function used for decomposing a nested array of conditions and build
  a tree structure inside this object to represent the full SQL expression.
  String conditions are stored directly in the conditions, while any other
  representation is wrapped around an adequate instance or of this class.
  
  @param array $conditions list of conditions to be stored in this object
  @param array $types list of types associated on fields referenced in $conditions
  @return void
docstring_tokens: Auxiliary function used for decomposing a nested array of conditions and build a tree structure inside this object to represent the full SQL expression . String conditions are stored directly in the conditions while any other representation is wrapped around an adequate instance or of this class .