tom-- / yii2-dynamic-ar

An extension to add NoSQL-like documents to Yii 2 Framework's Active Record ORM.
ISC License
57 stars 15 forks source link

Make getDirtyAttributes detect updated dynamic fields #15

Open djagya opened 8 years ago

djagya commented 8 years ago

Or at least just mark the field we use for dynamic fields as 'dirty'.

It will be useful in many places as for example in TimestampBehavior, that updates timestamps only if model has dirty attributes.

What do you think @tom-- ?

tom-- commented 8 years ago

I like the simpler option "mark the field we use for dynamic fields as 'dirty'."

The more specific case (distinguishing dirty and clean dynamic attributes in the tree of dyn attrs) seems complicated to implement and I'm not sure what value it has since MariaDB does not have a COLUMN_UPDATE() function and we don't use COLUMN_ADD to update individual dyn attrs.

djagya commented 8 years ago

@tom-- sounds good, I'll handle that