PHP 클래스 Mongolid\Schema\Schema

파일 보기 프로젝트 열기: leroy-merlin-br/mongolid

공개 프로퍼티들

프로퍼티 타입 설명
$collection string Name of the collection where this kind of document is going to be saved or retrieved from.
$dynamic boolean The $dynamic property tells if the schema will accept additional fields that are not specified in the $fields property. This is useful if you does not have a strict document format or if you want to take full advantage of the "schemaless" nature of MongoDB.
$entityClass string Name of the class that will be used to represent a document of this Schema when retrieve from the database.
$fields string[] The last option is to define a field as another schema by using the syntax 'schema.' This represents an embedded document (or sub-document).

공개 메소드들

메소드 설명
createdAtTimestamp ( mixed | null $value ) : UTCDateTime Prepares the field to be the datetime that the document has been created.
objectId ( mixed $value = null ) : ObjectID | mixed Filters any field in the $fields that has it's value specified as a 'objectId'. It will wraps the $value, if any, into a ObjectID object.
sequence ( integer $value = null ) : integer Prepares the field to have a sequence. If $value is zero or not defined a new auto-increment number will be "generated" for the collection of the schema. The sequence generation is done by the SequenceService.
updatedAtTimestamp ( ) : UTCDateTime Prepares the field to be now.

메소드 상세

createdAtTimestamp() 공개 메소드

Prepares the field to be the datetime that the document has been created.
public createdAtTimestamp ( mixed | null $value ) : UTCDateTime
$value mixed | null Value that will be evaluated.
리턴 Mongolid\Serializer\Type\UTCDateTime

objectId() 공개 메소드

Filters any field in the $fields that has it's value specified as a 'objectId'. It will wraps the $value, if any, into a ObjectID object.
public objectId ( mixed $value = null ) : ObjectID | mixed
$value mixed Value that may be converted to ObjectID.
리턴 Mongolid\Serializer\Type\ObjectID | mixed

sequence() 공개 메소드

Prepares the field to have a sequence. If $value is zero or not defined a new auto-increment number will be "generated" for the collection of the schema. The sequence generation is done by the SequenceService.
public sequence ( integer $value = null ) : integer
$value integer Value that will be evaluated.
리턴 integer

updatedAtTimestamp() 공개 메소드

Prepares the field to be now.
public updatedAtTimestamp ( ) : UTCDateTime
리턴 Mongolid\Serializer\Type\UTCDateTime

프로퍼티 상세

$collection 공개적으로 프로퍼티

Name of the collection where this kind of document is going to be saved or retrieved from.
public string $collection
리턴 string

$dynamic 공개적으로 프로퍼티

The $dynamic property tells if the schema will accept additional fields that are not specified in the $fields property. This is useful if you does not have a strict document format or if you want to take full advantage of the "schemaless" nature of MongoDB.
public bool $dynamic
리턴 boolean

$entityClass 공개적으로 프로퍼티

Name of the class that will be used to represent a document of this Schema when retrieve from the database.
public string $entityClass
리턴 string

$fields 공개적으로 프로퍼티

The last option is to define a field as another schema by using the syntax 'schema.' This represents an embedded document (or sub-document).
public string[] $fields
리턴 string[]