Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Class extends Class extends fActiveRecord

posted by connor 8 years ago

Does fActiveRecord behave well if class A extends class B extends fActiveRecord? This would be useful when several tables exist which are related to one another so that they should have common functions. I could not find any documentation of this scenario.

Another question, related, is how it is safest to define _ _ construct() within a subclass of fActiveRecord.


Ive sub-classed fActiveRecord quite a few times and Ive never run into any issues.

Overriding fActiveRecord::__construct() should be ok as long as you pass the key parameter to parent::__construct(). Often times though I will use the post::construct() hook instead of overriding __construct().

posted by wbond 8 years ago