Ejemplo n.º 1
0
 /**
  * Get the null or zero representation of a timestamp for the database driver.
  *
  * 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 nullDate method directly.
  *
  * Usage:
  * $query->where('modified_date <> '.$query->nullDate());
  *
  * @param   boolean  $quoted  Optionally wraps the null date in database quotes (true by default).
  *
  * @return  string  Null or zero representation of a timestamp.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function nullDate($quoted = true)
 {
     if (!$this->db instanceof DatabaseDriver) {
         throw new \RuntimeException('JLIB_DATABASE_ERROR_INVALID_DB_OBJECT');
     }
     $result = $this->db->getNullDate($quoted);
     if ($quoted) {
         return $this->db->quote($result);
     }
     return $result;
 }