Skip to content

allow default values of attributes to be initialized in class  #1

Open
@Raaghu

Description

@Raaghu

Currently there is no way to set default values for fields ,
Enhance Model::create api to consider the value of field from $data argument only if present in $data , otherwise the value should be considered as the value of that field in the instance (can be null or any other value)

class A {

private $f1 = null; // default value is null, if schema does not allow null , then create should fail by throwing BadQueryException
private $f2 = "enabled"; // default value is enabled

// ..... 

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions