Minor refactoring to avoid deprecated function

This commit is contained in:
lukas committed 2026-10-22 09:07:16 +00:00
1 parent c4f5504fdf
commit bcfeedc703
1 file changed
+6 -6
+6 -6
View File
@@ -635,10 +635,10 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
*/ */
public function get($coid) { public function get($coid) {
if (is_string($coid)) if (is_string($coid))
return $this->getObject(new IRI($coid)); return $this->getObjectNode(new IRI($coid));
if (is_object($coid) && get_class($coid)=='ML\IRI\IRI') if (is_object($coid) && get_class($coid)=='ML\IRI\IRI')
return $this->getObject($coid); return $this->getObjectNode($coid);
throw new SDKException('COID must be passed as a string or an IRI object.'); throw new SDKException('COID must be passed as a string or an IRI object.');
} }
@@ -650,7 +650,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
* @param string $filename * @param string $filename
*/ */
public function getAttachment(IRI $coid, $filename) { public function getAttachment(IRI $coid, $filename) {
$object = $this->getObject($coid); $object = $this->getObjectNode($coid);
if (!$object) if (!$object)
// Cannot get attachment for non-existing object // Cannot get attachment for non-existing object
@@ -687,7 +687,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
} }
return $fileContent; return $fileContent ?? null;
} }
private function assertAuthenticatingNamespaceAndGetId() : IRI { private function assertAuthenticatingNamespaceAndGetId() : IRI {
@@ -709,7 +709,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
* @return Node * @return Node
*/ */
public function getAuthenticatingNamespaceObject() : ?Node { public function getAuthenticatingNamespaceObject() : ?Node {
return $this->getObject($this->assertAuthenticatingNamespaceAndGetId()); return $this->getObjectNode($this->assertAuthenticatingNamespaceAndGetId());
} }
/** /**
@@ -719,7 +719,7 @@ class ObjectRetriever implements CustomCacheAndLogInterface {
* @return Node * @return Node
*/ */
public function getAuthenticatingNamespaceObjectNode() : ?Node { public function getAuthenticatingNamespaceObjectNode() : ?Node {
return $this->getObject($this->assertAuthenticatingNamespaceAndGetId()); return $this->getObjectNode($this->assertAuthenticatingNamespaceAndGetId());
} }
/** /**