Created
October 12, 2014 13:07
-
-
Save joshtronic/ff25c069a440c224abad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class v1_user extends \Pickles\Resource | |
{ | |
/** | |
* Has to be broken out by request method as to not cause fall out. The other | |
* option could be to grab all of the method names, loop through and look for | |
* the largest revision number (if the revision is not specified and _METHOD() | |
* doesn't exist | |
**/ | |
private $get_latest = 20141011; | |
public function GET_20140101() | |
{ | |
// ... | |
} | |
public function GET_20140101() | |
{ | |
// ... | |
} | |
public function GET_20141011() | |
{ | |
// latest... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class v1_user extends \Pickles\Resource | |
{ | |
public function GET() | |
{ | |
switch ($revision) | |
{ | |
case 20140101: | |
// ... | |
break; | |
case 20140601: | |
// ... | |
break; | |
case 20141011: | |
default: | |
// latest... | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment