I have an array of conditions for where() method, that can be successfully added to query builders:
$condition = [
'AND',
['archived' => 0],
['broken' => 0],
['gender' => 1],
[
'OR',
['visible' => 1],
['status' => 1],
],
];
but in some place I need to convert this array to string
(`archived` = 0) AND (`broken`= 0) AND (`gender` = 1) AND (`visible` = 1 OR `status` = 1)
and then place it to select() method like raw SQL statement
SUM(IF((`archived` = 0) AND (`broken`= 0) AND (`gender` = 1) AND (`visible` = 1 OR `status` = 1)))
SUM(IF(...))?