Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function entity(array $data = []) |
||
18 | { |
||
19 | // @todo ここでnewするのなんとかしたい・・・ |
||
20 | $userFactory = new UserFactory(); |
||
21 | $message = new Message(); |
||
22 | |||
23 | $message->account = $userFactory->entity($data['account']); |
||
24 | unset($data['account']); |
||
25 | |||
26 | foreach ($data as $key => $value) { |
||
27 | $property = Inflector::variable($key); |
||
28 | $message->$property = $value; |
||
29 | } |
||
30 | |||
31 | return $message; |
||
32 | } |
||
34 |