Q
Q
qrolf2017-09-13 23:26:38
Yii
qrolf, 2017-09-13 23:26:38

How to make a record in two database tables in one method?

The method has actions for writing first to one database table, then to another.
Saves to only one of them. How to make it so that it was in both.
Example:

$operations1 = new Operations();
$operations1 ->user = "Ivan";
$operations1 ->login = "Ivanov";
$operations1->save(); 

$moreAction= new moreAction();
$moreAction->property1 = "Prop1";
$moreAction->property2 = "Prop2";
$moreAction->save();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-09-13
@qrolf

Goodnight.
Working with multiple models

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question