Hi I’m new to Yii&PHP
1)whensystem user create a Record in model A (table tbl_A) it and after $model->save(); I need to create a 1000 or more
record of Model B (table tbl_
now I’m calling a function from Acontroller
//////////////////////////////////////////
actionCreate(){
…
$a->save();
$this->gen_bs($count ,$aid);}
////////////////////////////////////////////
function gen_bs($count ,$aid){
for (i=0; i<$count ;i++){
$b= new B ;
$b->value=100;
$b->Aid = $aid ;
$b->save();
}}
is this good idea or should I do something else
2)each record in B must have a unique& unpredictable code
is there is any thing in Yii that helps me with that
thanks