modler icon indicating copy to clipboard operation
modler copied to clipboard

Document property configuration settings

Open dan-bowen opened this issue 6 years ago • 2 comments

Hello,

I'm having trouble tracking down all the property configuration settings. As best I can tell here are the keys/values you can set.

class TestModel extends \Modler\Model
{
    protected $properties = array(
        'test' => array(
            'description' => 'Test Property 1'
            'type'        => 'varchar',       // what other values are allowed for type?
            'required'    => true|false,      // what other validation is built in?
            'guarded'     => true|false,
            ... // what other keys are built-in?
        )
    );
}

I was hoping the REAME could be updated too describe all the possible keys, values and meanings.

I also found a discrepancy in the README that says guard is used for guarding properties, but the code is actually using guarded. https://github.com/enygma/modler/blob/master/src/Modler/Model.php#L62

dan-bowen avatar Jul 08 '18 15:07 dan-bowen

Really the only ones that matter are when type is set to relation and when required is true. Other than that, the description and type (when not relation) are just informative.

enygma avatar Jul 08 '18 15:07 enygma

Hi Chris. Thanks for the response. My initial comment was submitted prematurely. I've updated it to explain more clearly. I guess I'm looking for documentation of all the possible keys and values that can be set on a property.

dan-bowen avatar Jul 08 '18 15:07 dan-bowen