LazyRecord\Command\SchemaCommand\BuildCommand::execute PHP Method

execute() public method

public execute ( )
    public function execute()
    {
        $args = func_get_args();
        $logger = $this->getLogger();
        $config = $this->getConfigLoader(true);
        $this->logger->debug('Finding schemas...');
        $schemas = SchemaUtils::findSchemasByArguments($config, $args, $logger);
        $generator = new SchemaGenerator($config);
        if ($this->options->force) {
            $generator->setForceUpdate(true);
        }
        $classMap = array();
        foreach ($schemas as $schema) {
            if ($this->logger->isDebug()) {
                $this->logger->debug('Checking ' . get_class($schema));
            }
            $generated = $generator->generateSchemaFiles($schema);
            if (!empty($generated)) {
                if ($this->logger->isDebug()) {
                    // $filepath = str_replace(getcwd().'/', '', $schema->getClassFileName());
                    $this->logger->debug('Updated ' . get_class($schema));
                    foreach ($generated as $class => $file) {
                        $this->logger->debug(' - Updated ' . $file);
                    }
                } else {
                    $this->logger->info('Updated ' . get_class($schema));
                }
                $classMap += $generated;
            }
        }
    }