| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Models\Concerns; |
| 4 |
|
| 5 |
use FluentCart\App\Models\BatchQuery\Batch; |
| 6 |
use FluentCart\Framework\Database\Orm\Builder; |
| 7 |
|
| 8 |
trait CanUpdateBatch |
| 9 |
{ |
| 10 |
public static function scopeBatchUpdate(Builder $query, $values, $index = null) |
| 11 |
{ |
| 12 |
$model = new static(); |
| 13 |
$index = $index ?? $model->getKeyName(); |
| 14 |
return (new Batch())->update($model, $values,$index); |
| 15 |
} |
| 16 |
} |