My scenario is that a company has many branches and each branch has different employees. I have a user table and a branch table. User table contains a branch_id field which is its relationship to the branch table (branch id). I am using a dropdownlist populated from branch ids from the branch table. When a new employee account is created, the branch is chosen using this dropdownlist.
Some employee accounts need to be created in all the branches. If its a single or a combination of branches, i create the accounts individually. Can i have an option like All which if chosen can create the account in all branches? When i was doing this with php and mysql, i used checkbox list, and the sql query would run for all the checked branches (iterating over the returned array). How do i achieve such feature in yii?
Also, can i use wildcard (*) in relationship i.e. i choose * in branch_id and it would link the account to all the branches?