From 5b8f6edaeccf7b51af2c7861866d98ce5f5cc63e Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sat, 29 Oct 2011 17:41:00 +1300 Subject: [PATCH] MINOR: Use SS_Map::keys() and SS_Map::values() instead of array_keys() / array_values() --- code/model/SiteTree.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 1690df71..093b81d2 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1200,7 +1200,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $children = $childRecords->map("ID", "ParentID"); // Find out the children that can be deleted - $deletableChildren = self::can_delete_multiple(array_keys($children), $memberID); + $deletableChildren = self::can_delete_multiple($children->keys(), $memberID); // Get a list of all the parents that have no undeletable children $deletableParents = array_fill_keys($editableIDs, true); @@ -1212,7 +1212,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $deletableParents = array_keys($deletableParents); // Also get the $ids that don't have children - $parents = array_unique($children); + $parents = array_unique($children->values()); $deletableLeafNodes = array_diff($editableIDs, $parents); // Combine the two