Stubbing out the default resource functionality

This commit is contained in:
Josh Sherman 2014-10-20 07:07:20 -04:00
parent 1e8e9efd95
commit 15a4b807d5
2 changed files with 33 additions and 1 deletions

View file

@ -327,6 +327,37 @@ class Resource extends Object
} }
} }
// Create
public function POST()
{
// @todo Whatever gets POSTed (aside from OAuth stuff) should be inserted to the collection
}
// Read
public function GET()
{
if (current($this->uids))
{
// @todo Pulls the record with this UID
}
else
{
// @todo Do we pull all or return an empty set?
}
}
// Update
public function PUT()
{
// @todo If we have a UID, update the record with whatever is posted
}
// Delete
public function DELETE()
{
// @todo If we have a UID, delete it
}
public function respond() public function respond()
{ {
http_response_code($this->status); http_response_code($this->status);

View file

@ -69,7 +69,8 @@ class Router extends Object
} }
else else
{ {
$nouns[] = $component; $nouns[] = $component;
$uids[$component] = null;
} }
} }