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