public function EasyRdf_Graph::setType in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Graph.php \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
- vendor/
easyrdf/ easyrdf/ lib/ EasyRdf/ Graph.php, line 1517
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);
}