fuel / orm

Fuel PHP Framework - Fuel v1.x ORM
http://fuelphp.com/docs/packages/orm/intro.html
151 stars 95 forks source link

Avoid to destroy the overridden settings #373

Closed takayukioda closed 9 years ago

takayukioda commented 9 years ago

Current orm will override settings by empty array, when $_properties were something like this.

$_properties = [
    0 => 'id',
    'id' => ['data_type', 'int'],
];

will became

$_properties = [
    'id' => [],
];

Order of the definition won't help to avoid this problem.

By this PR, orm will no longer destroy any overridden settings.

emlynwest commented 9 years ago

The definition of the properties you show there is incorrect. What you are describing is expected behaviour. If you want to avoid it then you can define the empty properties as an empty array:

$_properties = [
    'id' => [],
]
takayukioda commented 9 years ago

@stevewest Thank you for the reply and I understand your opinion. Though, some packages such as \Auth\Model\Auth_User have defined their properties not as an empty array but as a string. For those patterns, I think there is no way to override settings. Or is there any way to do so?