public static function fetchDocument( $name, $id )
    {
        // Check if a document with the given name exists.
        if ( !isset( self::$documents[$name] ) )
        {
            throw new phpillowNoSuchPropertyException( $name );
        }

        // Instantiate and return document.
        $className = self::$documents[$name];
        $document  = new $className();
        return $document->fetchById( $id );
    }
public static function fetchDocument( $name, $id )
    {
        // Check if a document with the given name exists.
        if ( !isset( self::$documents[$name] ) )
        {
            throw new phpillowNoSuchPropertyException( $name );
        }

        // Instantiate and return document.
        $className = self::$documents[$name];
        $document  = new $className();
        return $document->fetchById( $id );
    }
public static function fetchDocument ( $ name , $ id ) { // Check if a document with the given name exists. if ( ! isset ( self :: $ documents [ $ name ] ) ) { throw new phpillowNoSuchPropertyException ( $ name ) ; } // Instantiate and return document. $ className = self :: $ documents [ $ name ] ; $ document = new $ className ( ) ; return $ document -> fetchById ( $ id ) ; }
Fetch document by ID

Fetch the document of the given type with the given ID. Throws a
phpillowNoSuchPropertyException if the document does not exist.

@param string $name
@param string $id
@return phpillowDocument
Fetch document by ID