Check if a resource is of the specified type
string $resource The resource to check the type of:
string $type The type to check (e.g. foaf:Person):
boolean True if resource is of specified type
public function isA($resource, $type) {
$this
->checkResourceParam($resource, true);
$type = EasyRdf_Namespace::expand($type);
foreach ($this
->all($resource, 'rdf:type', 'resource') as $t) {
if ($t
->getUri() == $type) {
return true;
}
}
return false;
}