| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function save(FrontendUser $user) |
||
| 35 | { |
||
| 36 | $property = $this->reflection->getProperty('data'); |
||
| 37 | $property->setAccessible(true); |
||
| 38 | $data = $property->getValue($user); |
||
| 39 | |||
| 40 | if (null === $user->getUid()) { |
||
| 41 | $this->pool->getConnectionForTable('fe_users')->insert('fe_users', $data); |
||
| 42 | $user->setProperty('uid', $this->pool->getConnectionForTable('fe_users')->lastInsertId()); |
||
| 43 | } else { |
||
| 44 | $this->pool->getConnectionForTable('fe_users')->update('fe_users', $data, [ |
||
| 45 | 'uid' => $user->getUid(), |
||
| 46 | ]); |
||
| 50 |