Commit ed3514b89d786b73dfad9d7dd4e4d6c92e9fa23b
1 parent
37a18be1
registration
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
app/library/App/Controllers/UserController.php
| @@ -90,4 +90,21 @@ class UserController extends CrudResourceController | @@ -90,4 +90,21 @@ class UserController extends CrudResourceController | ||
| 90 | { | 90 | { |
| 91 | return 'id'; | 91 | return 'id'; |
| 92 | } | 92 | } |
| 93 | + | ||
| 94 | + protected function getFindData($id) | ||
| 95 | + { | ||
| 96 | + $phqlBuilder = $this->phqlQueryParser->fromQuery($this->query, $this->getResource()); | ||
| 97 | + | ||
| 98 | + $phqlBuilder | ||
| 99 | + ->andWhere('[' . $this->getResource()->getModel() . '].' . $this->getModelPrimaryKey() . ' = :id:', | ||
| 100 | + ['id' => $id]) | ||
| 101 | + ->limit(1); | ||
| 102 | + | ||
| 103 | + $this->modifyReadQuery($phqlBuilder); | ||
| 104 | + $this->modifyFindQuery($phqlBuilder, $id); | ||
| 105 | + | ||
| 106 | + $results = $phqlBuilder->getQuery()->execute(); | ||
| 107 | + | ||
| 108 | + return count($results) >= 1 ? $results->getFirst() : null; | ||
| 109 | + } | ||
| 93 | } | 110 | } |