src/Db/MySQL/Query/Utilities/Condition.php
private function parseExpression(string $variable = '', array $expression = [], string $logicalOp = ' AND '): string
    {
        $ret = [];
        foreach ($expression as $operator => $value) {
            if (\in_array($operator, $this->operatorsFrom)) {
                $operator = \str_replace($this->operatorsFrom, $this->operatorsTo, $operator);
                $ret[] = \sprintf('%s%s%s', $variable, $operator, $this->escapeClass->escape($value));
            } elseif ($operator == '$in' && \is_array($value)) {
                $value = \array_map([$this->escapeClass, 'escape'], $value);
                $ret[] = \sprintf('%s IN (%s)', $variable, \implode(',', $value));
            } elseif ($operator == '$in' && \is_string($value)) {
                $value = $this->escapeClass->escape($value);
                $ret[] = \sprintf('%s IN (%s)', $variable, $value);
            } elseif ($operator == '$nin' && \is_array($value)) {
                $value = \array_map([$this->escapeClass, 'escape'], $value);
                $ret[] = \sprintf('%s NOT IN (%s)', $variable, \implode(',', $value));
            } elseif ($operator == '$nin' && \is_string($value)) {
                $value = $this->escapeClass->escape($value);
                $ret[] = \sprintf('%s NOT IN (%s)', $variable, $value);
            } elseif ($operator == '$like') {
                $ret[] = \sprintf('%s LIKE %s', $variable, $this->escapeClass->escape($value));
            }
        }
        return \implode($logicalOp, $ret);
    }
private function parseExpression(string $variable = '', array $expression = [], string $logicalOp = ' AND '): string
    {
        $ret = [];
        foreach ($expression as $operator => $value) {
            if (\in_array($operator, $this->operatorsFrom)) {
                $operator = \str_replace($this->operatorsFrom, $this->operatorsTo, $operator);
                $ret[] = \sprintf('%s%s%s', $variable, $operator, $this->escapeClass->escape($value));
            } elseif ($operator == '$in' && \is_array($value)) {
                $value = \array_map([$this->escapeClass, 'escape'], $value);
                $ret[] = \sprintf('%s IN (%s)', $variable, \implode(',', $value));
            } elseif ($operator == '$in' && \is_string($value)) {
                $value = $this->escapeClass->escape($value);
                $ret[] = \sprintf('%s IN (%s)', $variable, $value);
            } elseif ($operator == '$nin' && \is_array($value)) {
                $value = \array_map([$this->escapeClass, 'escape'], $value);
                $ret[] = \sprintf('%s NOT IN (%s)', $variable, \implode(',', $value));
            } elseif ($operator == '$nin' && \is_string($value)) {
                $value = $this->escapeClass->escape($value);
                $ret[] = \sprintf('%s NOT IN (%s)', $variable, $value);
            } elseif ($operator == '$like') {
                $ret[] = \sprintf('%s LIKE %s', $variable, $this->escapeClass->escape($value));
            }
        }
        return \implode($logicalOp, $ret);
    }
private function parseExpression ( string $ variable = '' , array $ expression = [ ] , string $ logicalOp = ' AND ' ) : string { $ ret = [ ] ; foreach ( $ expression as $ operator => $ value ) { if ( \ in_array ( $ operator , $ this -> operatorsFrom ) ) { $ operator = \ str_replace ( $ this -> operatorsFrom , $ this -> operatorsTo , $ operator ) ; $ ret [ ] = \ sprintf ( '%s%s%s' , $ variable , $ operator , $ this -> escapeClass -> escape ( $ value ) ) ; } elseif ( $ operator == '$in' && \ is_array ( $ value ) ) { $ value = \ array_map ( [ $ this -> escapeClass , 'escape' ] , $ value ) ; $ ret [ ] = \ sprintf ( '%s IN (%s)' , $ variable , \ implode ( ',' , $ value ) ) ; } elseif ( $ operator == '$in' && \ is_string ( $ value ) ) { $ value = $ this -> escapeClass -> escape ( $ value ) ; $ ret [ ] = \ sprintf ( '%s IN (%s)' , $ variable , $ value ) ; } elseif ( $ operator == '$nin' && \ is_array ( $ value ) ) { $ value = \ array_map ( [ $ this -> escapeClass , 'escape' ] , $ value ) ; $ ret [ ] = \ sprintf ( '%s NOT IN (%s)' , $ variable , \ implode ( ',' , $ value ) ) ; } elseif ( $ operator == '$nin' && \ is_string ( $ value ) ) { $ value = $ this -> escapeClass -> escape ( $ value ) ; $ ret [ ] = \ sprintf ( '%s NOT IN (%s)' , $ variable , $ value ) ; } elseif ( $ operator == '$like' ) { $ ret [ ] = \ sprintf ( '%s LIKE %s' , $ variable , $ this -> escapeClass -> escape ( $ value ) ) ; } } return \ implode ( $ logicalOp , $ ret ) ; }
Parses logical expression

@param string $variable
@param array  $expression
@param string $logicalOp
@return string
Parses logical expression