Total Complexity | 2 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class EloquentInputType extends InputType |
||
9 | { |
||
10 | /** |
||
11 | * The underlying model schema. |
||
12 | * |
||
13 | * @var \Bakery\Eloquent\ModelSchema |
||
14 | */ |
||
15 | protected $modelSchema; |
||
16 | |||
17 | /** |
||
18 | * @var \Illuminate\Database\Eloquent\Model |
||
19 | */ |
||
20 | protected $model; |
||
21 | |||
22 | /** |
||
23 | * Construct a new Eloquent type. |
||
24 | * |
||
25 | * @param \Bakery\Support\TypeRegistry $registry |
||
26 | * @param \Bakery\Eloquent\ModelSchema $modelSchema |
||
27 | */ |
||
28 | public function __construct(TypeRegistry $registry, ModelSchema $modelSchema) |
||
29 | { |
||
30 | parent::__construct($registry); |
||
31 | |||
32 | $this->modelSchema = $modelSchema; |
||
33 | $this->model = $modelSchema->getModel(); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Define the fields that should be serialized. |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function __sleep() |
||
49 | } |
||
50 | } |
||
51 |