Returns array of profiling models that can be used in a data provider.
@return array models
19798
protected function getModels()
    {
        if ($this->_models === null) {
            $this->_models = [];
            $timings = Yii::getLogger()->calculateTimings(isset($this->data['messages']) ? $this->data['messages'] : []);

            foreach ($timings as $seq => $profileTiming) {
                $this->_models[] = [
                    'duration' => $profileTiming['duration'] * 1000, // in milliseconds
                    'category' => $profileTiming['category'],
                    'info' => $profileTiming['info'],
                    'level' => $profileTiming['level'],
                    'timestamp' => $profileTiming['timestamp'] * 1000, //in milliseconds
                    'seq' => $seq,
                ];
            }
        }

        return $this->_models;
    }
635487
public function getStatisticsServices():array
    {

        $services = $this->getAllServices();
        $counter = 0;
        $senable = 0;

        foreach ($services as $val) {
            if ($val->status == "enabled") {
                $senable++;
            }

            $counter++;
        }

        return (array("number" => $counter, "enabled" => $senable));
    }
930548
public static function findAllInstances()
    {
        $ret = array();
        $modelProviders = Kwf_Config::getValueArray('modelProviders');
        foreach ($modelProviders as $modelProvider) {
            if ($modelProvider) {
                $modelProvider = new $modelProvider;
                $ret = array_merge($modelProvider->findModels(), $ret);
            }
        }
        $ret = array_unique($ret, SORT_REGULAR);
        return $ret;
    }
249076
protected static function getModelTypes()
    {
        $class = get_called_class();

        if($class::$useType === false) {
            return array();
        }

        $class_name = $class::getClassName(false);
        $parent = get_parent_class($class);
        if ($parent) {
            $names_parent = $parent::getModelTypes();
            $names = array_merge($names_parent, array($class_name));
        } else {
            $names = array();
        }

        return $names;

    }
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;
    }
528811
protected function modelToYamlArray()
    {
        return [
            'name' => $this->name,
            'description' => $this->description,
            'author' => $this->author,
            'icon' => $this->icon,
            'homepage' => $this->homepage
        ];
    }
1079663
public function getMyProfiles() {
      $response = $this->client->request('get', 'getMyProfiles');
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
      ];
   }
1062371
public function providers()
    {
        return collect($this->getManifest())->flatMap(function ($configuration) {
            return (array) ($configuration['providers'] ? $configuration['providers'] : []);
        })->filter()->all();
    }
924176
protected function getProviders()
    {
        if (is_null($this->providers)) {
            $this->providers = array();
            if ($this->hasOption(self::OPTION_PROVIDERS)) {
                foreach ($this->getOption(self::OPTION_PROVIDERS) as $provider) {
                    if ($provider instanceof ServiceLocatorAwareInterface) {
                        $provider->setServiceLocator($this->getServiceLocator());
                    }
                    $this->providers[] = $provider;
                }
            }
        }
        return $this->providers;
    }
1056944
public function getManagedModels()
    {
        $models = $this->getVersionedModels();

        // Normalize models to have their model class in array key and all names as the value are uppercased
        foreach ($models as $k => $v) {
            $archivedModels[$v] = array('title' => ucfirst(singleton($v)->i18n_plural_name()));
            unset($archivedModels[$k]);
        }

        return $archivedModels;
    }
181284
public function getProfiler() {
		if ($this->_profiler === null) {
			$this->_profiler = new Profiler();
			$this->onProfilerInit($this->_profiler);
		}
		
		return $this->_profiler;
	}
984381
public static function getUpdatableModelIds() {
        $model = ModelManager::getModel();
        if (!$model instanceof self) {
            throw new common_exception_Error(__FUNCTION__.' called on '.get_class($model).' model implementation');
        }
        return $model->getWritableModels();
    }
1013741
protected function getConnectionData()
	{
		return [$this->associativeLocal => $this->model->getPkValue(), $this->shifter => strtolower($this->model->getModelName())];
	}
410583
public function getModel()
    {
        if ($this->batch) {
            $model = $this->batch->getVariable('model');
        } else {
            $model = $this->_session->model;
        }
        if (is_array($model)) {
            if ($this->modelId && isset($model['surveys'][$this->modelId])) {
                $currentFilter = $model['filter'];
                $currentFilter['gto_id_survey'] = $this->modelId;
                $data = $model['data'];
                $sort = $model['sort'];
                $model = $this->getAnswerModel($currentFilter, $data, $sort);
            } else {
                return false;
                //$model = false;
            }
        }

        $this->model = $model;

        if ($this->model->getMeta('exportPreprocess') === null) {
            $this->preprocessModel();
            $this->model->setMeta('exportPreprocess', true);
        }

        return $this->model;
    }
112273
public function getTypes()
    {
        return array_reduce(
            $this->_models,
            function ($result, $item) {
                $result[$item['type']] = $item['type'];
                return $result;
            },
            []
        );
    }
518382
public static function getAllEntityDescriptors() {
		$entities = array();
		foreach( static::getAllEntities() as $entity ) {
			$entities[$entity] = EntityDescriptor::load($entity);
		}
		return $entities;
	}
1118555
public static function list_models() {
        cli_heading("List of models");
        echo str_pad(get_string('modelid', 'tool_analytics'), 15, ' ') . ' ' . str_pad(get_string('name'), 50, ' ') .
            ' ' . str_pad(get_string('status'), 15, ' ') . "\n";
        $models = \core_analytics\manager::get_all_models();
        foreach ($models as $model) {
            $modelid = $model->get_id();
            $isenabled = $model->is_enabled() ? get_string('enabled', 'tool_analytics') : get_string('disabled', 'tool_analytics');
            $name = $model->get_name();
            echo str_pad($modelid, 15, ' ') . ' ' . str_pad($name, 50, ' ') . ' ' . str_pad($isenabled, 15, ' ') . "\n";
        }
    }