Mongolid\Serializer\Type\ObjectID::convert PHP Method

convert() public method

public convert ( ) : MongoDB\BSON\ObjectID
return MongoDB\BSON\ObjectID
    public function convert()
    {
        return new MongoObjectID($this->objectIdString);
    }

Usage Example

 public function testShouldBeCastableToString()
 {
     $objectId = new ObjectID($this->mongoId);
     $this->assertSame((string) $this->mongoId, (string) $objectId->convert());
 }