/** * Adds BETWEEN to the WHERE clause list */ public function between($column = "", $min = 0, $max = 0, $next = "") { $column = Sanitize::toSqlName($column); $min = trim(Sanitize::toNumber($min)); $max = trim(Sanitize::toNumber($max)); $next = Sanitize::toUpperCase($next); $keys = []; if (!empty($column)) { foreach ([$min, $max] as $value) { $key = ":val" . (count($this->_data) + 1); $this->_data[$key] = trim($value); $keys[] = $key; } $this->_clauses[] = Sanitize::toSingleSpaces("(" . $column . " BETWEEN " . implode(" AND ", $keys) . ") " . $next); } return $this; }
/** * Get the port number */ public static function getPort() { $value = Utils::value(@$_SERVER["SERVER_PORT"], 0); $value = Sanitize::toNumber($value); return $value; }
/** * Set the response status code */ public function setStatus($status) { $status = Sanitize::toNumber($status); $this->_status = $status >= 200 ? $status : 200; return $this; }