/**
  * Locate every available Record class.
  *
  * @param ClassLocatorInterface $locator
  * @return $this
  * @throws SchemaException
  */
 protected function locateRecords(ClassLocatorInterface $locator)
 {
     //Table names associated with records
     $tables = [];
     foreach ($locator->getClasses(RecordEntity::class) as $class => $definition) {
         if ($class == RecordEntity::class || $class == Record::class) {
             continue;
         }
         $this->records[$class] = $record = new RecordSchema($this, $class);
         if (!$record->isAbstract()) {
             //See comment near exception
             continue;
         }
         //Record associated tableID (includes resolved database name)
         $tableID = $record->getTableID();
         if (isset($tables[$tableID])) {
             //We are not allowing multiple records talk to same database, unless they one of them
             //is abstract
             throw new SchemaException("Record '{$record}' associated with " . "same source table '{$tableID}' as '{$tables[$tableID]}'.");
         }
         $tables[$tableID] = $record;
     }
     return $this;
 }