LazyRecord\Schema\SchemaGenerator::updateClassFile PHP Метод

updateClassFile() защищенный Метод

If the schema file is newer or the forceUpdate flag is specified, then the generated class files should be updated.
protected updateClassFile ( ClassTemplate\ClassFile $cTemplate, DeclareSchema $schema, $canOverwrite = false )
$cTemplate ClassTemplate\ClassFile
$schema DeclareSchema
    protected function updateClassFile(ClassFile $cTemplate, DeclareSchema $schema, $canOverwrite = false)
    {
        // always update the proxy schema file
        $classFilePath = $schema->getRelatedClassPath($cTemplate->getShortClassName());
        // classes not Model/Collection class are overwriteable
        if (file_exists($classFilePath)) {
            if ($canOverwrite && ($schema->isNewerThanFile($classFilePath) || $this->forceUpdate)) {
                $this->writeClassTemplateToPath($cTemplate, $classFilePath);
                return [$cTemplate->getClassName(), $classFilePath];
            }
        } else {
            if ($this->writeClassTemplateToPath($cTemplate, $classFilePath)) {
                return [$cTemplate->getClassName(), $classFilePath];
            }
        }
    }