Commit c9f9c60229fe547a83608a935a71920662a5f844

Authored by Alex Savenko
1 parent fae1e3db

test

Showing 1 changed file with 5 additions and 3 deletions   Show diff stats
app/library/App/Controllers/UserController.php
@@ -83,11 +83,13 @@ class UserController extends CrudResourceController @@ -83,11 +83,13 @@ class UserController extends CrudResourceController
83 } 83 }
84 84
85 85
86 - $test = $newItem->save(); 86 + $newItem->save();
87 87
88 - return var_dump($test); 88 + $last_id = $newItem->getWriteConnection()->lastInsertId();
  89 +
  90 + return var_dump($last_id);
89 //$primaryKey = $this->getModelPrimaryKey(); 91 //$primaryKey = $this->getModelPrimaryKey();
90 - $responseData = $this->getFindData($newItem->id); 92 + $responseData = $this->getFindData($last_id);
91 $response = $this->getCreateResponse($responseData, $data); 93 $response = $this->getCreateResponse($responseData, $data);
92 94
93 $this->afterHandleCreate($newItem, $data, $response); 95 $this->afterHandleCreate($newItem, $data, $response);