public function getCondition($name, $models = null) {
        $this->_afterConditionParams = $this->_afterConditionJoins = [];
        if (is_null($models)) {
            return $this->_calcJoin();
        } elseif (!is_array($models)) {
            $models = [$models]; // if it's not a list already;
        }
        return $this->_calcModels($models);
    }
public function getCondition($name, $models = null) {
        $this->_afterConditionParams = $this->_afterConditionJoins = [];
        if (is_null($models)) {
            return $this->_calcJoin();
        } elseif (!is_array($models)) {
            $models = [$models]; // if it's not a list already;
        }
        return $this->_calcModels($models);
    }
public function getCondition ( $ name , $ models = null ) { $ this -> _afterConditionParams = $ this -> _afterConditionJoins = [ ] ; if ( is_null ( $ models ) ) { return $ this -> _calcJoin ( ) ; } elseif ( ! is_array ( $ models ) ) { $ models = [ $ models ] ; // if it's not a list already; } return $ this -> _calcModels ( $ models ) ; }
If no models are  sent will return for initial join, if not it will return a new query for selected models;
@param string $name - name is used to determine if it's a sub-condition or not and generate table name
@param null|DbModel[]|DbModel $models
@return string
If no models are sent will return for initial join if not it will return a new query for selected models ;