PHP Class Mongolid\Schema\Schema

Afficher le fichier Open project: leroy-merlin-br/mongolid

Méthodes publiques

Свойство Type Description
$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).

Méthodes publiques

Méthode Description
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.

Method Details

createdAtTimestamp() public méthode

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.
Résultat Mongolid\Serializer\Type\UTCDateTime

objectId() public méthode

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.
Résultat Mongolid\Serializer\Type\ObjectID | mixed

sequence() public méthode

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.
Résultat integer

updatedAtTimestamp() public méthode

Prepares the field to be now.
public updatedAtTimestamp ( ) : UTCDateTime
Résultat Mongolid\Serializer\Type\UTCDateTime

Property Details

$collection public_oe property

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

$dynamic public_oe property

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
Résultat boolean

$entityClass public_oe property

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

$fields public_oe property

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
Résultat string[]