Skip to content

Commit

Permalink
SchemaFinder to check entity class
Browse files Browse the repository at this point in the history
  • Loading branch information
mdiyakov committed Mar 26, 2018
1 parent 3f376d4 commit bbb5aab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Finder/SchemaFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(SelectQueryBuilder $queryBuilder, Schema $schema, Co
$this->schema = $schema;

foreach ($config->getIndexedEntities() as $entityConfig) {
if (!$schema->getName() == $entityConfig['schema']) {
if ($schema->getName() != $entityConfig['schema']) {
continue;
}
$this->entityConfigs[$entityConfig['class']] = $entityConfig;
Expand All @@ -58,7 +58,9 @@ public function __construct(SelectQueryBuilder $queryBuilder, Schema $schema, Co
public function addSelectClass($class)
{
if (!array_key_exists($class, $this->entityConfigs)) {
throw new \InvalidArgumentException('');
throw new \InvalidArgumentException(
sprintf('Class "%s" is not configured to be used with schema "%s"', $class, $this->getSchema()->getName())
);
}

if (array_search($class, $this->selectedClasses) === false) {
Expand Down

0 comments on commit bbb5aab

Please sign in to comment.