Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | trait JsonImporter |
||
9 | { |
||
10 | protected $jsonImportableAttributes; |
||
11 | protected $jsonImportableRelations; |
||
12 | |||
13 | 14 | public static function importFromJson($objects) |
|
14 | { |
||
15 | 14 | ImporterHelper::importFromJson(new static, $objects); |
|
|
|||
16 | 13 | } |
|
17 | |||
18 | 14 | public function getJsonImportableAttributes(): array |
|
19 | { |
||
20 | 14 | return $this->jsonImportableAttributes |
|
21 | 13 | ?? $this->jsonExportableAttributes |
|
22 | 14 | ?? $this->getFillable(); |
|
23 | } |
||
24 | |||
25 | 13 | public function getJsonImportableRelations(): array |
|
30 | } |
||
31 | |||
32 | 1 | public function isImporting(): bool |
|
35 | } |
||
36 | } |
||
37 |