ModelCRUD
class ModelCRUD
Helper class to define webservice methods.
Constants
| DEFAULT_EXCLUDE_PROPERTIES |
|
| WRITE_EXCLUDE_PROPERTIES |
|
Methods
Wrapper for "count_all" - this will NOT apply any read/write checks
No description
Will delete all models in batch. Does NOT perform access check
Wrapper for $model->delete() - will perform can_write check
Wrapper for "$modelCollection->all()" will not perform rights checks, you can pass a scoped collection which implies your rights
Wrapper for "model->find_all_by_id()" - Will perform can_read() Check
Wrapper for Model Update, will check can_write() before update
Cleans/Sanitizes $value based in the datatype in the schema definition
Cleans/Sanitizes value based in the datatype in the schemaType
Translates between webservice and database types
Details
at line 37
static array
create(Model $model, array $functions)
Creates a generic CRUD interface for a Model
at line 391
static Method
generateCountMethod(ModelCollection $modelCollection)
Wrapper for "count_all" - this will NOT apply any read/write checks
at line 413
static Method
generateCreateMethod(Model $model, array|null $editableProperties = null, bool|null $uuidIdentifaction = null)
No description
at line 692
static Method
generateDeleteAllMethod(ModelCollection $modelCollection)
Will delete all models in batch. Does NOT perform access check
at line 611
static Method
generateDeleteMethod(ModelCollection $modelCollection, bool|null $uuidIdentifaction = null)
Wrapper for $model->delete() - will perform can_write check
at line 235
static Method
generateReadAllMethod(ModelCollection $modelCollection, array|null $exposedProperties = null, array|null $scopedProperties = null)
Wrapper for "$modelCollection->all()" will not perform rights checks, you can pass a scoped collection which implies your rights
at line 300
static Method
generateReadMethod(ModelCollection $modelCollection, array|null $exposedProperties = null, bool|null $uuidIdentifaction = null)
Wrapper for "model->find_all_by_id()" - Will perform can_read() Check
at line 502
static ModelMethod
generateUpdateMethod(ModelCollection $modelCollection, array|null $updatableProperties = null, bool|null $uuidIdentifaction = null)
Wrapper for Model Update, will check can_write() before update
at line 149
static protected array
sanitizeInputArrayByType(array $inputData, array $schema)
Cleans/Sanitizes $value based in the datatype in the schema definition
at line 168
static protected array|float|int|string|null
sanitizeInputByType(mixed $input, string $schemaType)
Cleans/Sanitizes value based in the datatype in the schemaType
at line 108
static protected string
translatePropertyType(string $dbType)
Translates between webservice and database types