submitMigration()
@param string $className The name of the migration class to be checked for inclusion and execution
18300
public function submitMigration($className)
    {

        if ($this->direction == 'up') {
            if ($className::checkVersionUp($this->current, $this->target)) {
                $this->addMigration(new $className);
            }
        } elseif ($this->direction == 'down') {
            if ($className::checkVersionDown($this->current, $this->target)) {
                $this->addMigration(new $className);
            }
        }
    }
124014
public static function autoload(string $className): void
    {
        $classPath = str_replace('\\', DS, $className);
        $path = $classPath . '.php';

        if ((@include $path) === false) {
            // if we fail to include a file, let's throw an exception so we can see where it happened - it'll speed up troubleshooting
            $includePath = get_include_path();
            throw new ApplicationException("Unable to load class {$className} in current include path={$includePath}");
        }
    }
747944
public function addClass($className) {
        $oldClassName    = $this->getAttributeValue('class');
        $oldClassNameArr = $oldClassName ? explode(' ', $oldClassName) : array();
        $classNameArr    = array_merge($oldClassNameArr, explode(' ', $className));
        // housekeeping
        $classNameArr    = array_unique(array_filter(array_map('trim', $classNameArr)));
        $this->setAttribute('class', implode(' ', $classNameArr));
    }
832180
public function loadClass($className)
    {
        if ($filePath = $this->resolveFileName($className)) {
            if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
                if ($this->classFileExists($filePath)) {
                    require_once $filePath;
                }
            } else {
                require_once $filePath;
            }
        }
    }
725675
public function isTransient($className)
    {
        if (!\class_exists($className)) {
            return false;
        }

        $instances = \class_implements($className);
        if ($instances === false) {
            return false;
        }

        if (!\in_array(EntityInterface::class, $instances)) {
            return false;
        }
//        if (!\in_array(DatabaseEntityInterface::class, $instances)) {
//            return false;
//        }

        return true;
    }
772055
public function load($className) {
        if (class_exists($className, FALSE) || interface_exists($className, FALSE)) {
            return;
        }

        foreach ($this->dirs as $dir) {
            if ($this->loadClass($this->basePath . DIRECTORY_SEPARATOR . $dir, $className)) {
                return;
            }
    	}
    }
818412
public function generateAndLoadClass($className)
    {
        if (class_exists($className, false)) {
            throw new \RuntimeException("Unable to generate and load already existing class '$className'");
        }

        $filename = $this->findFile($className);

        if (!$filename || !file_exists($filename)) {
            $classFileGenerator = $this->_builder->build($className);

            if ($filename) {
                file_put_contents($filename, $classFileGenerator->generate());
            } else {
                $this->evalContent($classFileGenerator);
            }
        }
        if ($filename && file_exists($filename)) {
            include $filename;
        }
    }
28904
private function validateAbstractSchemaName($schemaName) : void
    {
        if (class_exists($schemaName, true) || interface_exists($schemaName, true)) {
            return;
        }

        try {
            $this->getEntityManager()->getClassMetadata($schemaName);

            return;
        } catch (MappingException $mappingException) {
            $this->semanticalError(
                sprintf('Class %s could not be mapped', $schemaName),
                $this->lexer->token
            );
        }

        $this->semanticalError(sprintf("Class '%s' is not defined.", $schemaName), $this->lexer->token);
    }
83680
private function writeMigration($name, $eventObjectTable, $actionTiming, $event)
    {
        $file = pathinfo($this->creator->write(
            $name,
            $eventObjectTable,
            $actionTiming,
            $event,
            $this->getMigrationPath()
        ), PATHINFO_FILENAME);

        $this->line("<info>Created Migration:</info> {$file}");
    }
323023
protected function createMigration($class)
    {
        $query = new Query;
        $migrate = $query->select(['migrationPath'])
                ->from($this->migrationTable)
                ->where(['version' => $class])
                ->one();
        $filename = DIRECTORY_SEPARATOR . $class . '.php';
        if ($migrate && file_exists($migrate['migrationPath'] . $filename)) {
            $this->migrationPath = $migrate['migrationPath'];
        }

        $file = $this->migrationPath . $filename;
        require_once($file);

        return new $class(['db' => $this->db]);
    }
58019
private function throwIfNotEntity(string $className): void
    {
        if (!$this->isEntity($className)) {
            throw new \UnexpectedValueException('Given class name `' . $className . '` is not a Doctrine entity. Either register a custom GraphQL type for `' . $className . '` when instantiating `' . self::class . '`, or change the usage of that class to something else.');
        }
    }
1060604
protected function isValidApplicationClass(string $className): bool
    {
        $reflectionClass = new ReflectionClass($className);

        return
            $reflectionClass->isInstantiable() === true &&
            $reflectionClass->implementsInterface(ApplicationInterface::class) === true;
    }
1132570
public function isTransient($className)
    {
        return
            !$this->mappers->hasMapperFor($className) ||
            $this->mappers->getMapperFor($className)->isTransient();
    }
444473
public static function isMigrationFileExists($className)
    {
        $fileTail = snake_case($className) . '.php';
        $files = glob(database_path('migrations/*'));
        foreach ($files as $file) {
            if ($fileTail === substr(basename($file), 18)) {
                return $file;
            }
        }
        return false;
    }
973140
public function loadClass($className)
    {
        if (self::typeExists($className)) {
            return true;
        }

        if ( ! $this->canLoadClass($className)) {
            return false;
        }

        require($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
               . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className)
               . $this->fileExtension;

        return self::typeExists($className);
    }
504728
private function _addMigrationRecord( $class )
    {
        $name = $this->db->prepareString( $class );
        $tm   = new \DateTime();
        $tm   = $tm->getTimestamp();
        
        // update migrations table with the new applied migration
        $query = "INSERT INTO $this->migrationTable 
                 ( migration_name, migration_date_applied ) VALUES ( ";
        
        $query .= "'$name', ";
        $query .= "$tm";
        
        $query .= " )";
        
        $this->db->lockTables( $this->migrationTable );
        
        $id = $this->db->insert( $query );
        
        if ( $this->verbose )
        {
            echo 'Migrating: ' . $class . PHP_EOL;
        }
        
        $this->db->unlockTables();
        
        return FALSE !== $id;
    }
925882
public function removeClass($className) {
        $oldClassName    = $this->getAttributeValue('class');
        $oldClassNameArr = $oldClassName ? explode(' ', $oldClassName) : array();
        unset($oldClassNameArr[array_search($className, $oldClassNameArr)]);
        $this->setAttribute('class', implode(' ', $oldClassNameArr));
    }