src/Autoload.php
public function getObjectFile(string $objectName): ?string
    {
        // user service objects
        if (0 === strpos($objectName, self::NAMESPACE_APP_SERVICE)) {
            $objectBase = $this->getObjectBase($objectName);
            if ($objectBase == self::SERVICE_NAME_MAIN || $objectBase == self::SERVICE_NAME_FAIL) {
                $objectFile = sprintf('%s/app/service/_default/%s/%s.php',
                    $this->appDir, $objectBase, $objectBase);
            } else {
                $objectFile = sprintf('%s/app/service/%s/%s.php',
                    $this->appDir, $objectBase, $objectBase);
            }

            return $this->fixSlashes($objectFile);
        }

        // user model objects
        if (0 === strpos($objectName, self::NAMESPACE_APP_DATABASE) && 'Model' === substr($objectName, -5)) {
            $objectBase = $this->getObjectBase(substr($objectName, 0, -5 /* strlen('Model') */) . 'Service');
            if ($objectBase == self::SERVICE_NAME_MAIN || $objectBase == self::SERVICE_NAME_FAIL) {
                $objectFile = sprintf('%s/app/service/_default/%s/model/model.php',
                    $this->appDir, $objectBase);
            } else {
                $objectFile = sprintf('%s/app/service/%s/model/model.php',
                    $this->appDir, $objectBase);
            }

            return $this->fixSlashes($objectFile);
        }

        // user library objects
        if (0 === strpos($objectName, self::NAMESPACE_APP_LIBRARY)) {
            return $this->fixSlashes(sprintf('%s/app/library/%s.php',
                $this->appDir, $this->getObjectBase($objectName, false)));
        }

        return null;
    }
public function getObjectFile(string $objectName): ?string
    {
        // user service objects
        if (0 === strpos($objectName, self::NAMESPACE_APP_SERVICE)) {
            $objectBase = $this->getObjectBase($objectName);
            if ($objectBase == self::SERVICE_NAME_MAIN || $objectBase == self::SERVICE_NAME_FAIL) {
                $objectFile = sprintf('%s/app/service/_default/%s/%s.php',
                    $this->appDir, $objectBase, $objectBase);
            } else {
                $objectFile = sprintf('%s/app/service/%s/%s.php',
                    $this->appDir, $objectBase, $objectBase);
            }

            return $this->fixSlashes($objectFile);
        }

        // user model objects
        if (0 === strpos($objectName, self::NAMESPACE_APP_DATABASE) && 'Model' === substr($objectName, -5)) {
            $objectBase = $this->getObjectBase(substr($objectName, 0, -5 /* strlen('Model') */) . 'Service');
            if ($objectBase == self::SERVICE_NAME_MAIN || $objectBase == self::SERVICE_NAME_FAIL) {
                $objectFile = sprintf('%s/app/service/_default/%s/model/model.php',
                    $this->appDir, $objectBase);
            } else {
                $objectFile = sprintf('%s/app/service/%s/model/model.php',
                    $this->appDir, $objectBase);
            }

            return $this->fixSlashes($objectFile);
        }

        // user library objects
        if (0 === strpos($objectName, self::NAMESPACE_APP_LIBRARY)) {
            return $this->fixSlashes(sprintf('%s/app/library/%s.php',
                $this->appDir, $this->getObjectBase($objectName, false)));
        }

        return null;
    }
public function getObjectFile ( string $ objectName ) : ? string { // user service objects if ( 0 === strpos ( $ objectName , self :: NAMESPACE_APP_SERVICE ) ) { $ objectBase = $ this -> getObjectBase ( $ objectName ) ; if ( $ objectBase == self :: SERVICE_NAME_MAIN || $ objectBase == self :: SERVICE_NAME_FAIL ) { $ objectFile = sprintf ( '%s/app/service/_default/%s/%s.php' , $ this -> appDir , $ objectBase , $ objectBase ) ; } else { $ objectFile = sprintf ( '%s/app/service/%s/%s.php' , $ this -> appDir , $ objectBase , $ objectBase ) ; } return $ this -> fixSlashes ( $ objectFile ) ; } // user model objects if ( 0 === strpos ( $ objectName , self :: NAMESPACE_APP_DATABASE ) && 'Model' === substr ( $ objectName , - 5 ) ) { $ objectBase = $ this -> getObjectBase ( substr ( $ objectName , 0 , - 5 /* strlen('Model') */ ) . 'Service' ) ; if ( $ objectBase == self :: SERVICE_NAME_MAIN || $ objectBase == self :: SERVICE_NAME_FAIL ) { $ objectFile = sprintf ( '%s/app/service/_default/%s/model/model.php' , $ this -> appDir , $ objectBase ) ; } else { $ objectFile = sprintf ( '%s/app/service/%s/model/model.php' , $ this -> appDir , $ objectBase ) ; } return $ this -> fixSlashes ( $ objectFile ) ; } // user library objects if ( 0 === strpos ( $ objectName , self :: NAMESPACE_APP_LIBRARY ) ) { return $ this -> fixSlashes ( sprintf ( '%s/app/library/%s.php' , $ this -> appDir , $ this -> getObjectBase ( $ objectName , false ) ) ) ; } return null ; }
Get object file.
@param  string $objectName
@return ?string
Get object file .