I have extended PHP\'s mysqli
class, which works fine. But how can I make it return a custom result object (or a boolean for insert/update/delete etc) when quer
Probably the simplest thing to do would be treat your MySQLiResult
class as a decorator for mysqli_result
. For example
class MySQLiResult
{
private $result;
public function __construct(\mysqli_result $result)
{
$this->result = $result;
}
}
You could then proxy method calls to the internal result and decorate (add functionality) where required.