src/Mongo/MongoService.php
public function newObject($collection)
    {
        /** @var MongoObject $obj */
        $obj =$this->container->get($this->classMap->getClassForResult($collection, []));
        $obj->setCollection($collection);

        return $obj;
    }
public function newObject($collection)
    {
        /** @var MongoObject $obj */
        $obj =$this->container->get($this->classMap->getClassForResult($collection, []));
        $obj->setCollection($collection);

        return $obj;
    }
public function newObject ( $ collection ) { /** @var MongoObject $obj */ $ obj = $ this -> container -> get ( $ this -> classMap -> getClassForResult ( $ collection , [ ] ) ) ; $ obj -> setCollection ( $ collection ) ; return $ obj ; }
conveniant method to create new instances
@param string $collection
@return MongoObject
@throws \MongoException
conveniant method to create new instances