References from here is there another way to Shorten where() and orWhere() ?
Example the code like :
$HrEmployeeShift_opt = ArrayHelper::map(
HrEmployeeShift::find()->where(['Status' => 'Pasif'])
->orWhere(['Status' => 'Rolling'])
->asArray()->all(), 'Id', 'Shift'
);
[UPDATE] SOLVED
Comparing same column for two values or more for the best solution in my opinion is to use IN Condition
where we can clearly see the detailed code or you can also use OR
or directly build it like ->where(['Status' => ['Pasif', 'Rolling']])
Code with IN
:
$HrEmployeeShift_opt = ArrayHelper::map(
HrEmployeeShift::find()->where(
[
'IN',
'Status',['Pasif', 'Rolling']
]
)
->asArray()->all(), 'Id', 'Shift'
);