MINOR: Use leftJoin() / innerJoin() instead of join().

This commit is contained in:
Sam Minnee 2011-10-29 17:40:31 +13:00
parent 3acffaa5bb
commit 1f34973da1

View File

@ -1096,13 +1096,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
); );
// Get the uninherited permissions // Get the uninherited permissions
$uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage, "(\"$typeField\" = 'LoggedInUsers' OR $uninheritedPermissions = Versioned::get_by_stage("SiteTree", $stage)
->where("(\"$typeField\" = 'LoggedInUsers' OR
(\"$typeField\" = 'OnlyTheseUsers' AND \"$groupJoinTable\".\"SiteTreeID\" IS NOT NULL)) (\"$typeField\" = 'OnlyTheseUsers' AND \"$groupJoinTable\".\"SiteTreeID\" IS NOT NULL))
AND \"SiteTree\".\"ID\" IN ($SQL_idList)", AND \"SiteTree\".\"ID\" IN ($SQL_idList)")
"", ->leftJoin($groupJoinTable, "\"$groupJoinTable\".\"SiteTreeID\" = \"SiteTree\".\"ID\" AND \"$groupJoinTable\".\"GroupID\" IN ($SQL_groupList)");
"LEFT JOIN \"$groupJoinTable\"
ON \"$groupJoinTable\".\"SiteTreeID\" = \"SiteTree\".\"ID\"
AND \"$groupJoinTable\".\"GroupID\" IN ($SQL_groupList)");
if($uninheritedPermissions) { if($uninheritedPermissions) {
// Set all the relevant items in $result to true // Set all the relevant items in $result to true