| @@ 116-123 (lines=8) @@ | ||
| 113 | * @param array $attributes |
|
| 114 | * @return void |
|
| 115 | */ |
|
| 116 | BelongsToMany::macro('attachIgnore', function ($id, array $attributes = [], $touch = true) { |
|
| 117 | $this->newPivotStatement()->insertIgnore($this->formatAttachRecords( |
|
| 118 | $this->parseIds($id), |
|
| 119 | $attributes |
|
| 120 | )); |
|
| 121 | if ($touch) { |
|
| 122 | $this->touchIfTouching(); |
|
| 123 | } |
|
| 124 | }); |
|
| 125 | ||
| 126 | /* |
|
| @@ 133-141 (lines=9) @@ | ||
| 130 | * @param array $attributes |
|
| 131 | * @return void |
|
| 132 | */ |
|
| 133 | BelongsToMany::macro('attachOnDuplicateKey', function ($id, array $attributes = [], $touch = true) { |
|
| 134 | $this->newPivotStatement()->insertOnDuplicateKey($this->formatAttachRecords( |
|
| 135 | $this->parseIds($id), |
|
| 136 | $attributes |
|
| 137 | )); |
|
| 138 | ||
| 139 | if ($touch) { |
|
| 140 | $this->touchIfTouching(); |
|
| 141 | } |
|
| 142 | }); |
|
| 143 | } |
|
| 144 | } |
|