If there is an extension that defines a model class that gets used by controllers and view files within the extension, how could I extend this class with Yii means in my application?
E.g. there could be an extension ‘product-management’ that defines a model (ActiveRecord) ‘Product’ that has some basic features. There is a controller with view files. Now in my application I’d like to enrich (that uses the extension) this class with new properties and validation rules, relations and maybe some further functions.
I see here different challenges: Where should the object creation take place? Can I enrich the view files? Can I use the controller in the extension if it does not need to be changed?
Is a factory the right pattern? Could I use behaviours anyhow? Should I override everything in the extension? What would be a sound solution for this issue?
And does the extension need to be prepared for such things?
I hope someone has any hints… Thanks!