public function find($rid, $fetchPlan = '*:0')
{
$document = $this->getManager()->find($rid, $fetchPlan);
if (!$document) {
return null;
}
if ($this->contains($document)) {
return $document;
}
throw new Exception("You are asking to find record {$rid} through the repository {$this->getClassName()} " . "but the document belongs to another repository (" . get_class($document) . ")");
}