src/Loader/Loader.php
public static function getModel($pModel, array $pFields = array())
    {
        $fileName  = strtolower($pModel);
        $className = $fileName . ModelInterface::APP_SUFFIX;

        if (Agl::isInitialized()) {
            $modelPath = APP_PATH
                         . Agl::APP_PHP_DIR
                         . ModelInterface::APP_PHP_DIR
                         . DS
                         . $fileName
                         . Agl::PHP_EXT;

            if (is_readable($modelPath)) {
                return self::getInstance($className, array($pModel, $pFields));
            } else {
                return new Model($pModel, $pFields);
            }
        } else {
            return new Model($pModel, $pFields);
        }
    }
public static function getModel($pModel, array $pFields = array())
    {
        $fileName  = strtolower($pModel);
        $className = $fileName . ModelInterface::APP_SUFFIX;

        if (Agl::isInitialized()) {
            $modelPath = APP_PATH
                         . Agl::APP_PHP_DIR
                         . ModelInterface::APP_PHP_DIR
                         . DS
                         . $fileName
                         . Agl::PHP_EXT;

            if (is_readable($modelPath)) {
                return self::getInstance($className, array($pModel, $pFields));
            } else {
                return new Model($pModel, $pFields);
            }
        } else {
            return new Model($pModel, $pFields);
        }
    }
public static function getModel ( $ pModel , array $ pFields = array ( ) ) { $ fileName = strtolower ( $ pModel ) ; $ className = $ fileName . ModelInterface :: APP_SUFFIX ; if ( Agl :: isInitialized ( ) ) { $ modelPath = APP_PATH . Agl :: APP_PHP_DIR . ModelInterface :: APP_PHP_DIR . DS . $ fileName . Agl :: PHP_EXT ; if ( is_readable ( $ modelPath ) ) { return self :: getInstance ( $ className , array ( $ pModel , $ pFields ) ) ; } else { return new Model ( $ pModel , $ pFields ) ; } } else { return new Model ( $ pModel , $ pFields ) ; } }
Return an instance of the requested model.

@param string $pModel
@param array $pFields Attributes to add to the item
@return mixed
Return an instance of the requested model .