public static function get($db, $ref)
    {
        if (! static::isRef($ref)) {
            return null;
        }

        return $db->selectCollection($ref[static::$refKey])->findOne(['_id' => $ref[static::$idKey]]);
    }
public static function get($db, $ref)
    {
        if (! static::isRef($ref)) {
            return null;
        }

        return $db->selectCollection($ref[static::$refKey])->findOne(['_id' => $ref[static::$idKey]]);
    }
public static function get ( $ db , $ ref ) { if ( ! static :: isRef ( $ ref ) ) { return null ; } return $ db -> selectCollection ( $ ref [ static :: $ refKey ] ) -> findOne ( [ '_id' => $ ref [ static :: $ idKey ] ] ) ; }
Fetches the object pointed to by a reference
@link http://php.net/manual/en/mongodbref.get.php
@static
@param MongoDB $db Database to use
@param array $ref Reference to fetch
@return array|null Returns the document to which the reference refers or null if the document does not exist (the reference is broken)
Fetches the object pointed to by a reference