public function __toString() { $this::init(); try { return $this::$executor->render($this::fullPath($this->path), $this->vars); } catch (\Exception $e) { Log::error($e); return 'HAML Render Error'; } return ''; }
public function query(Query $query) { $db = $this; $sql = $this->buildQuery($query); $link = $this->link(); Log::query($sql); if ($result = $link->query($sql)) { return new Result(compact('db', 'query', 'result')); } // Error handling $error = $link->error_list; foreach ($link->error_list as $error) { Log::error(implode(' ', $error)); } throw new Exception('Query Error'); }