You cannot use the ActiveRecord class without the whole structure. ActiveRecord is not an independent class and relies heavily on other components of the structure, for example. database, cache, schema, etc.
The extraction process will be more like trying to re-implement the infrastructure components needed for the class to function.
If you are interested in ORM mechanisms and Yii structure validations, I believe that you should delve into the yii kernel and create your own ActiveRecord class that implements ORM + validation.
Hope this answers your question.
source share