Esempio n. 1
0
 /**
  * Executes an SQL SELECT statement
  *
  * @param   rdbms.DBConnection conn
  * @param   rdbms.Peer peer
  * @param   rdbms.join.Joinprocessor jp optional
  * @param   bool buffered default TRUE
  * @return  rdbms.ResultSet
  */
 public function executeSelect(DBConnection $conn, Peer $peer, $jp = null, $buffered = true)
 {
     $statement = preg_replace('/object\\(([^\\)]+)\\)/i', '$1.' . implode(', $1.', array_keys($peer->types)), $this->statement);
     if ($buffered) {
         return $conn->query($statement, ...$this->arguments);
     } else {
         return $conn->open($statement, ...$this->arguments);
     }
 }
 /**
  * Method setDatabase()
  * 
  * Define the database for store the NASP data
  * 
  * @param string $hostname The hostname or IP of the server's database
  * @param string $database The database's name
  * @param string $user The database'user
  * @param string $pass The database's password for the user specify
  * @access public
  */
 public function setDatabase($hostname = null, $database = null, $user = null, $pass = null)
 {
     //Makes the connection
     self::$conn = DBConnection::open($hostname, $database, $user, $pass);
 }