private function prepareCursor(BaseCommandCursor $cursor) { $class = null; if ($this->hydrationClass) { $class = $this->dm->getClassMetadata($this->hydrationClass); } return new CommandCursor($cursor, $this->dm->getUnitOfWork(), $class); }