| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function send(SenderManagerContract $sender) |
||
| 41 | { |
||
| 42 | $model = notifynder_config()->getNotificationModel(); |
||
| 43 | $table = (new $model())->getTable(); |
||
| 44 | |||
| 45 | $this->database->beginTransaction(); |
||
| 46 | $stackId = $this->database |
||
| 47 | ->table($table) |
||
| 48 | ->max('stack_id') + 1; |
||
| 49 | foreach ($this->notifications as $key => $notification) { |
||
| 50 | $this->notifications[$key] = $this->notifications[$key]->toDbArray(); |
||
| 51 | $this->notifications[$key]['stack_id'] = $stackId; |
||
| 52 | } |
||
| 53 | $insert = $this->database |
||
| 54 | ->table($table) |
||
| 55 | ->insert($this->notifications); |
||
| 56 | $this->database->commit(); |
||
| 57 | |||
| 58 | return (bool) $insert; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |