public function setDriver(\BearFramework\App\IDataDriver $driver): self
    {
        if ($this->driver !== null) {
            throw new \Exception('A data driver is already set!');
        }
        $this->driver = $driver;
        if ($this->filenameProtocol !== null) {
            \BearFramework\Internal\DataItemStreamWrapper::$environment[$this->filenameProtocol] = [$this, $driver];
        }
        return $this;
    }
public function setDriver(\BearFramework\App\IDataDriver $driver): self
    {
        if ($this->driver !== null) {
            throw new \Exception('A data driver is already set!');
        }
        $this->driver = $driver;
        if ($this->filenameProtocol !== null) {
            \BearFramework\Internal\DataItemStreamWrapper::$environment[$this->filenameProtocol] = [$this, $driver];
        }
        return $this;
    }
public function setDriver ( \ BearFramework \ App \ IDataDriver $ driver ) : self { if ( $ this -> driver !== null ) { throw new \ Exception ( 'A data driver is already set!' ) ; } $ this -> driver = $ driver ; if ( $ this -> filenameProtocol !== null ) { \ BearFramework \ Internal \ DataItemStreamWrapper :: $ environment [ $ this -> filenameProtocol ] = [ $ this , $ driver ] ; } return $ this ; }
Sets a new data driver.

@param \BearFramework\App\IDataDriver $driver The data driver to use for data storage.
@return self Returns a reference to itself.
@throws \Exception
Sets a new data driver .