Exemplo n.º 1
0
 /**
  * Trigger an exception to test the PDO exception handler.
  */
 public function triggerPDOException()
 {
     define('SIMPLETEST_COLLECT_ERRORS', FALSE);
     $this->database->query('SELECT * FROM bananas_are_awesome');
 }
 /**
  * Displays a list of nodes.
  */
 public function index()
 {
     // query the database
     $result = $this->database->query('SELECT * from {node} WHERE nid = 1')->fetchAll();
     return ['#type' => 'markup', '#markup' => json_encode($result)];
 }