Returns the list of all the models that extend the PModel in the current
app.

@return Model[]

@throws \Eddmash\PowerOrm\Exception\AppRegistryNotReady
502709
public function getModels($includeAutoCreated = false, $app = null): array
    {
        $this->isAppReady();

        if ($includeAutoCreated && is_null($app)) {
            return $this->allModels;
        }

        if (!is_null($app)) {
            $appModels = $this->appModels[$app];
            if (!$includeAutoCreated) {
                $rModels = [];
                foreach ($appModels as $name => $appModel) {
                    if (!$appModel->getMeta()->autoCreated) {
                        $rModels[$name] = $appModel;
                    }
                }
                $appModels = $rModels;
            }

            return $appModels;
        }

        $rModels = [];
        /** @var $model Model */
        foreach ($this->allModels as $name => $model) {
            if (!$includeAutoCreated && $model->getMeta()->autoCreated) {
                continue;
            }
            $rModels[$name] = $model;
        }

        return $rModels;
    }
592312
public function extend() 
    {
        return [
            "creationFeeSink" => $this->creationFeeSink()->address()->toClean(),
            "creationFee" => Fee::MOSAIC_DEFINITION,
            "mosaicDefinition" => $this->mosaicDefinition()->toDTO(),
            // transaction type specialization
            "type"      => TransactionType::MOSAIC_DEFINITION,
        ];
    }
1161252
public function getAll()
    {
        $result = $this->callService('GET', self::API_SHARE_LINK);

        return $result->getModels(models\FileSystem\ShareLink::class);
    }
1145273
protected function getModels()
    {
        if ($this->_models === null) {
            $this->_models = [];
            $timings = $this->calculateTimings();
            $duplicates = $this->countDuplicateQuery($timings);

            foreach ($timings as $seq => $dbTiming) {
                $this->_models[] = [
                    'type' => $this->getQueryType($dbTiming['info']),
                    'query' => $dbTiming['info'],
                    'duration' => ($dbTiming['duration'] * 1000), // in milliseconds
                    'trace' => $dbTiming['trace'],
                    'timestamp' => ($dbTiming['timestamp'] * 1000), // in milliseconds
                    'seq' => $seq,
                    'duplicate' => $duplicates[$dbTiming['info']],
                ];
            }
        }

        return $this->_models;
    }
101298
public function getList()
    {
        $objects = $this->manager->findAll();
        $this->addPaginationData($objects);
        $objects = $objects->getItems();
        if (empty($objects)) {
            $this->addInfoMessage(self::INFO_NO_ENTRIES_FOUND);
        }
        return $objects;
    }
1251176
public function getAll()
    {
        $result = $this->callService('GET', self::API_AIRMEDIA_RECEIVERS);

        return $result->getModels(models\AirMedia\AirMediaReceiver::class);
    }
947374
public function getModelsToLoad()
    {
        $returnValue = array();

		foreach ($this->getEnabledExtensions() as $ext) {
			$returnValue = array_merge($returnValue, $ext->getManifest()->getModels());
		}
		$returnValue = array_unique($returnValue);

        return (array) $returnValue;
    }
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;
    }
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;
    }
1184698
protected function getModelIds()
    {
        $ids = [];

        foreach ($this->models as $model) {
            /** @var ModelInterface $model */
            $ids[] = $model->getId();
        }

        return $ids;
    }
31009
public function getDeliveryChargeSpecs()
    {
        $aDeliveryChargeSpecs = [];
        $oDeliveryChargeSpecs = $this->getDeliveryList();
        foreach ($oDeliveryChargeSpecs as $oDeliveryChargeSpec) {
            if ($oDeliveryChargeSpec->oxdelivery__oxaddsumtype->value == "abs") {
                $oDelSets = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySetList::class);
                $oDelSets->loadRDFaDeliverySetList($oDeliveryChargeSpec->getId());
                $oDeliveryChargeSpec->deliverysetmethods = $oDelSets;
                $aDeliveryChargeSpecs[] = $oDeliveryChargeSpec;
            }
        }

        return $aDeliveryChargeSpecs;
    }
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;
    }
696030
public function loadModels()
    {
        if ($this->_loadModels === null) {
            $this->_loadModels = Nav::find()->indexBy('id')->where(['in', 'id', ArrayHelper::getColumn($this->data, 'nav_id')])->with(['properties.adminProperty'])->all();
        }
        
        return $this->_loadModels;
    }
831927
public function getLanguageModels() {
        $models = array();
        $ns = $this->localNs;
        
        $extensionPath = dirname(__FILE__) . '/../../../tao';
        $localesPath = $extensionPath . '/locales';
        
        if (@is_dir($localesPath) && @is_readable($localesPath)) {
            $localeDirectories = scandir($localesPath);
            
            foreach ($localeDirectories as $localeDir) {
                $path = $localesPath . '/' . $localeDir;
                if ($localeDir[0] != '.' && @is_dir($path)){
                    // Look if the lang.rdf can be read.
                    $languageModelFile = $path . '/lang.rdf';
                    if (@file_exists($languageModelFile) && @is_readable($languageModelFile)){
                        // Add this file to the returned values.
                        if (!isset($models[$ns])){
                            $models[$ns] = array();
                        }
                        
                        $models[$ns][] = $languageModelFile;
                    }
                }
            }
        
            return $models;
        }
        else{
            throw new tao_install_utils_Exception("Cannot read 'locales' directory in extenstion 'tao'.");
        }
    }
73879
public function getEager()
    {
        foreach (array_keys($this->dictionary) as $type) {
            $this->matchToMorphParents($type, $this->getResultsByType($type));
        }

        return $this->models;
    }
501409
private function adminModules()
    {
        $return = [];

        foreach ($this->app[ 'config' ]->get('modules.all') as $module) {
            $controller = '\\app\\'.$module.'\\Controller';

            if (!class_exists($controller)) {
                continue;
            }

            if (property_exists($controller, 'scaffoldAdmin') ||
                property_exists($controller, 'hasAdminView')) {
                $moduleInfo = [
                    'name' => $module,
                    'title' => Inflector::get()->titleize($module), ];

                if (property_exists($controller, 'properties')) {
                    $moduleInfo = array_replace($moduleInfo, $controller::$properties);
                }

                $return[] = $moduleInfo;
            }
        }

        return $return;
    }
1179304
public function findAll() {
    $dataConnection = $this->app->getDataConnection($this->connection);
    $foundObjects = $dataConnection->findAll($this->table, $this->readFields);
    $foundModels = array();
    if (is_array($foundObjects)) {
      foreach ($foundObjects as $foundObject) {
        /**
         * @var $model \MABI\Model
         */
        $model = call_user_func($this->modelClass . '::init', $this->app);
        $model->load($foundObject);
        $foundModels[] = $model;
      }
    }
    return $foundModels;
  }