Compare commits

..

2 Commits

View File

@@ -39,7 +39,11 @@ class CloudObject {
return $this; return $this;
} }
private function getReader() : NodeReader { /**
* Get the NodeReader used for this CloudObject.
* Returns a default NodeReader if non has been set.
*/
protected function getReader() : NodeReader {
if (!$this->reader) { if (!$this->reader) {
$this->reader = new NodeReader; $this->reader = new NodeReader;
} }
@@ -70,6 +74,13 @@ class CloudObject {
return $this->node; return $this->node;
} }
/**
* Checks if a property exists on this object.
*/
public function has($property) : bool {
return $this->getReader()->hasProperty($this->node, $property);
}
/** /**
* Get the value of a property as a string. * Get the value of a property as a string.
* If the property has multiple values, only the first is returned. * If the property has multiple values, only the first is returned.
@@ -133,7 +144,6 @@ class CloudObject {
return $this->retriever->getCloudObject($coid); return $this->retriever->getCloudObject($coid);
} }
/** /**
* Get the value of a property and, if it's a COID, retrieve the corresponding object node. * Get the value of a property and, if it's a COID, retrieve the corresponding object node.
*/ */