thecodeholic/php-mvc-framework

Gives: Deprecated: Non-static method

Abdvkh opened this issue · 2 comments


Deprecated: Non-static method app\models\User::primaryKey() should not be called statically in /Applications/XAMPP/xamppfiles/htdocs/php/mvc/core/Application.php on line 34

Deprecated: Non-static method app\core\DbModel::findOne() should not be called statically in /Applications/XAMPP/xamppfiles/htdocs/php/mvc/core/Application.php on line 35

Deprecated: Non-static method app\models\User::tableName() should not be called statically in /Applications/XAMPP/xamppfiles/htdocs/php/mvc/core/DbModel.php on line 34

Commit where you have created .findOne() function
e9e01dd

Hi @Abdvkh, I'm in the same point as you and apparently you can make your function static like that :
public static function findOne($where)
and it will allow you to call it like that :
$this->userClass::findOne
I don't know if that's the best option but it's working for me.

@NicolasHalberstadt thanks for your help, i thought it will cause problems in the future, but I hope it's not so