Supplier Model:
$supplier_vehicles=SupplierVehicle::model()->findAll( 'supplier_id=:supplier_id', array(':supplier_id'=>$model->id));
Supplier::model()->vehicles is an activeCheckBoxList with predefined checkboxes, I need the matching checkboxes to be ticked. E.g:
<input type="checkbox" name="Supplier[vehicles][]" value="1" />Car
<input type="checkbox" name="Supplier[vehicles][]" value="2" />Boat
I tried Supplier::model()->vehicles=$supplier_vehicles but that did not work. Do I need to create this as a relation in my Supplier model?
supplier table:
id
name
supplier_vehicle table:
id
supplier_id
vehicle_id