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