thecodeholic / php-mvc-framework

PHP MVC Framework

Home Page:https://www.youtube.com/playlist?list=PLLQuc_7jk__Uk_QnJMPndbdKECcTEwTA1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gives: Deprecated: Non-static method

Abdvkh opened this issue · 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