Applies the variables to the module container.

@param ModuleVariables $moduleVariables
504190
public function applyVariables(ModuleVariables $moduleVariables) : void {
        $moduleVariables
            ->modelDefinition('user', User::class, self::defaultUser())
            ->setAttributes([
                'id'        => 'ID',
                'email'     => 'Email',
                'firstname' => 'First Name',
                'lastname'  => 'Last Name',
                'fullname'  => 'Full Name',
                'status'    => 'Status',
            ]);

        $moduleVariables
            ->modelDefinition('brand', Brands::class, self::defaultBrand())
            ->setAttributes([
                'id'        => 'ID',
                'name'      => 'Name',
                'status'    => 'Status',
            ]);

        $moduleVariables->set('site.name', 'Site Name', function() {
            return memory('site.name');
        });

        $moduleVariables->set('time', 'Time', function() {
            return Carbon::now()->format('H:i');
        });

        $moduleVariables->set('date', 'Date', function() {
            return Carbon::now()->format('Y-m-d');
        });
    }
210932
protected function baseVariables(array &$variables = [])
    {
        // Get base variables
        parent::baseVariables($variables);

        // Breadcrumbs
        $variables['crumbs'][] = [
            'label' => $variables['title'],
            'url' => UrlHelper::url($variables['baseCpPath'])
        ];
    }
505717
public function addModuleName($moduleName)
    {
        if (isset($this->moduleNames[$moduleName])) {
            throw new RuntimeException(sprintf(
                'The module "%s" was added to the graph twice.',
                $moduleName
            ));
        }

        $this->moduleNames[$moduleName] = true;
        $this->dependencies[$moduleName] = array();
    }
911405
public void setVariables(final Map<String,Object> variables) {
        if (variables == null) {
            return;
        }
        this.variables.putAll(variables);
    }
611527
public function setVars($vars)
    {
        // If vars is an array
        if (is_array($vars) && count($vars)) {
            // Iterate and set the var
            foreach ($vars as $key => $value) {
                $this->setVar($key, $value);
            }
        }
        return $this;
    }
1374990
public function enableModules($modules)
    {
        foreach ($modules as $moduleToEnable => $value) {
            $module = $this->module->get($moduleToEnable);
            $module->enable();
        }
    }
63905
public void setTemplateVars(List<TemplateVar> templateVars) {
		this.templateVars.clear();
		if(templateVars != null && !templateVars.isEmpty()) {
			this.templateVars.addAll(templateVars);
		}
	}
670380
public void declareVariables(Variable[] vars) {
        for (int i=0; i<vars.length; i++) {
            vars[i] = declareVariable(vars[i]);
        }
    }
1224360
protected function readVariables($variables)
    {
        /** @var FactoryType $factoryType */
        $factoryType = $this->application->container->get('type_factory');

        foreach ($variables as $var) {
            $node = $factoryType->factory($var, self::LEVEL_INIT);

            $this->nodes[] = $node;
        }
    }
121562
private function initialiseVariables(): void
    {
        $this->entityInterfaceFqn = $this->namespaceHelper->getEntityInterfaceFromEntityFqn($this->entityFqn);
        list($className, , $subDirs) = $this->namespaceHelper->parseFullyQualifiedName(
            $this->entityFqn,
            $this->srcSubFolderName,
            $this->projectRootNamespace
        );

        $this->singularNamespacedName = $this->namespaceHelper->getSingularNamespacedName(
            $this->entityFqn,
            $subDirs
        );
        $this->pluralNamespacedName   = $this->namespaceHelper->getPluralNamespacedName(
            $this->entityFqn,
            $subDirs
        );
        $this->setDestinationDirectory(
            $className,
            $subDirs
        );
        $plural                  = \ucfirst(MappingHelper::getPluralForFqn($this->entityFqn));
        $singular                = \ucfirst(MappingHelper::getSingularForFqn($this->entityFqn));
        $nsNoEntities            = \implode('\\', \array_slice($subDirs, 2));
        $this->singularNamespace = \ltrim($nsNoEntities . '\\' . $singular, '\\');
        $this->pluralNamespace   = \ltrim($nsNoEntities . '\\' . $plural, '\\');
        $this->dirsToRename      = [];
        $this->filesCreated      = [];
    }
573768
@Override
    public void setVariablesScope(Variables variables) {
	this.variables = variables;
	undefinedScope().setVariableScope(variables);

	if (variables instanceof ClosureScope) {
	    variables = ((ClosureScope) variables).getVariables();
	}
	if (variables instanceof StaticScope) {
	    activeComponent = ((StaticScope) variables).getComponent();
	}
	else if (variables instanceof ComponentScope) {
	    activeComponent = ((ComponentScope) variables).getComponent();
	}
	else {
	    activeComponent = null;
	}
    }
1246877
private function loadRequiredModules(
		Module $module,
		&$modules,
		array $moduleList,
		DependencyInjectionContainer $dic) {
		foreach ($module->getRequiredModules() as $requiredModule) {
			if (!\in_array($requiredModule, $moduleList)) {
				$this->loadModule($requiredModule, $modules, $moduleList, $dic);
				if ($module instanceof RequiredModuleAwareModule) {
					$module->addRequiredModule($dic->make($requiredModule));
				}
			}
		}
	}
688198
protected function updateRegisteredModule($moduleName)
    {
        $module = $this->findOrFalse('module_name', $moduleName);
        $module->module_version = $this->def($moduleName, 'version');
        $module->module_is_updated = 1;
        $module->save();
    }
358487
@Override
	protected void putVariables(Map<String, String> variables) {
		variables.put(ScopeFormat.SCOPE_HOST, hostname);
		variables.put(ScopeFormat.SCOPE_TASKMANAGER_ID, taskManagerId);
	}
706427
public void setVariables(Map<String, String> variables)
    {
        if (this.variables != null)
        {
            this.variables.putAll(variables);
        }
        else
        {
            this.variables = variables;
        }
    }
934159
public function update($vars)
	{
		$this->vars = $vars + $this->vars;

		$this->preprocess($this->vars);
	}
832238
private function setCovertVars(array $vars = [])
    {
        $this->setExt($vars['ext']);
        $this->capsule['ext'] = $vars['ext'];
        $this->setFilePath($vars['filepath']);
        $this->capsule['filepath'] = $vars['filepath'];
    }