Conditions | 4 |
Paths | 8 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | private function transform($object) |
||
21 | { |
||
22 | $problem = new Problem(); |
||
23 | $problem->fill(get_object_vars($object)); |
||
24 | $problem->id = $object->problem_id; |
||
25 | $problem->title = $object->title; |
||
26 | $problem->description = $object->description; |
||
27 | $problem->created_at = $object->in_date; |
||
28 | |||
29 | if ($problem->submit === null) { |
||
30 | $problem->submit = 0; |
||
31 | } |
||
32 | if ($problem->accepted === null) { |
||
33 | $problem->accepted = 0; |
||
34 | } |
||
35 | if ($object->defunct === 'Y') { |
||
36 | $problem->status = Problem::ST_HIDE; |
||
37 | } |
||
38 | |||
39 | $problem->save(); |
||
40 | } |
||
42 |