wbraganca / yii2-dynamicform

It is widget to yii2 framework to clone form elements in a nested manner, maintaining accessibility.
Other
436 stars 438 forks source link

Adding custom attribute to createMultiple #330

Open saidbakr opened 1 year ago

saidbakr commented 1 year ago

Suppose we have to use virtual attribute that uses external value from other unsaved model, post request, etc. We have to create setter and getter of that attribute and supply its value as the third optional parameter of createMultiple() like the following:

$invoiceItems = Model::createMultiple(InvoiceItems::class, $invoiceItems,['invoiceType' => $model->type]);