mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Using instanceof rather than is_a in CheckboxSetField
This commit is contained in:
parent
e31851b182
commit
eb5716f471
@ -85,7 +85,7 @@ class CheckboxSetField extends OptionsetField {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Sometimes we pass a singluar default value thats ! an array && !SS_List
|
// Sometimes we pass a singluar default value thats ! an array && !SS_List
|
||||||
if(is_a($values, 'SS_List') || is_array($values)) {
|
if($values instanceof SS_List || is_array($values)) {
|
||||||
$items = $values;
|
$items = $values;
|
||||||
} else {
|
} else {
|
||||||
$items = explode(',', $values);
|
$items = explode(',', $values);
|
||||||
@ -245,7 +245,7 @@ class CheckboxSetField extends OptionsetField {
|
|||||||
|
|
||||||
if($items) {
|
if($items) {
|
||||||
// Items is a DO Set
|
// Items is a DO Set
|
||||||
if(is_a($items, 'SS_List')) {
|
if($items instanceof SS_List) {
|
||||||
foreach($items as $item) {
|
foreach($items as $item) {
|
||||||
$data[] = $item->Title;
|
$data[] = $item->Title;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user