public function loadModel($modelClass = null, $modelType = null)
    {
        if ($modelClass === null) {
            $modelClass = $this->modelClass;
        }
        if ($modelType === null) {
            $modelType = $this->getModelType();

            if ($modelType === null) {
                throw new UnexpectedValueException('No model type has been defined');
            }
        }

        list(, $alias) = pluginSplit($modelClass, true);

        if (isset($this->{$alias})) {
            return $this->{$alias};
        }

        if (isset($this->_modelFactories[$modelType])) {
            $factory = $this->_modelFactories[$modelType];
        }
        if (!isset($factory)) {
            $factory = FactoryLocator::get($modelType);
        }
        $this->{$alias} = $factory($modelClass);
        if (!$this->{$alias}) {
            throw new MissingModelException([$modelClass, $modelType]);
        }

        return $this->{$alias};
    }