src/League/Monga/Database.php
public function getRef($reference)
    {
        $array = ! isset($reference['$ref']);
        $reference = $array ? $reference : [$reference];
        $database = $this->database;

        $result = array_map(
            function ($ref) use ($database) {
                return MongoDBRef::get($database, $ref);
            },
            $reference
        );

        return $array ? $result : reset($result);
    }
public function getRef($reference)
    {
        $array = ! isset($reference['$ref']);
        $reference = $array ? $reference : [$reference];
        $database = $this->database;

        $result = array_map(
            function ($ref) use ($database) {
                return MongoDBRef::get($database, $ref);
            },
            $reference
        );

        return $array ? $result : reset($result);
    }
public function getRef ( $ reference ) { $ array = ! isset ( $ reference [ '$ref' ] ) ; $ reference = $ array ? $ reference : [ $ reference ] ; $ database = $ this -> database ; $ result = array_map ( function ( $ ref ) use ( $ database ) { return MongoDBRef :: get ( $ database , $ ref ) ; } , $ reference ) ; return $ array ? $ result : reset ( $ result ) ; }
Retrieve one or more references from the database.

@param object|array $reference one or more references

@return array one or more documents
Retrieve one or more references from the database .