src/QueryParserCustomFields.php
protected function parseRelationParameters(array $unparsed): array
    {
        $parseRelationParameters = [];
        $modelNamespace = \Phalcon\Di::getDefault()->getConfig()->namespace->models;

        foreach ($unparsed as $model => $query) {
            $modelName = str_replace(' ', '', ucwords(str_replace('_', ' ', $model)));
            $modelName = $modelNamespace . '\\' . $modelName;

            if (!class_exists($modelName)) {
                throw new \Exception('Related model does not exist.');
            }

            $parseRelationParameters[$modelName] = $this->parseSearchParameters($query)['mapped'];
        }

        return $parseRelationParameters;
    }
protected function parseRelationParameters(array $unparsed): array
    {
        $parseRelationParameters = [];
        $modelNamespace = \Phalcon\Di::getDefault()->getConfig()->namespace->models;

        foreach ($unparsed as $model => $query) {
            $modelName = str_replace(' ', '', ucwords(str_replace('_', ' ', $model)));
            $modelName = $modelNamespace . '\\' . $modelName;

            if (!class_exists($modelName)) {
                throw new \Exception('Related model does not exist.');
            }

            $parseRelationParameters[$modelName] = $this->parseSearchParameters($query)['mapped'];
        }

        return $parseRelationParameters;
    }
protected function parseRelationParameters ( array $ unparsed ) : array { $ parseRelationParameters = [ ] ; $ modelNamespace = \ Phalcon \ Di :: getDefault ( ) -> getConfig ( ) -> namespace -> models ; foreach ( $ unparsed as $ model => $ query ) { $ modelName = str_replace ( ' ' , '' , ucwords ( str_replace ( '_' , ' ' , $ model ) ) ) ; $ modelName = $ modelNamespace . '\\' . $ modelName ; if ( ! class_exists ( $ modelName ) ) { throw new \ Exception ( 'Related model does not exist.' ) ; } $ parseRelationParameters [ $ modelName ] = $ this -> parseSearchParameters ( $ query ) [ 'mapped' ] ; } return $ parseRelationParameters ; }
Parse relationship query parameters

@param  array $unparsed

@return array
Parse relationship query parameters