Hi,
what if I need something like this:
SELECT child.*
FROM side_menu_items AS child
LEFT JOIN side_menu_items AS parent ON child.parent_id = parent.id
WHERE child.is_active = 1
AND (child.parent_id IS NULL OR parent.is_active = 1)
how to wrap it to QueryBuilder? Or better I use something like this:
$menuItems = Database::rawSQL("
SELECT child.*
FROM side_menu_items AS child
LEFT JOIN side_menu_items AS parent ON child.parent_id = parent.id
WHERE child.is_active = 1
AND (child.parent_id IS NULL OR parent.is_active = 1)
")->run();