get use files

@param stdClass $data
@param bool $multiLanguage
@return string
765252
private function getUseFiles(stdClass $data, bool $multiLanguage = false)
    {
        $output = '';

        $list = [];
        $list[] = [
            "nameSpace" => $data->modelNamespace,
            "name"      => $data->mainModel->modelName,
        ];

        if( $multiLanguage )
            $list[] = [
                "nameSpace" => $data->modelNamespace,
                "name"      => $data->mainModel->modelName . 'Translations',
            ];

        $list[] = [
            "nameSpace" => $data->formValidationNameSpace,
            "name"      => $data->formValidationName,
        ];

        if( isset($data->mainModel->multiLanguage) ) {

            $list[] = [
                "nameSpace" => $data->formValidationNameSpace,
                "name"      => $data->formTranslationsValidationName,
            ];
        }

        foreach ( $list as $key => $value )
            $output .= "\r\n" . 'use ' . $value['nameSpace'] . '\\' . $value['name'] . ';';

        return $output;
    }
1080369
private function retrieveUsedFiltersType($data)
    {
        $usedTypes = array();
        foreach($data as $alias => $filterData) {
            if ($filterData['enabled'] == true){
                $filter = $this->getFilter($alias);
                if (!in_array($filter->applyOn(), $usedTypes)) {
                    array_push($usedTypes, $filter->applyOn());
                }
            }
        }
        
        return $usedTypes;
    }
1355686
public function getTranslationFile($locale)
    {
        if (isset($this->locales[$locale]) === false) {
            return null;
        }

        return $this->locales[$locale];
    }
1327719
public function _getDAL() {
		$dal = new \Asgard\Db\DAL($this->dataMapper->getDB());
		$table = $this->getTable();
		$dal->orderBy($this->orderBy);
		if($this->reversed)
			$dal->reverse();
		$dal->limit($this->limit);
		$dal->offset($this->offset);
		if($this->groupBy === null)
			$dal->groupBy($table.'.id');
		elseif($this->groupBy !== false)
			$dal->groupBy($this->groupBy);
		$dal->select($this->selects);

		$dal->having($this->processConditions($this->having));
		$dal->where($this->processConditions($this->where));

		if($this->definition->isI18N()) {
			$translation_table = $this->getTranslationTable();
			$selects = [$table.'.*'];
			foreach($this->definition->properties() as $name=>$property) {
				if($property->get('i18n'))
					$selects[] = $translation_table.'.'.$name;
			}
			$dal->addSelect($selects);
			$dal->from($table);
			$dal->leftjoin([
				$translation_table => $this->processConditions([
					$table.'.id = '.$translation_table.'.id',
					$translation_table.'.locale' => $this->locale
				])
			]);
		}
		else {
			$dal->addSelect([$table.'.*']);
			$dal->from($table);
		}

		$this->recursiveJointures($dal, $this->join, $this->definition, $this->getTable());

		foreach($this->dalCallbacks as $cb)
			$cb($dal);

		foreach($this->unions as $union)
			$dal->union($union->getDAL());

		return $dal;
	}
1056456
public function getDataSource()
    {
        foreach (self::$data_file_names as $name) {
            $path = $this->getPath() . '/' . $name;
            if (file_exists($path)) {
                return new DataSource($path);
            }
        }

        return false;
    }
1249957
public function optimize (stdClass $data)
    {
        $data->translationFilePrefix = $this->stringWithUnderscore ($data->serviceURL);

        $data->translationFilePrefix = $this->stringWithUnderscore ($data->translationFilePrefix);
        $data->translationsLocation = $this->getTranslationPrefix ($data) . $data->translationFilePrefix;

        return $data;
    }
434127
public static function download($data){
        if (is_array($data)) {
            if (isset($data['filename'])) static::$force_dl = $data['filename'];
            if (isset($data['charset'])) static::charset($data['charset']);
            if (isset($data['mime'])) static::type($data['mime']);
            if (isset($data['body'])) static::body($data['body']);
        } else static::$force_dl = $data;
    }
1120686
public function mostUsedLanguage($fancy = false)
    {
        $max = collect($languages = $this->usedLanguages())->max();

        foreach ($languages as $lang => $views) {
            if ($views == $max) {
                if ($fancy) {
                    $countries = json_decode(file_get_contents(__DIR__.'/../countries.json'), true);
                    foreach ($countries as $country) {
                        if ($country['code'] == $lang) {
                            return explode(' ', str_replace(';', '', $country['name']))[0];
                        }
                    }
                }

                return $lang;
            }
        }
    }
829001
public function dumpPaths($multilingual = false)
    {
        $this->registerPaths();

        if ($multilingual) {
            $this->registerMultilingualPaths();
        }

        return $this->renderer->dumpPaths();
    }
733586
protected function getData($data)
    {
        $method = "load" . strtoupper($this->mode);

        libxml_use_internal_errors(true);
        $this->dom->$method($data);
        $this->errors = libxml_get_errors();
        libxml_clear_errors();

        return $data;
    }
744731
public function getAvailableLanguagesByUsage( core_kernel_classes_Resource $usage)
    {
        $returnValue = array();
    	$langClass = new core_kernel_classes_Class(static::CLASS_URI_LANGUAGES);
	    $returnValue = $langClass->searchInstances(array(
            static::PROPERTY_LANGUAGE_USAGES => $usage->getUri()
	    ), array(
	    	'like' => false
	    ));
        return (array) $returnValue;
    }
582576
public function getDcMultilingualRootPageLanguages()
    {
        $pages = $this->framework->createInstance(Database::class)->execute("SELECT DISTINCT language FROM tl_page WHERE type='root' AND language!=''");
        $languages = $pages->fetchEach('language');

        array_walk(
            $languages,
            function (&$value) {
                $value = str_replace('-', '_', $value);
            }
        );

        return $languages;
    }
394345
private function resolveMainLanguageCode($data): string
    {
        if (!$data instanceof ContentUpdateData && !$data instanceof ContentCreateData) {
            throw new InvalidArgumentException(
                '$data',
                'expected type of ContentUpdateData or ContentCreateData'
            );
        }

        return $data->isNew()
            ? $data->mainLanguageCode
            : $data->contentDraft->getVersionInfo()->getContentInfo()->mainLanguageCode;
    }
194926
public static function get($file, $data = [])
    {
        $path = self::load('views.' . $file);

        extract($data, EXTR_SKIP);

        include $path;
    }
808362
function get_file($srcpath, $localpath) {

        $localpath = $this->utf_decode_path($localpath);

        $handle = fopen($localpath, 'wb');
        if ($handle) {
            $unused = '';
            $ret = $this->get($srcpath, $unused, $handle);
            fclose($handle);
            if ($ret) {
                return true;
            }
        }
        return false;
    }
11303
public function extractUrlAliasFromData($data)
    {
        $urlAlias = new UrlAlias();

        list($type, $destination) = $this->matchTypeAndDestination($data['action']);
        $urlAlias->id = $data['parent'] . '-' . $data['text_md5'];
        $urlAlias->pathData = $this->normalizePathData($data['raw_path_data']);
        $urlAlias->languageCodes = $this->languageMaskGenerator->extractLanguageCodesFromMask($data['lang_mask']);
        $urlAlias->alwaysAvailable = $this->languageMaskGenerator->isAlwaysAvailable($data['lang_mask']);
        $urlAlias->isHistory = isset($data['is_path_history']) ? $data['is_path_history'] : !$data['is_original'];
        $urlAlias->isCustom = (bool)$data['is_alias'];
        $urlAlias->forward = $data['is_alias'] && $data['alias_redirects'];
        $urlAlias->destination = $destination;
        $urlAlias->type = $type;

        return $urlAlias;
    }
571119
protected function getDestenationFile($language, $name)
    {
        $path = $this->getLocalePath($language);

        return sprintf('%s%s.php', $path, $name);
    }