PHP 클래스 MongoId

상속: implements Serializable, implements Alcaeus\MongoDbAdapter\TypeInterface, implements JsonSerializable
파일 보기 프로젝트 열기: alcaeus/mongo-php-adapter 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $id = null ) Creates a new id
__get ( string $name ) : null | string
__isset ( string $name ) : boolean
__set ( string $name, mixed $value )
__set_state ( array $props ) : MongoId (PECL mongo >= 1.0.8) Create a dummy MongoId
__toString ( ) : string Returns a hexidecimal representation of this id
__unset ( string $name )
getHostname ( ) : string Gets the hostname being used for this machine's ids
getInc ( ) : integer Gets the incremented value to create this id
getPID ( ) : integer (PECL mongo >= 1.0.11) Gets the process ID
getTimestamp ( ) : integer (PECL mongo >= 1.0.1) Gets the number of seconds since the epoch that this id was created
isValid ( mixed $value ) : boolean Check if a value is a valid ObjectId
jsonSerialize ( ) : stdClass
serialize ( ) : string
toBSONType ( ) : MongoDB\BSON\ObjectID Converts this MongoId to the new BSON ObjectID type
unserialize ( string $serialized )

비공개 메소드들

메소드 설명
createObjectID ( $id )

메소드 상세

__construct() 공개 메소드

Creates a new id
public __construct ( string $id = null )
$id string [optional] A string to use as the id. Must be 24 hexidecimal characters. If an invalid string is passed to this constructor, the constructor will ignore it and create a new id value.

__get() 공개 메소드

public __get ( string $name ) : null | string
$name string
리턴 null | string

__isset() 공개 메소드

public __isset ( string $name ) : boolean
$name string
리턴 boolean

__set() 공개 메소드

public __set ( string $name, mixed $value )
$name string
$value mixed

__set_state() 공개 정적인 메소드

(PECL mongo >= 1.0.8) Create a dummy MongoId
public static __set_state ( array $props ) : MongoId
$props array

Theoretically, an array of properties used to create the new id. However, as MongoId instances have no properties, this is not used.

리턴 MongoId A new id with the value "000000000000000000000000".

__toString() 공개 메소드

Returns a hexidecimal representation of this id
public __toString ( ) : string
리턴 string

__unset() 공개 메소드

public __unset ( string $name )
$name string

getHostname() 공개 정적인 메소드

Gets the hostname being used for this machine's ids
public static getHostname ( ) : string
리턴 string

getInc() 공개 메소드

Gets the incremented value to create this id
public getInc ( ) : integer
리턴 integer Returns the incremented value used to create this MongoId.

getPID() 공개 메소드

(PECL mongo >= 1.0.11) Gets the process ID
public getPID ( ) : integer
리턴 integer Returns the PID of the MongoId.

getTimestamp() 공개 메소드

(PECL mongo >= 1.0.1) Gets the number of seconds since the epoch that this id was created
public getTimestamp ( ) : integer
리턴 integer

isValid() 공개 정적인 메소드

Check if a value is a valid ObjectId
public static isValid ( mixed $value ) : boolean
$value mixed The value to check for validity.
리턴 boolean

jsonSerialize() 공개 메소드

public jsonSerialize ( ) : stdClass
리턴 stdClass

serialize() 공개 메소드

public serialize ( ) : string
리턴 string

toBSONType() 공개 메소드

Converts this MongoId to the new BSON ObjectID type
public toBSONType ( ) : MongoDB\BSON\ObjectID
리턴 MongoDB\BSON\ObjectID

unserialize() 공개 메소드

public unserialize ( string $serialized )
$serialized string