Method |
Description |
|
__clone ( ) |
Cloning not allowed because cloning of object not clone related aggregates of this object, so
cloned object has links to original aggregates. This is difficult to handle. |
|
__construct ( array $data = null, boolean | true $notModified = true ) |
|
|
__get ( $name ) |
|
|
__isset ( $name ) |
|
|
__set ( string $name, mixed $value ) |
Handle setting params through public property |
|
addError ( string $fieldName, string $ruleName, string $message ) : Document |
Add validator error from validator classes and methods. This error
reset on every re-validation |
|
addErrors ( array $errors ) : Document |
Add errors |
|
addValidatorNamespace ( type $namespace ) : Document |
Add own namespace of validators |
|
append ( type $selector, type $value ) : Structure |
If field not exist - set value. |
|
apply ( ) |
Apply modified document fields as original |
|
clearErrors ( ) |
Clear triggered and validation errors |
|
clearTriggeredErrors ( ) : Document |
Remove custom errors |
|
get ( $selector ) |
|
|
getErrors ( ) : array |
get list of validation errors |
|
getModifiedFields ( ) |
|
|
getObject ( string $selector, string | callable $className = '\Sokil\Mongo\Structure' ) : object |
Get structure object from a document's value |
|
getObjectList ( string $selector, string | callable $className = '\Sokil\Mongo\Structure' ) : object |
Get list of structure objects from list of values in mongo document |
|
getOriginalData ( ) |
|
|
getScenario ( ) |
|
|
has ( $selector ) |
|
|
hasErrors ( ) |
|
|
isModified ( $selector = null ) |
|
|
isScenario ( $scenario ) |
|
|
isValid ( ) : boolean |
check if filled model params is valid |
|
jsonSerialize ( ) |
|
|
merge ( array $data ) : Structure |
Merge array to current structure with setting modification mark |
|
mergeUnmodified ( array $data ) : Structure |
Merge array to current structure without setting modification mark |
|
prepareToStore ( $value ) |
|
|
replace ( array $data ) |
Replace data of document with passed. |
|
reset ( ) |
Replace modified fields with original |
|
rules ( ) : array |
Validation rules |
|
set ( string $selector, mixed $value ) : Document |
Store value to specified selector in local cache |
|
setNoScenario ( ) |
|
|
setScenario ( $scenario ) |
|
|
toArray ( ) |
|
|
triggerError ( type $fieldName, type $ruleName, type $message ) : Document |
Add custom error which not reset after validation |
|
triggerErrors ( array $errors ) : Document |
Add custom errors |
|
unsetField ( $selector ) |
|
|