Base active record class for Yii 2.0

(Sorry for posting this in the wrong place but I don’t have access to the 2.0 forum yet, apologies if this has been brought up before)

I notice recently that many of us are trying to create active record like functionality for things like mongo, solr, elastic search, redis, rest etc. Unfortunately because of the way the current CActiveRecord class is structured it means we each have to replicate the same methods and events e.g. populateRecord(), afterFind() etc independently unless we extend CActiveRecord directly (which is often not possible for various reasons). This is a lot of code duplication. For this reason, in Yii 2.0 I would like to see a BaseActiveRecord class that contains things like events and methods that are common to all types of active record but does not implement any find / update / insert / count / delete methods. Those methods can be left to the child classes.

I totally agree with you and yii should benefit from doctrine and use it as a standart as well.

I too agree on this. Have felt need of having ActiveRecord methods while creating custom auto generation forms via json feeds. Though, its not a big show stopper, however, having one base class would help build active records rapidly for other databases / custom search engines as pointed by @phpnode.