Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
16 | 19 | public function create(TranslationInterface $translation): bool |
|
17 | { |
||
18 | 19 | $created = $this->query()->create([ |
|
19 | 19 | 'group' => $translation->getGroup(), |
|
20 | 19 | 'key' => $translation->getKey(), |
|
21 | 19 | 'text' => $translation->getTranslations(), |
|
22 | 19 | 'sync_at' => $translation->getSyncAt(), |
|
23 | ]); |
||
24 | |||
25 | 19 | $translation->setId($created->id); |
|
26 | 19 | $translation->setSyncAt($created->sync_at); |
|
27 | 19 | $translation->setCreatedAt($created->created_at); |
|
28 | 19 | $translation->setUpdatedAt($created->updated_at); |
|
29 | |||
30 | 19 | event(new TranslationCreated($translation, $created->wasRecentlyCreated)); |
|
31 | |||
32 | 19 | return $created->wasRecentlyCreated; |
|
33 | } |
||
34 | } |
||
35 |