Update Group.php

move to private method
This commit is contained in:
Dileep Ratnayake 2019-08-27 16:21:08 +12:00 committed by GitHub
parent 40e5c4ec59
commit a976a1688b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,15 @@ class Group extends DataObject
return $doSet;
}
private function getGroups
private function getDecodedBreadcrumbs()
{
$list = Group::get()->exclude('ID', $this->ID);
$groups = ArrayList::create();
foreach ($list as $group) {
$groups->push(['ID' => $group->ID, 'Title' => Convert::xml2raw($group->Breadcrumbs)]);
}
return $groups;
}
/**
* Caution: Only call on instances, not through a singleton.
@ -117,11 +125,7 @@ class Group extends DataObject
*/
public function getCMSFields()
{
$list = Group::get()->exclude('ID', $this->ID);
$groups = ArrayList::create();
foreach ($list as $group) {
$groups->push(['ID' => $group->ID, 'Title' => Convert::xml2raw($group->Breadcrumbs)]);
}
$groups = $this->getDecodedBreadcrumbs();
$fields = new FieldList(
new TabSet(
"Root",