mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR: Use SS_Map::keys() and SS_Map::values() instead of array_keys() / array_values()
This commit is contained in:
parent
1f34973da1
commit
5b8f6edaec
@ -1200,7 +1200,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$children = $childRecords->map("ID", "ParentID");
|
$children = $childRecords->map("ID", "ParentID");
|
||||||
|
|
||||||
// Find out the children that can be deleted
|
// 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
|
// Get a list of all the parents that have no undeletable children
|
||||||
$deletableParents = array_fill_keys($editableIDs, true);
|
$deletableParents = array_fill_keys($editableIDs, true);
|
||||||
@ -1212,7 +1212,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
$deletableParents = array_keys($deletableParents);
|
$deletableParents = array_keys($deletableParents);
|
||||||
|
|
||||||
// Also get the $ids that don't have children
|
// Also get the $ids that don't have children
|
||||||
$parents = array_unique($children);
|
$parents = array_unique($children->values());
|
||||||
$deletableLeafNodes = array_diff($editableIDs, $parents);
|
$deletableLeafNodes = array_diff($editableIDs, $parents);
|
||||||
|
|
||||||
// Combine the two
|
// Combine the two
|
||||||
|
Loading…
Reference in New Issue
Block a user