PHP Класс Mongolid\Schema\Schema

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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[]