Esempio n. 1
0
 protected function debug()
 {
     header('Content-type: text/plain');
     // This is hard-coded as mysql, because the only supported DB is mysql.
     // Change this if that ever changes.
     Current::db('mysql')->output_query = true;
 }
Esempio n. 2
0
 public function query($query, $data = array())
 {
     $db = Current::db($this->driver);
     if (!is_array($data)) {
         $data = func_get_args();
         $data = array_slice($data, 1);
     }
     if ($this->state_dirty) {
         list($args, $order, $offset, $amount) = $this->getState();
         $data['args'] = $args;
         $data['order'] = $order;
         $data['offset'] = $offset;
         $data['amount'] = $amount;
     }
     $query = $this->builder->format($query, $data);
     $result = $db->execute($query);
     Current::$plugins->hook('postDBQuery', $this, $query, $db);
     return new DomainCollection($result, $this);
 }