@@ 326-334 (lines=9) @@ | ||
323 | /** |
|
324 | * Handle 'afterInsert' event of the owner. |
|
325 | */ |
|
326 | public function afterInsert() |
|
327 | { |
|
328 | $translations = []; |
|
329 | if ($this->checkOnInsert) |
|
330 | { |
|
331 | $translations = $this->indexByLanguage($this->owner->getRelatedRecords()['translations']); |
|
332 | } |
|
333 | $this->saveTranslations($translations); |
|
334 | } |
|
335 | ||
336 | /** |
|
337 | * Handle 'afterUpdate' event of the owner. |
|
@@ 339-348 (lines=10) @@ | ||
336 | /** |
|
337 | * Handle 'afterUpdate' event of the owner. |
|
338 | */ |
|
339 | public function afterUpdate() |
|
340 | { |
|
341 | /** @var ActiveRecord $owner */ |
|
342 | $owner = $this->owner; |
|
343 | ||
344 | if ($owner->isRelationPopulated('translations')) { |
|
345 | $translations = $this->indexByLanguage($owner->getRelatedRecords()['translations']); |
|
346 | $this->saveTranslations($translations); |
|
347 | } |
|
348 | } |
|
349 | ||
350 | /** |
|
351 | * Handle 'afterDelete' event of the owner. |