public function connection($connection = null)
    {
        deprecationWarning(
            'Query::connection() is deprecated. ' .
            'Use Query::setConnection()/getConnection() instead.'
        );
        if ($connection !== null) {
            return $this->setConnection($connection);
        }

        return $this->getConnection();
    }
public function connection($connection = null)
    {
        deprecationWarning(
            'Query::connection() is deprecated. ' .
            'Use Query::setConnection()/getConnection() instead.'
        );
        if ($connection !== null) {
            return $this->setConnection($connection);
        }

        return $this->getConnection();
    }
public function connection ( $ connection = null ) { deprecationWarning ( 'Query::connection() is deprecated. ' . 'Use Query::setConnection()/getConnection() instead.' ) ; if ( $ connection !== null ) { return $ this -> setConnection ( $ connection ) ; } return $ this -> getConnection ( ) ; }
Sets the connection instance to be used for executing and transforming this query
When called with a null argument, it will return the current connection instance.

@deprecated 3.4.0 Use setConnection()/getConnection() instead.
@param \Cake\Database\Connection|null $connection Connection instance
@return $this|\Cake\Database\Connection
Sets the connection instance to be used for executing and transforming this query When called with a null argument it will return the current connection instance .