-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathReadModel.php
More file actions
32 lines (25 loc) · 727 Bytes
/
Copy pathReadModel.php
File metadata and controls
32 lines (25 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace App\ReadModels;
use App\Exceptions\WriteOperationIsNotAllowedForReadModel;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
abstract class ReadModel extends Model
{
public $incrementing = false;
protected function performInsert(Builder $query)
{
throw new WriteOperationIsNotAllowedForReadModel();
}
protected function performUpdate(Builder $query)
{
throw new WriteOperationIsNotAllowedForReadModel();
}
protected function performDeleteOnModel()
{
throw new WriteOperationIsNotAllowedForReadModel();
}
public function truncate()
{
throw new WriteOperationIsNotAllowedForReadModel();
}
}