Property | 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. |
Method | Description | |
---|---|---|
createdAtTimestamp ( mixed | null $value ) : |
Prepares the field to be the datetime that the document has been created. | |
objectId ( mixed $value = null ) : |
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 ( ) : |
Prepares the field to be now. |
public createdAtTimestamp ( mixed | null $value ) : |
||
$value | mixed | null | Value that will be evaluated. |
return |
public updatedAtTimestamp ( ) : |
||
return |
public string $collection | ||
return | string |
public bool $dynamic | ||
return | boolean |
public string $entityClass | ||
return | string |