Merge form/request data in the Controller
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 7 Aug 2011 07:15:15 +0000 (03:15 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 7 Aug 2011 07:15:15 +0000 (03:15 -0400)
data/controller.php

index 7d64c283fcd42346af0d5276e26e49db9f97e2ea..46706c10ee279d808b5dfa5edbaf0150eb121edd 100644 (file)
@@ -44,7 +44,7 @@ class Controller extends http\RestAction
   /*! Gets the data from the model. */
   public function DoGet(http\Request $request, http\Response $response)
   {
-    $this->model->SetFrom($request->data);
+    $this->model->SetFromarray_merge($request->data, $request->data['_GET']);
     try {
       $response->data = $this->model->Fetch();
     } catch (ModelException $e) {
@@ -59,7 +59,7 @@ class Controller extends http\RestAction
   /*! Updates an object in the store. */
   public function DoPost(http\Request $request, http\Response $response)
   {
-    $this->model->SetFrom($request->data);
+    $this->model->SetFrom(array_merge($request->data, $request->data['_POST']));
     try {
       $this->model->Update();
       $response->data = $this->model->Fetch();
@@ -75,7 +75,7 @@ class Controller extends http\RestAction
   /*! Deletes the object from the store. */
   public function DoDelete(http\Request $request, http\Response $response)
   {
-    $this->model->SetFrom($request->data);
+    $this->model->SetFrom(array_merge($request->data, $request->data['_POST']));
     try {
       $this->model->Delete();
     } catch (ModelException $e) {
@@ -90,7 +90,7 @@ class Controller extends http\RestAction
   /*! Updates an object in the store. */
   public function DoPut(http\Request $request, http\Response $response)
   {
-    $this->model->SetFrom($request->data);
+    $this->model->SetFrom(array_merge($request->data, $request->data['_POST']));
     try {
       $this->model->Insert();
       $response->data = $this->model->Fetch();