Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
51 | public static function insertData($data) |
||
52 | { |
||
53 | $output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
||
54 | $value = self::where('st_no', $data['st_no'])->get(); |
||
55 | if (count($value) > 0) { |
||
56 | self::where('st_no', $data['st_no'])->update($data); |
||
57 | } else { |
||
58 | self::insert($data); |
||
59 | } |
||
60 | $output->writeln('Student name: ' . ($data['f_name']) . ' has been inserted to the database'); |
||
61 | } |
||
63 |