public function __construct(PersistenceBuilder $pb, DocumentManager $dm, ClassMetadata $class)
{
$this->dp = $pb;
$this->dm = $dm;
$this->uow = $dm->getUnitOfWork();
$this->class = $class;
$this->documentName = $class->getName();
$this->collection = $dm->getDocumentCollection($class->name);
$this->cmd = $this->dm->getConfiguration()->getMongoCmd();
}