public function EasyRdf_Graph::setType

Change the rdf:type property for a resource

Note that if the resource object has already previously been created, then the PHP class of the resource will not change.

Parameters

string $resource The resource to change the type of:

string $type The new type (e.g. foaf:Person):

Return value

integer The number of types added

File

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

Class

EasyRdf_Graph
Container for collection of EasyRdf_Resources.

Code

public function setType($resource, $type) {
  $this
    ->checkResourceParam($resource, true);
  $this
    ->delete($resource, 'rdf:type');
  return $this
    ->addType($resource, $type);
}