public function afterInsert($model, $id)
{
if ($this->weak) {
return;
}
$insert = $this->dsql();
$insert->set($model->persistence->typecastSaveRow($model, $this->save_buffer));
$this->save_buffer = [];
$insert->set($this->foreign_field, isset($this->join) ? $this->join->id : $id);
$insert->insert();
$this->id = $insert->connection->lastInsertID();
}