public static function getReferencedOID($link) {
    preg_match_all("/([A-Za-z0-9]+(:[0-9]+)+)/", $link, $matches);
    if (sizeof($matches) > 0 && sizeof($matches[1]) > 0) {
      $oid = $matches[1][0];
      return ObjectId::parse($oid);
    }
    return null;
  }