MongoId::getInc PHP Method

getInc() public method

Gets the incremented value to create this id
public getInc ( ) : integer
return integer Returns the incremented value used to create this MongoId.
    public function getInc()
    {
        return hexdec(substr((string) $this->objectID, -6));
    }

Usage Example

 public function testCreateWithString()
 {
     $original = '54203e08d51d4a1f868b456e';
     $id = new \MongoId($original);
     $this->assertSame($original, (string) $id);
     $this->assertSame(9127278, $id->getInc());
     $this->assertSame(1411399176, $id->getTimestamp());
     $this->assertSame(34335, $id->getPID());
 }
All Usage Examples Of MongoId::getInc