Usually we create and save the client model first and get the id of the client. And then we save the client_has_role model, specifying the id of the client and the id of the role.
Yii doesn’t support the automated saving of the related objects out of the box, so you have to do it by yourself.
You may want to use some extension to automate the process.