/** * Adds a column ordering rule to the ORDER BY list */ public function order($column = "", $order = "") { $column = Sanitize::toSqlName($column); $order = Sanitize::toUpperCase($order); if (!empty($column) && !empty($order)) { $this->_order[] = $column . " " . $order; } return $this; }
/** * Resolve the current HTTP request method */ public static function getMethod($default = "GET") { $method = Utils::value(@$_SERVER["REQUEST_METHOD"], @$_SERVER["HTTP_X_HTTP_METHOD"], $default); return Sanitize::toUpperCase($method); }
/** * Used to trigger registered controller actions */ public function trigger($method, $action, $params = null) { $method = $method === "*" ? "ANY" : Sanitize::toUpperCase($method); $action = $action === "*" ? "any" : Sanitize::toParam($action); if (!empty($this->_callbacks[$method][$action])) { $closure = $this->_callbacks[$method][$action]; $closure = $closure->bindTo($this); if (is_array($params)) { return call_user_func_array($closure, $params); } return call_user_func($closure, $params); } return false; }