/trunk/includes/classes/OIDplusObject.class.php |
---|
372,7 → 372,7 |
// Get parent gives the next possible parent which is EXISTING in OIDplus |
// It does not give the immediate parent |
public function getParent() { |
public function getParent()/*: ?OIDplusObject*/ { |
if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) { |
$res = OIDplus::db()->query("select parent from ###objects where id = ?", array($this->nodeId())); |
if (!$res->any()) return null; |
400,10 → 400,9 |
$cur = $cur->one_up(); |
if (!$cur) return null; |
} while ($prev != $cur); |
} |
return null; |
} |
} |
public function getRaMail() { |
if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) { |
/trunk/plugins/viathinksoft/objectTypes/oid/OIDplusOid.class.php |
---|
278,6 → 278,30 |
} |
} |
public function getAsn1Ids() { |
$asn_ids = array(); |
$res_asn = OIDplus::db()->query("select * from ###asn1id where oid = ? order by lfd", array("oid:".$this->oid)); |
while ($row_asn = $res_asn->fetch_array()) { |
$name = $row_asn['name']; |
$standardized = $row_asn['standardized']; |
$well_known = $row_asn['well_known']; |
$asn_ids[] = new OIDplusOidAsn1Id($name, $standardized, $well_known); |
} |
return $asn_ids; |
} |
public function getIris() { |
$iri_ids = array(); |
$res_iri = OIDplus::db()->query("select * from ###iri where oid = ? order by lfd", array("oid:".$this->oid)); |
while ($row_iri = $res_iri->fetch_array()) { |
$name = $row_iri['name']; |
$longarc = $row_iri['longarc']; |
$well_known = $row_iri['well_known']; |
$iri_ids[] = new OIDplusOidIri($name, $longarc, $well_known); |
} |
return $iri_ids; |
} |
public function viewGetArcAsn1s(OIDplusOid $parent=null, $separator = ' | ') { |
$asn_ids = array(); |
286,9 → 310,9 |
$part = $this->deltaDotNotation($parent); |
if (strpos($part, '.') === false) { |
$res2 = OIDplus::db()->query("select name from ###asn1id where oid = ? order by lfd", array("oid:".$this->oid)); |
while ($row2 = $res2->fetch_array()) { |
$asn_ids[] = $row2['name'].'('.$part.')'; |
$asn_id_objs = $this->getAsn1Ids(); |
foreach ($asn_id_objs as $asn_id_obj) { |
$asn_ids[] = $asn_id_obj->getName().'('.$part.')'; |
} |
} |
/trunk/plugins/viathinksoft/objectTypes/oid/OIDplusOidAsn1Id.class.php |
---|
0,0 → 1,43 |
<?php |
/* |
* OIDplus 2.0 |
* Copyright 2019 - 2022 Daniel Marschall, ViaThinkSoft |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
*/ |
if (!defined('INSIDE_OIDPLUS')) die(); |
class OIDplusOidAsn1Id { |
private $name = ''; |
private $standardized = false; |
private $well_known = false; |
function __construct($name, $standardized, $well_known) { |
$this->name = $name; |
$this->standardized = $standardized; |
$this->well_known = $well_known; |
} |
function getName() { |
return $this->name; |
} |
function isStandardized() { |
return $this->standardized; |
} |
function isWellKnown() { |
return $this->well_known; |
} |
function __toString() { |
return $this->name; |
} |
} |
/trunk/plugins/viathinksoft/objectTypes/oid/OIDplusOidIri.class.php |
---|
0,0 → 1,43 |
<?php |
/* |
* OIDplus 2.0 |
* Copyright 2019 - 2022 Daniel Marschall, ViaThinkSoft |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
* You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
*/ |
if (!defined('INSIDE_OIDPLUS')) die(); |
class OIDplusOidIri { |
private $name = ''; |
private $longarc = false; |
private $well_known = false; |
function __construct($name, $longarc, $well_known) { |
$this->name = $name; |
$this->longarc = $longarc; |
$this->well_known = $well_known; |
} |
function getName() { |
return $this->name; |
} |
function isLongarc() { |
return $this->longarc; |
} |
function isWellKnown() { |
return $this->well_known; |
} |
function __toString() { |
return $this->name; |
} |
} |