CI_Driver::__call PHP Method

__call() public method

Handles access to the parent driver library's methods
public __call ( $method, $args = [] ) : mixed
return mixed
    public function __call($method, $args = array())
    {
        if (in_array($method, $this->_methods)) {
            return call_user_func_array(array($this->_parent, $method), $args);
        }
        throw new BadMethodCallException('No such method: ' . $method . '()');
    }

Usage Example

 /**
  * __call magic method
  *
  * Handles access to the parent driver library's methods
  *
  * @param	string	Library method name
  * @param	array	Method arguments (default: none)
  * @return	mixed
  */
 public function __call($method, $args = array())
 {
     // Make sure the parent library uses this driver
     $this->_parent->select_driver(get_class($this));
     return parent::__call($method, $args);
 }