Returns array of profiling models that can be used in a data provider.

@return array models
348244
protected function getModels()
    {
        if ($this->_models === null) {
            $this->_models = [];
            $a = [];
            $timings = Yii::getLogger()->calculateTimings($this->data['messages']);

            foreach ($timings as $seq => $profileTiming) {
                $key = md5($profileTiming['category'] . $profileTiming['info']);
                if (!isset($a[$key])) {
                    $a[$key] =  [
                        'durations' => [], // in milliseconds
                        'category' => $profileTiming['category'],
                        'info' => $profileTiming['info'],
                        'level' => $profileTiming['level'],
                        'seq' => $seq,
                    ];
                }
                $a[$key]['durations'][] = $profileTiming['duration'] * 1000;
            }

            foreach (array_values($a) as $seq => $profileTiming) {
                $this->_models[] =  [
                    'maxDuration' => max($profileTiming['durations']), // in milliseconds
                    'minDuration' => min($profileTiming['durations']), // in milliseconds
                    'avgDuration' => array_sum($profileTiming['durations']) / count($profileTiming['durations']), // in milliseconds
                    'totalDuration' => array_sum($profileTiming['durations']), // in milliseconds
                    'number' => count($profileTiming['durations']),
                    'category' => $profileTiming['category'],
                    'info' => $profileTiming['info'],
                    'level' => $profileTiming['level'],
                    'seq' => $seq,
                ];
            }
        }

        return $this->_models;
    }
1112360
public function getModels()
	{
		$models=array();
		if($this->_model!==null)
			$models[]=$this->_model;
		foreach($this->getElements() as $element)
		{
			if($element instanceof self)
				$models=array_merge($models,$element->getModels());
		}
		return $models;
	}
617666
public static function getReadableModelIds() {
        $model = ModelManager::getModel();
        if (!$model instanceof self) {
            throw new common_exception_Error(__FUNCTION__.' called on '.get_class($model).' model implementation');
        }
        return $model->getReadableModels();
    }
244110
public function getDataModelSettings()
    {
        if (! $this->exists) {
            return array();
        }

        $fieldSettings = array();

        foreach ($this->_fields as $key => $field) {
            if ($field instanceof FieldInterface) {
                $fieldSettings[$key] = $field->getDataModelSettings();
            }
        }

        return $fieldSettings;
    }
112273
public function getTypes()
    {
        return array_reduce(
            $this->_models,
            function ($result, $item) {
                $result[$item['type']] = $item['type'];
                return $result;
            },
            []
        );
    }
1199438
public function getProfiler()
    {
        if (null === $this->profiler) {
            $class = $this->profilerClass;
            $profiler = new $class();
            if (!empty($this->profilerConfiguration)) {
                $profiler->setConfiguration($this->profilerConfiguration);
            }
            $this->profiler = $profiler;
        }

        return $this->profiler;
    }
701415
public function getProfiles()
    {
        if (!array_key_exists('profileIds', $this->content)) {
            return [];
        }

        $profiles = [];

        foreach ($this->content['profileIds'] as $profileId) {
            $profiles[] = $this->security->fetchProfile($profileId);
        }

        return $profiles;
    }
1361079
public function getModels()
    {
        // First, we will simply get the raw results from the query builders which we
        // can use to populate an array with Eloquent models. We will pass columns
        // that should be selected as well, which are typically just everything.
        $results = $this->query->get();

        $connection = $this->model->getConnectionName();

        $models = [];

        // Once we have the results, we can spin through them and instantiate a fresh
        // model instance for each records we retrieved from the database. We will
        // also set the proper connection name for the model after we create it.
        foreach ($results as $result) {
            $models[] = $model = $this->model->newFromBuilder($result);

            $model->setConnection($connection);
        }

        return $models;
    }
1161252
public function getAll()
    {
        $result = $this->callService('GET', self::API_SHARE_LINK);

        return $result->getModels(models\FileSystem\ShareLink::class);
    }
432919
protected function getMappingData(): array
    {
        $mappings = [];

        foreach ($this->locator->getMappingFiles() as $mappingFile) {
            $mappings[] = $this->loadMappingFile($mappingFile);
        }

        $mappingData = [];
        foreach ($mappings as $mapping) {
            $mappingData = $this->mergeMappings($mappingData, $mapping);
        }

        return $mappingData;
    }
384773
public function getAllProfiles()
    {
        $profiles = [];

        $search = $this->repo->createSearch();
        $filter = new BoolQuery();
        $filter->add(new TermQuery('type', 'experiment'), BoolQuery::MUST_NOT);
        $topHitsAgg = new TopHitsAggregation('documents', 20);
        $termAgg = new TermsAggregation('profiles', 'profile.profile');
        $filterAgg = new FilterAggregation('filter', $filter);
        $termAgg->addAggregation($topHitsAgg);
        $filterAgg->addAggregation($termAgg);
        $search->addAggregation($filterAgg);

        $result = $this->repo->findDocuments($search);

        /** @var Setting $activeProfiles */
        $activeProfiles = $this->getValue($this->activeProfilesSettingName, []);

        /** @var AggregationValue $agg */
        foreach ($result->getAggregation('filter')->getAggregation('profiles') as $agg) {
            $settings = [];
            $docs = $agg->getAggregation('documents');
            foreach ($docs['hits']['hits'] as $doc) {
                $settings[] = $doc['_source']['name'];
            }
            $name = $agg->getValue('key');
            $profiles[] = [
                'active' => $activeProfiles ? in_array($agg->getValue('key'), (array)$activeProfiles) : false,
                'name' => $name,
                'settings' => implode(', ', $settings),
            ];
        }

        return $profiles;
    }
1056634
public function getModelTables()
    {
        if ($this->tables === null) {
            $this->setModelTables($this->loadModelTables());
        }

        return $this->tables;
    }
1339607
protected function getAuditModels()
    {
        $auditModels = array();

        // get log models
        if ($this->auditModel) {
            $auditModels[] = array(
                'model_name' => $this->auditModelName ? $this->auditModelName : get_class($this->auditModel),
                'model_id' => $this->getModelPrimaryKeyString($this->auditModel),
                'prefix' => $this->getModelFieldPrefix($this->auditModel),
            );
        }

        // also log to additionalAuditModels
        foreach ($this->additionalAuditModels as $model => $fk_field) {
            $auditModels[] = array(
                'model_name' => $model,
                'model_id' => $this->owner->$fk_field,
                'prefix' => get_class($this->owner) . '.',
                'ignoreFields' => array($fk_field),
            );
        }

        return $auditModels;
    }
1064695
public static function models()
    {
        $cache = Yii::$app->cache;
        if (($modules = $cache->get(self::CACHE_MODULES_DATA)) === false) {
            $modules = static::find()->indexBy('id')->asArray()->all();
            $cache->set(self::CACHE_MODULES_DATA, $modules, null, new TagDependency([
                'tags' => [self::CACHE_MODULES_DATA_DEPENDENCY_TAG]
            ]));
        }
        return $modules;
    }
234867
public function data(): array
    {
        if (empty($this->data) && ! empty($this->model)) {
            $this->buildRowsFromModel($this->model);
        }

        return $this->data;
    }
255296
public function getModelClasses()
    {
        $models = [];

        $modelFiles = $this->getModelFiles();

        if (empty($modelFiles)) {
            return false;
        }

        foreach ($this->getModelFiles() as $appName => $files) {
            foreach ($files as $file) {
                $className = ClassHelper::getClassFromFile($file);

                if (!class_exists($className)) {
                    throw new ClassNotFoundException(
                        sprintf('The class [ %s ] could not be located', $className)
                    );
                }
                $models[$appName][] = $className;
            }
        }

        return $models;
    }
1011905
protected function getModels($refresh = false)
    {
        if ($this->_models === null || $refresh) {
            $this->_models = [];
            if (isset($this->module->panels['profiling']->data['messages'])) {
                $this->_models = Yii::getLogger()->calculateTimings($this->module->panels['profiling']->data['messages']);
            }
        }
        return $this->_models;
    }