public identifyClass ( |
||
$rid | ||
return | string |
public function identifyClass(Rid $rid)
{
$map = $this->getMap();
$splitRid = explode(':', ltrim($rid->getValue(), '#'));
$clusterId = $splitRid[0];
foreach ($map as $class => $clusters) {
if (in_array($clusterId, $clusters)) {
return $class;
}
}
throw MappingException::noClusterForRid($rid);
}
/** * @expectedException \Doctrine\ODM\OrientDB\Mapper\MappingException */ public function testIdentifyClassNotFound() { $binding = $this->createBinding(); $cache = $this->createCache(true); $clusterMap = new ClusterMap($binding, $cache); $clusterMap->identifyClass(new Rid('10:0')); }