public function __call(string
$name, array
$params) { $builder =
$this->
builder();
$result = null;
if (method_exists($this->db,
$name)) { $result =
$this->db->
{$name}(...
$params);
} elseif (method_exists($builder,
$name)) { $this->
checkBuilderMethod($name);
$result =
$builder->
{$name}(...
$params);
} else { throw new BadMethodCallException('Call to undefined method ' .
static::
class D '::' .
$name);
} if ($result instanceof BaseBuilder
) { return $this;
} return $result;
}