Code: Select all
# Model.php
class Model {
public static function find(){ /*Do something*/ }
}
# Article.php
class Article extends Model {
}
# somepage.php
$results = Article::find()Moderator: General Moderators
Code: Select all
# Model.php
class Model {
public static function find(){ /*Do something*/ }
}
# Article.php
class Article extends Model {
}
# somepage.php
$results = Article::find()That's what happens by default.ekampp wrote:Ok. Then how do you suggest i alter the code, so that the Article will inherit the Model, but you can write custom methods in the Article, which will overwrite the ones in the Model.