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
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 34
static array
create(Model $model, array $functions)
Creates a generic CRUD interface for a Model
at line 354
static Method
generateCountMethod(ModelCollection $modelCollection)
Wrapper for "count_all" - this will NOT apply any read/write checks
at line 377
static Method
generateCreateMethod(Model $model, array|null $editableProperties = null)
No description
at line 589
static Method
generateDeleteAllMethod(ModelCollection $modelCollection)
Will delete all models in batch. Does NOT perform access check
at line 525
static Method
generateDeleteMethod(ModelCollection $modelCollection)
Wrapper for $model->delete() - will perform can_write check
at line 214
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 279
static Method
generateReadMethod(ModelCollection $modelCollection, array|null $exposedProperties = null)
Wrapper for "model->find_all_by_id()" - Will perform can_read() Check
at line 450
static Method
generateUpdateMethod(ModelCollection $modelCollection, array|null $updatableProperties = null)
Wrapper for Model Update, will check can_write() before update
at line 146
static protected array
sanitizeInputArrayByType(array $inputData, array $schema)
Cleans/Sanitizes $value based in the datatype in the schema definition
at line 161
static protected array|float|int|string|null
sanitizeInputByType($input, string $schemaType)
Cleans/Sanitizes value based in the datatype in the schemaType
at line 105
static protected string
translatePropertyType(string $dbType)
Translates between webservice and database types