public function beforeUpdate($model, &$data) { if ($this->weak) { return; } $persistence = $this->persistence ?: $this->owner->persistence; $this->id = $persistence->update($model, $this->id, $this->save_buffer, $this->foreign_table); }