| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | public function send(SenderManagerContract $sender) |
||
| 21 | { |
||
| 22 | $model = notifynder_config()->getNotificationModel(); |
||
| 23 | $table = (new $model())->getTable(); |
||
| 24 | |||
| 25 | $this->database->beginTransaction(); |
||
| 26 | $stackId = $this->database |
||
| 27 | ->table($table) |
||
| 28 | ->max('stack_id') + 1; |
||
| 29 | foreach ($this->notifications as $key => $notification) { |
||
| 30 | $this->notifications[$key] = $this->notifications[$key]->toArray(); |
||
| 31 | $this->notifications[$key]['stack_id'] = $stackId; |
||
| 32 | } |
||
| 33 | $insert = $this->database |
||
| 34 | ->table($table) |
||
| 35 | ->insert($this->notifications); |
||
| 36 | $this->database->commit(); |
||
| 37 | return $insert; |
||
| 38 | } |
||
| 39 | } |