Skip to content

Commit

Permalink
FIX Don't assume a DataObject's table.
Browse files Browse the repository at this point in the history
Knowing if a DataObject has a table or not is irrelevant - data is queried
out and pushed into solr all the same, whether there is a join table, a
base table, or any combination with maybe a few no-tables in between.
SomeDataClass::get() will fetch all data irrelevant of tables, that's the
point of an abstraction like SilverStripe's ORM.
  • Loading branch information
Dylan Wagstaff committed Feb 23, 2018
1 parent 1034458 commit 9e32f2a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Search/Indexes/SearchIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ public function addClass($class, $options = array())
throw new Exception('Can\'t add class to Index after fields have already been added');
}

if (!DataObject::getSchema()->classHasTable($class)) {
throw new \InvalidArgumentException('Can\'t add classes which don\'t have data tables (no $db or $has_one set on the class)');
}

$options = array_merge(array(
'include_children' => true
), $options);
Expand Down

0 comments on commit 9e32f2a

Please sign in to comment.