Rev 1119 | Rev 1162 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1119 | Rev 1121 | ||
---|---|---|---|
Line 367... | Line 367... | ||
367 | $asn_ids = array(); |
367 | $asn_ids = array(); |
368 | $res_asn = OIDplus::db()->query("select * from ###asn1id where oid = ? order by lfd", array("oid:".$this->oid)); |
368 | $res_asn = OIDplus::db()->query("select * from ###asn1id where oid = ? order by lfd", array("oid:".$this->oid)); |
369 | while ($row_asn = $res_asn->fetch_array()) { |
369 | while ($row_asn = $res_asn->fetch_array()) { |
370 | $name = $row_asn['name']; |
370 | $name = $row_asn['name']; |
371 | $standardized = $row_asn['standardized'] ?? false; |
371 | $standardized = $row_asn['standardized'] ?? false; |
372 | $well_known = $row_asn['well_known']; |
372 | $well_known = $row_asn['well_known'] ?? false; |
373 | $asn_ids[] = new OIDplusOidAsn1Id($name, $standardized, $well_known); |
373 | $asn_ids[] = new OIDplusOidAsn1Id($name, $standardized, $well_known); |
374 | } |
374 | } |
375 | return $asn_ids; |
375 | return $asn_ids; |
376 | } |
376 | } |
377 | 377 | ||
Line 383... | Line 383... | ||
383 | $iri_ids = array(); |
383 | $iri_ids = array(); |
384 | $res_iri = OIDplus::db()->query("select * from ###iri where oid = ? order by lfd", array("oid:".$this->oid)); |
384 | $res_iri = OIDplus::db()->query("select * from ###iri where oid = ? order by lfd", array("oid:".$this->oid)); |
385 | while ($row_iri = $res_iri->fetch_array()) { |
385 | while ($row_iri = $res_iri->fetch_array()) { |
386 | $name = $row_iri['name']; |
386 | $name = $row_iri['name']; |
387 | $longarc = $row_iri['longarc'] ?? false; |
387 | $longarc = $row_iri['longarc'] ?? false; |
388 | $well_known = $row_iri['well_known']; |
388 | $well_known = $row_iri['well_known'] ?? false; |
389 | $iri_ids[] = new OIDplusOidIri($name, $longarc, $well_known); |
389 | $iri_ids[] = new OIDplusOidIri($name, $longarc, $well_known); |
390 | } |
390 | } |
391 | return $iri_ids; |
391 | return $iri_ids; |
392 | } |
392 | } |
393 | 393 | ||
394 | /** |
394 | /** |
395 | * @param OIDplusOid|null $parent |
395 | * @param OIDplusOid|null $parent |
396 | * @param $separator |
396 | * @param string $separator |
397 | * @return string |
397 | * @return string |
398 | * @throws OIDplusException |
398 | * @throws OIDplusException |
399 | */ |
399 | */ |
400 | public function viewGetArcAsn1s(OIDplusOid $parent=null, $separator = ' | '): string { |
400 | public function viewGetArcAsn1s(OIDplusOid $parent=null, string $separator = ' | '): string { |
401 | $asn_ids = array(); |
401 | $asn_ids = array(); |
402 | 402 | ||
403 | if (is_null($parent)) $parent = OIDplusOid::parse(self::root()); |
403 | if (is_null($parent)) $parent = OIDplusOid::parse(self::root()); |
404 | 404 | ||
405 | $part = $this->deltaDotNotation($parent); |
405 | $part = $this->deltaDotNotation($parent); |
Line 619... | Line 619... | ||
619 | * @param $to |
619 | * @param $to |
620 | * @return int|null |
620 | * @return int|null |
621 | */ |
621 | */ |
622 | public function distance($to) { |
622 | public function distance($to) { |
623 | if (!is_object($to)) $to = OIDplusObject::parse($to); |
623 | if (!is_object($to)) $to = OIDplusObject::parse($to); |
- | 624 | if (!$to) return null; |
|
624 | if (!($to instanceof $this)) return null; |
625 | if (!($to instanceof $this)) return null; |
625 | $res = oid_distance($to->oid, $this->oid); |
626 | $res = oid_distance($to->oid, $this->oid); |
626 | return $res !== false ? $res : null; |
627 | return $res !== false ? $res : null; |
627 | } |
628 | } |
628 | 629 |