mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 12:05:29 +00:00
BUGFIX: Fixed deprecation errors for ClassInfo::is_subclass_of
This commit is contained in:
parent
1ee50dd9ab
commit
9534eeff8a
@ -41,7 +41,7 @@ class FullTextSearch {
|
||||
|
||||
$valid = array();
|
||||
foreach ($all as $indexclass => $instance) {
|
||||
if (ClassInfo::is_subclass_of($indexclass, $class)) $valid[$indexclass] = $instance;
|
||||
if (is_subclass_of($indexclass, $class)) $valid[$indexclass] = $instance;
|
||||
}
|
||||
|
||||
self::$indexes_by_subclass[$class] = $valid;
|
||||
|
@ -242,7 +242,7 @@ abstract class SearchIndex extends ViewableData {
|
||||
|
||||
foreach ($fields as $field => $type) {
|
||||
if (preg_match('/^(\w+)\(/', $type, $match)) $type = $match[1];
|
||||
if (ClassInfo::is_subclass_of($type, 'StringField')) $this->addFulltextField($field);
|
||||
if (is_subclass_of($type, 'StringField')) $this->addFulltextField($field);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -411,7 +411,7 @@ abstract class SearchIndex extends ViewableData {
|
||||
|
||||
// First, if this object is directly contained in the index, add it
|
||||
foreach ($this->classes as $searchclass => $options) {
|
||||
if ($searchclass == $class || ($options['include_children'] && ClassInfo::is_subclass_of($class, $searchclass))) {
|
||||
if ($searchclass == $class || ($options['include_children'] && is_subclass_of($class, $searchclass))) {
|
||||
|
||||
$dirty[$searchclass] = array();
|
||||
foreach ($statefulids as $statefulid) {
|
||||
|
@ -143,7 +143,7 @@ class SearchUpdater extends Object {
|
||||
// Is this the first table for this particular object? Then add an item to $writes
|
||||
if (!isset($writes[$key])) $writes[$key] = array('base' => $base, 'class' => $class, 'id' => $id, 'statefulids' => $statefulids, 'fields' => array());
|
||||
// Otherwise update the class label if it's more specific than the currently recorded one
|
||||
else if (ClassInfo::is_subclass_of($class, $writes[$key]['class'])) $writes[$key]['class'] = $class;
|
||||
else if (is_subclass_of($class, $writes[$key]['class'])) $writes[$key]['class'] = $class;
|
||||
|
||||
// Update the fields
|
||||
foreach ($fields as $field => $value) {
|
||||
|
@ -92,7 +92,7 @@ abstract class SolrIndex extends SearchIndex {
|
||||
|
||||
protected function _addField($doc, $object, $field) {
|
||||
$class = get_class($object);
|
||||
if ($class != $field['origin'] && !ClassInfo::is_subclass_of($class, $field['origin'])) return;
|
||||
if ($class != $field['origin'] && !is_subclass_of($class, $field['origin'])) return;
|
||||
|
||||
$value = $this->_getFieldValue($object, $field);
|
||||
$type = isset(self::$filterTypeMap[$field['type']]) ? self::$filterTypeMap[$field['type']] : self::$filterTypeMap['*'];
|
||||
@ -142,7 +142,7 @@ abstract class SolrIndex extends SearchIndex {
|
||||
$class = get_class($object);
|
||||
|
||||
foreach ($this->getClasses() as $searchclass => $options) {
|
||||
if ($searchclass == $class || ($options['include_children'] && ClassInfo::is_subclass_of($class, $searchclass))) {
|
||||
if ($searchclass == $class || ($options['include_children'] && is_subclass_of($class, $searchclass))) {
|
||||
$this->_addAs($object, $searchclass, $options);
|
||||
}
|
||||
}
|
||||
@ -150,7 +150,7 @@ abstract class SolrIndex extends SearchIndex {
|
||||
|
||||
function canAdd($class) {
|
||||
foreach ($this->classes as $searchclass => $options) {
|
||||
if ($searchclass == $class || ($options['include_children'] && ClassInfo::is_subclass_of($class, $searchclass))) return true;
|
||||
if ($searchclass == $class || ($options['include_children'] && is_subclass_of($class, $searchclass))) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user