protected function getColumnEqualWithParent($condition, $parentModel, $fullName) {
        if (is_array($condition[1]) && is_array($condition[2])) {
            $conditions = [];
            foreach ($condition[1] as $c1) {
                $conditions[] = $this->getColumnEqualWithParent([$condition[0], $c1, $condition[2]], $parentModel, $fullName);
            }
            return "(" . implode(") OR (", $conditions) . ")";
        }
        if (is_array($condition[1])) {
            $c = $condition[1];
            $condition[1] = $condition[2];
            $condition[2] = $c;
        }
        if (is_string($condition[2])) {
            return $this->_column($condition[1], true, $fullName) . ' ' . $condition[0] . ' ' . $this->_column($condition[2], false, $fullName);//@TODO: parse columns name;
        } else {
            foreach ($condition[2] as $k => $v) {
                $condition[2][$k] = $this->_column($v, false, $fullName);
            }
            return $this->_column($condition[1], true, $fullName) . ($condition[0] == '=' ? ' IN (' : ' NOT IN (') . implode(", ", $condition[2]) . ')';
        }
    }
protected function getColumnEqualWithParent($condition, $parentModel, $fullName) {
        if (is_array($condition[1]) && is_array($condition[2])) {
            $conditions = [];
            foreach ($condition[1] as $c1) {
                $conditions[] = $this->getColumnEqualWithParent([$condition[0], $c1, $condition[2]], $parentModel, $fullName);
            }
            return "(" . implode(") OR (", $conditions) . ")";
        }
        if (is_array($condition[1])) {
            $c = $condition[1];
            $condition[1] = $condition[2];
            $condition[2] = $c;
        }
        if (is_string($condition[2])) {
            return $this->_column($condition[1], true, $fullName) . ' ' . $condition[0] . ' ' . $this->_column($condition[2], false, $fullName);//@TODO: parse columns name;
        } else {
            foreach ($condition[2] as $k => $v) {
                $condition[2][$k] = $this->_column($v, false, $fullName);
            }
            return $this->_column($condition[1], true, $fullName) . ($condition[0] == '=' ? ' IN (' : ' NOT IN (') . implode(", ", $condition[2]) . ')';
        }
    }
protected function getColumnEqualWithParent ( $ condition , $ parentModel , $ fullName ) { if ( is_array ( $ condition [ 1 ] ) && is_array ( $ condition [ 2 ] ) ) { $ conditions = [ ] ; foreach ( $ condition [ 1 ] as $ c1 ) { $ conditions [ ] = $ this -> getColumnEqualWithParent ( [ $ condition [ 0 ] , $ c1 , $ condition [ 2 ] ] , $ parentModel , $ fullName ) ; } return "(" . implode ( ") OR (" , $ conditions ) . ")" ; } if ( is_array ( $ condition [ 1 ] ) ) { $ c = $ condition [ 1 ] ; $ condition [ 1 ] = $ condition [ 2 ] ; $ condition [ 2 ] = $ c ; } if ( is_string ( $ condition [ 2 ] ) ) { return $ this -> _column ( $ condition [ 1 ] , true , $ fullName ) . ' ' . $ condition [ 0 ] . ' ' . $ this -> _column ( $ condition [ 2 ] , false , $ fullName ) ; //@TODO: parse columns name; } else { foreach ( $ condition [ 2 ] as $ k => $ v ) { $ condition [ 2 ] [ $ k ] = $ this -> _column ( $ v , false , $ fullName ) ; } return $ this -> _column ( $ condition [ 1 ] , true , $ fullName ) . ( $ condition [ 0 ] == '=' ? ' IN (' : ' NOT IN (' ) . implode ( ", " , $ condition [ 2 ] ) . ')' ; } }
Creates string condition from known data
@param string[] $condition
@param string $parentModel
@param string $fullName
@return string
Creates string condition from known data