Skip to content

Commit bbb5aab

Browse files
committed
SchemaFinder to check entity class
1 parent 3f376d4 commit bbb5aab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Finder/SchemaFinder.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(SelectQueryBuilder $queryBuilder, Schema $schema, Co
4545
$this->schema = $schema;
4646

4747
foreach ($config->getIndexedEntities() as $entityConfig) {
48-
if (!$schema->getName() == $entityConfig['schema']) {
48+
if ($schema->getName() != $entityConfig['schema']) {
4949
continue;
5050
}
5151
$this->entityConfigs[$entityConfig['class']] = $entityConfig;
@@ -58,7 +58,9 @@ public function __construct(SelectQueryBuilder $queryBuilder, Schema $schema, Co
5858
public function addSelectClass($class)
5959
{
6060
if (!array_key_exists($class, $this->entityConfigs)) {
61-
throw new \InvalidArgumentException('');
61+
throw new \InvalidArgumentException(
62+
sprintf('Class "%s" is not configured to be used with schema "%s"', $class, $this->getSchema()->getName())
63+
);
6264
}
6365

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

0 commit comments

Comments
 (0)