The LEFT JOIN works perfect, however, Sorting doesn'twork for me...
I'm using following get:
$fieldset = DataObject::get(
"Article",
"`Category`.`Title` = '$category'",
"`Category`.`Order`",
"LEFT JOIN `Article_Categories` ON `Article_Categories`.`ArticleID` = `Article`.`ID`
LEFT JOIN `Category` ON `Category`.`ID` = `Article_Categories`.`CategoryID`",
""
);
`Category`.`Order` is a integer column...
On the other hand the following SQL Statement works just fine and sorts the output:
SELECT * FROM `Article`
LEFT JOIN `Article_Categories` ON `Article_Categories`.`ArticleID` = `Article`.`ID`
LEFT JOIN `Category` ON `Category`.`ID` = `Article_Categories`.`CategoryID`
ORDER BY `Category`.`Order` ASC