public function __call($method, $arguments) { if ($this->type() === 'select') { return $this->_call($method, $arguments); } throw new \BadMethodCallException(sprintf('Cannot call method "%s" on a "%s" query', $method, $this->type())); }