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

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

        return $this->getConnection();
    }
public function connection ( ConnectionInterface $ connection = null ) { deprecationWarning ( get_called_class ( ) . '::connection() is deprecated. ' . 'Use setConnection()/getConnection() instead.' ) ; if ( $ connection !== null ) { $ this -> setConnection ( $ connection ) ; } return $ this -> getConnection ( ) ; }
Returns the connection instance or sets a new one

@deprecated 3.4.0 Use setConnection()/getConnection() instead.
@param \Cake\Datasource\ConnectionInterface|null $connection The new connection instance
@return \Cake\Datasource\ConnectionInterface
Returns the connection instance or sets a new one