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;
    }
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;
    }
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 ; }
Returns the list of all the models that extend the PModel in the current
app.

@return Model[]

@throws \Eddmash\PowerOrm\Exception\AppRegistryNotReady
Returns the list of all the models that extend the PModel in the current app .