Hw do i find the parenting class of a static child-class?
Posted: Wed Nov 05, 2008 1:23 pm
I have a setup, where i have a class Article that extends the class Model. The Model-class have some methods, that is called statically, but can be overwritten in the Article-class, to allow for customization, much as in RoR's model-structure. I'm calling the Article::find() which calls the Article-class, but the actual method lives in the model class, here comes the actual question: How do I in the Model-class find out which class was called statically, that extended the Model-class?
Code: Select all
# Model.php
class Model {
public static function find(){ /*Do something*/ }
}
# Article.php
class Article extends Model {
}
# somepage.php
$results = Article::find()