Hi there,
I have a model set up with a class robot {public function initialize() $this->hasMany("id", "robotparts", robotpart_id, ["alias => "robotparts"); }
Before creating a robot model, I set the robotparts variable $robot = new Robot(); $robot->robotparts = Array of robotparts. $robot->save() The model is created correctly with all the robot parts in one transction.
However, If before creating I would like to get an array of previously assign robotparts array to the $robot model, I get errors.
The question is, how to get $robot->robotparts array before $robot->create()
Thank you!