Commit 931897148cd2837c43633511056adcfa3432dc7b
1 parent
c7a1a5b3
test
Showing
2 changed files
with
13 additions
and
17 deletions
Show diff stats
app/library/App/Controllers/UserController.php
... | ... | @@ -66,11 +66,6 @@ class UserController extends CrudResourceController |
66 | 66 | |
67 | 67 | $data = $this->transformPostData($data); |
68 | 68 | |
69 | - | |
70 | - //$item = $this->createModelInstance(); | |
71 | - | |
72 | - //$newItem = $this->createItem($item, $data); | |
73 | - | |
74 | 69 | $newItem = new User(); |
75 | 70 | $map = $newItem->columnMap(); |
76 | 71 | foreach ($data as $key => $value) { |
... | ... | @@ -86,8 +81,6 @@ class UserController extends CrudResourceController |
86 | 81 | |
87 | 82 | $last_id = $newItem->getWriteConnection()->lastInsertId(); |
88 | 83 | |
89 | - //$primaryKey = $this->getModelPrimaryKey(); | |
90 | - | |
91 | 84 | $responseData = $this->getFindData($last_id); |
92 | 85 | $response = $this->getCreateResponse($responseData, $data); |
93 | 86 | |
... | ... | @@ -99,9 +92,20 @@ class UserController extends CrudResourceController |
99 | 92 | |
100 | 93 | } |
101 | 94 | |
95 | +// protected function transformPostData($data) | |
96 | +// { | |
97 | +// $result = []; | |
98 | +// | |
99 | +// foreach ($data as $key => $value) { | |
100 | +// $result[$key] = $this->transformPostDataValue($key, $value, $data); | |
101 | +// } | |
102 | +// | |
103 | +// return $result; | |
104 | +// } | |
105 | + | |
102 | 106 | protected function transformPostDataValue($key, $value, $data) |
103 | 107 | { |
104 | - if ($key == 'password') { | |
108 | + if ($key == 'pass') { | |
105 | 109 | return $this->security->hash($value); |
106 | 110 | } |
107 | 111 | else { |
... | ... | @@ -109,12 +113,4 @@ class UserController extends CrudResourceController |
109 | 113 | } |
110 | 114 | } |
111 | 115 | |
112 | - /** | |
113 | - * fix phql for PG | |
114 | - */ | |
115 | - protected function getModelPrimaryKey() | |
116 | - { | |
117 | - return 'id'; | |
118 | - } | |
119 | - | |
120 | 116 | } | ... | ... |
app/library/App/Transformers/UserTransformer.php