我试图在类中的另一个方法中使用一个方法。我在PHP5 OOP没有太多的经验,我环顾四周寻找答案,但找不到任何。我试图使用getClientInfo()在sendRequest(),这是在同一个类。
class DomainHandler {
public static function getClientInfo($db, $client_id)
{
//Do stuff
}
public static function sendRequest($details)
{
require_once('MySQL.class.php');
$db = new MySQL;
getClientInfo($db, $client);
}
}
它告诉我:
Fatal error: Call to undefined
function getClientInfo()
我也试过
parent::getClientInfo($db, $client);
和
$this->getClientInfo($db, $client);
没有效果。
有任何想法吗?