public function resolveModel($collectionName)
    {
        if (!array_key_exists($collectionName, $this->map)) {
            throw new CannotResolveModelException($collectionName);
        }
        $modelClassName = $this->map[$collectionName];
        try {
            if (!array_key_exists($modelClassName, $this->modelInstances)) {
                $reflectionClass = new \ReflectionClass($modelClassName);
                $modelInstance = $reflectionClass->newInstance();
                $this->modelInstances[$modelClassName] = $modelInstance;
            }
            return $this->modelInstances[$modelClassName];
        } catch (\Exception $e) {
            throw new CannotResolveModelException($collectionName);
        }
    }
public function resolveModel($collectionName)
    {
        if (!array_key_exists($collectionName, $this->map)) {
            throw new CannotResolveModelException($collectionName);
        }
        $modelClassName = $this->map[$collectionName];
        try {
            if (!array_key_exists($modelClassName, $this->modelInstances)) {
                $reflectionClass = new \ReflectionClass($modelClassName);
                $modelInstance = $reflectionClass->newInstance();
                $this->modelInstances[$modelClassName] = $modelInstance;
            }
            return $this->modelInstances[$modelClassName];
        } catch (\Exception $e) {
            throw new CannotResolveModelException($collectionName);
        }
    }
public function resolveModel ( $ collectionName ) { if ( ! array_key_exists ( $ collectionName , $ this -> map ) ) { throw new CannotResolveModelException ( $ collectionName ) ; } $ modelClassName = $ this -> map [ $ collectionName ] ; try { if ( ! array_key_exists ( $ modelClassName , $ this -> modelInstances ) ) { $ reflectionClass = new \ ReflectionClass ( $ modelClassName ) ; $ modelInstance = $ reflectionClass -> newInstance ( ) ; $ this -> modelInstances [ $ modelClassName ] = $ modelInstance ; } return $ this -> modelInstances [ $ modelClassName ] ; } catch ( \ Exception $ e ) { throw new CannotResolveModelException ( $ collectionName ) ; } }
Resolves model class name for given collection name

@param string $collectionName
@throws CannotResolveModelException
@return object
Resolves model class name for given collection name