public function EasyRdf_Graph::set

Set a value for a property

The new value will replace the existing values for the property.

Parameters

string $resource The resource to set the property on:

string $property The name of the property (e.g. foaf:name):

mixed $value The value for the property:

Return value

integer The number of values added (1 or 0)

1 call to EasyRdf_Graph::set()
EasyRdf_Graph::__set in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php
Magic method to set the value for a property of the graph

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php, line 1027

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function set($resource, $property, $value) {
  $this
    ->checkResourceParam($resource);
  $this
    ->checkSinglePropertyParam($property, $inverse);
  $this
    ->checkValueParam($value);

  // Delete the old values
  $this
    ->delete($resource, $property);

  // Add the new values
  return $this
    ->add($resource, $property, $value);
}