You are here

public function EasyRdf_Resource::addResource in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php \EasyRdf_Resource::addResource()

Add a resource as a property of the resource

Example: $bob->add('foaf:knows', 'http://example.com/alice');

Parameters

mixed $property The property name:

mixed $resource2 The resource to be the value of the property:

Return value

integer The number of values added (1 or 0)

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php, line 324

Class

EasyRdf_Resource
Class that represents an RDF resource

Code

public function addResource($property, $resource2) {
  $this
    ->checkHasGraph();
  return $this->graph
    ->addResource($this->uri, $property, $resource2);
}