mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Replace deprecated code with DataObject::getSchema()->classHasTable()
This commit is contained in:
parent
572c17a00e
commit
8bc6f5982c
@ -36,7 +36,7 @@ class SearchIntrospection
|
||||
public static function hierarchy($class, $includeSubclasses = true, $dataOnly = false)
|
||||
{
|
||||
$key = "$class!" . ($includeSubclasses ? 'sc' : 'an') . '!' . ($dataOnly ? 'do' : 'al');
|
||||
|
||||
|
||||
if (!isset(self::$hierarchy[$key])) {
|
||||
$classes = array_values(ClassInfo::ancestry($class));
|
||||
if ($includeSubclasses) {
|
||||
@ -48,14 +48,13 @@ class SearchIntrospection
|
||||
array_splice($classes, 0, $idx+1);
|
||||
}
|
||||
|
||||
//@todo find another way to determine if a dataobject does not have a table
|
||||
// if ($dataOnly) {
|
||||
// foreach ($classes as $i => $class) {
|
||||
// if (!DataObject::has_own_table($class)) {
|
||||
// unset($classes[$i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if ($dataOnly) {
|
||||
foreach ($classes as $i => $class) {
|
||||
if (!DataObject::getSchema()->classHasTable($class)) {
|
||||
unset($classes[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self::$hierarchy[$key] = $classes;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user