Permalink
Browse files

Minor changes, added a Request method.

  • Loading branch information...
1 parent cf8f3c0 commit 3dfc26e5b3030fa8a6baeaafad78589f3baa2ce3 @mullanaphy committed Aug 3, 2011
Showing with 12 additions and 3 deletions.
  1. +12 −3 phy/classes/request.php
View
@@ -34,6 +34,15 @@ public function __clone() {
}
/**
+ * Allow shorter calls for parameters.
+ *
+ * @return mixed|NULL
+ */
+ static public function __callStatic($key,$parameters) {
+ return call_user_func_array(array('self','get'),$parameters);
+ }
+
+ /**
* Return the number of parameters defined.
*
* @return int Count
@@ -108,7 +117,7 @@ static public function methods() {
*
* @return array
*/
- static public function toArray() {
+ static public function getArray() {
if(self::$_method === NULL) self::init();
return self::$_parameters;
}
@@ -118,7 +127,7 @@ static public function toArray() {
*
* @return stdClass
*/
- static public function toArray() {
+ static public function getObject() {
if(self::$_method === NULL) self::init();
return (object)self::$_parameters;
}
@@ -128,7 +137,7 @@ static public function toArray() {
*
* @return string JSON
*/
- static public function toJSON() {
+ static public function getJSON() {
if(self::$_method === NULL) self::init();
return json_encode(self::$_parameters);
}

0 comments on commit 3dfc26e

Please sign in to comment.