Defines the structure of this module.

@param CrudModuleDefinition $module
164043
protected function defineCrudModule(CrudModuleDefinition $module)
    {
        $module->name('authors');

        $module->metadata([
            'icon' => 'user',
        ]);

        $module->labelObjects()->fromProperty(BlogAuthor::NAME);

        $module->crudForm(function (CrudFormDefinition $form) {
            $form->section('Details', [
                $form->field(
                    Field::create('name', 'Name')->string()->required()
                )->bindToProperty(BlogAuthor::NAME),
            ]);

            SlugField::build($form, 'slug', 'URL Friendly Name', $this->dataSource, $this->blogConfiguration->getSlugGenerator(), 'name', BlogAuthor::SLUG);

            $form->continueSection([
                $form->field(
                    Field::create('role', 'Role')->string()->defaultTo('')
                )->bindToProperty(BlogAuthor::ROLE),
                //
                $form->field(
                    Field::create('bio', 'Bio')->html()->required()
                )->bindToProperty(BlogAuthor::BIO),
            ]);

            if ($form->isCreateForm()) {
                $form->onSubmit(function (BlogAuthor $blogAuthor) {
                    $blogAuthor->getMetadata();
                    $blogAuthor->articles = BlogArticle::collection();
                });
            }
        });

        $module->removeAction()->deleteFromDataSource();

        $module->summaryTable(function (SummaryTableDefinition $table) {
            $table->mapProperty(BlogAuthor::NAME)->to(Field::create('name', 'Name')->string());
            $table->mapProperty(BlogAuthor::ROLE)->to(Field::create('role', 'Role')->string());

            $table->view('all', 'All')
                ->asDefault()
                ->loadAll();
        });
    }
1161513
private function registerConfigNamespace(Module $module)
    {
        $files = $this->app['files']->files($module->getPath().'/Config');

        $package = $module->getName();

        foreach ($files as $file) {
            $filename = $this->getConfigFilename($file, $package);

            $this->mergeConfigFrom(
                $file,
                $filename
            );
        }
    }
836821
public function add(Module $module)
    {
        $this->modules[$module->getName()] = $module;

        if ($module instanceof RootModule) {
            $this->rootModule = $module;
        }
    }
186190
public function set(Mod $mod): void
    {
        $this->loadMods();
        $this->mods[$mod->getName()] = $mod;
    }
854846
public function initializeModuleSystem()
    {
        $activatedModules = $this->moduleObjectBackend->loadObject();
        if (!is_array($activatedModules)) {
            $activatedModules = array();
        }
        
        $this->activatedModules = $activatedModules;
        
        foreach ($this->activatedModules as $activatedModule) {
            $this->initializeModule($activatedModule['path']);
        }
    }
1328922
private function _setModule()
	{
		if (preg_match('/^[a-z0-9_-]+$/', $this->_requestVars[0])) {
			$this->_module = $this->_requestVars[0];
        } else {
        	$this->_module = $this->_requestVars[0] = self::DEFAULT_MODULE;
        }

        return $this;
	}
10204
private function setByTypeSelfRelationField(string $module, array $fields) : void
    {
        $first = $fields[0];
        $second = $fields[1];

        $this->setAssociation(
            'belongsToMany',
            static::generateAssociationName($module, $first->getName()),
            [
                'joinTable' => Inflector::tableize($module),
                'className' => $first->getAssocCsvModule(),
                'foreignKey' => $second->getName(),
                'targetForeignKey' => $first->getName()
            ]
        );

        $this->setAssociation(
            'belongsToMany',
            static::generateAssociationName($module, $second->getName()),
            [
                'joinTable' => Inflector::tableize($module),
                'className' => $second->getAssocCsvModule(),
                'foreignKey' => $first->getName(),
                'targetForeignKey' => $second->getName()
            ]
        );
    }
1002812
public static function remove_module( $module ) {
		$key = array_search( $module, self::$modules, true );
		if ( false !== $key ) {
			unset( self::$modules[ $key ] );
		}
	}
580230
private function setByModule(string $module) : void
    {
        $config = (new ModuleConfig(ConfigType::MODULE(), $module))->parse();
        $fields = $this->getModuleFields($module);

        if (! property_exists($config, 'table')) {
            return;
        }

        if (! property_exists($config->table, 'type')) {
            return;
        }

        if ('module' === $config->table->type) {
            $this->setByTypeModule($module, $fields);
        }

        if ('relation' === $config->table->type) {
            $this->setByTypeRelation($module, $fields);
        }

        if ($module === $this->getTableName()) {
            $this->setByTypeFile($module, $fields);
        }
    }
1129766
function setModules($modules)
    {
        if (! is_array($modules) )
            throw new \InvalidArgumentException(sprintf(
                'Modules Must be Array list of module names; given (%s).'
                , $modules
            ));
        
        $this->modules = $modules;
    }
1169767
private function setByTypeFile(string $module, array $fields) : void
    {
        foreach ($fields as $field) {
            $this->setByTypeFileField($field);
        }
    }
310497
public function registerModule(RouterModuleInterface $module)
    {
        $module->initModule($this, $this->getLoop());
        $this->eventDispatcher->addSubscriber($module);
    }
55146
public function registerModules($modules = [])
    {
        for($i = 0; $i < sizeof($modules); $i++) {
            $moduleName = $modules[$i];

            $module = $this->createNew($moduleName);

            if (!$module instanceof ModuleInterface) {
                throw new InvalidModuleException('The module at position '.($i+1).' is invalid');
            }

            $serviceProvider = $module->getServiceProvider();
            $this->getContainer()->registerServices($serviceProvider);
        }
    }
125613
private function createModuleModels($module, $path)
    {
        $module_path = $path . $module;
        $module_path = str_replace(CORE_DIR . DIRECTORY_SEPARATOR, '', $module_path);

        $configGenerator = $this->getConfigGenerator($module_path);

        $this->buildModels($configGenerator);
        $this->buildSql($configGenerator);

        $configTemplate = $this->tpl->dump("generator/config.propel.template.twig", array(
            "module" => $module,
        ));
        $this->writeTemplateToFile($configTemplate, CORE_DIR . DIRECTORY_SEPARATOR . $module_path . DIRECTORY_SEPARATOR . "Config" .
            DIRECTORY_SEPARATOR . "config.php", true);
        $this->log->addLog("Generado config genérico para propel");
    }
1064864
public function setModule($module)
    {
        if (!is_string($module)) {
            throw new \InvalidArgumentException('The attribute module on the class Entity has to be string (' . gettype($module) . ('object' === gettype($module) ? ' ' . get_class($module) : '') . ' given).');
        }

        $this->module = $module;

        return $this;
    }
944865
protected function setModule($module_id)
    {
        $this->data_module = $this->module->get($module_id);

        if (empty($this->data_module)) {
            $this->outputHttpStatus(403);
        }
    }
1302407
public function disable(Module $module)
    {
        if ($this->moduleManager->isCoreModule($module)) {
            return redirect()->route('backend::modules.modules.show', [$module->getLowerName()])
                ->with('error', trans('workshop::modules.module cannot be disabled'));
        }

        $module->disable();
    }