Ejemplo n.º 1
0
 /**
  * Method to escape a string for usage in an SQL statement.
  *
  * This method is provided for use where the query object is passed to a function for modification.
  * If you have direct access to the database object, it is recommended you use the escape method directly.
  *
  * Note that 'e' is an alias for this method as it is in JDatabaseDatabaseDriver.
  *
  * @param   string   $text   The string to be escaped.
  * @param   boolean  $extra  Optional parameter to provide extra escaping.
  *
  * @return  string  The escaped string.
  *
  * @since   1.0
  * @throws  \RuntimeException if the internal db property is not a valid object.
  */
 public function escape($text, $extra = false)
 {
     if (!$this->db instanceof DatabaseDriver) {
         throw new \RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT');
     }
     return $this->db->escape($text, $extra);
 }