我正在尝试在类的一个方法中使用另一个方法。我对PHP5面向对象编程没有太多经验,我搜索了答案,但找不到任何信息。我正试图在同一个类中的sendRequest()方法中使用getClientInfo()方法。
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);
}
}
这告诉我:
致命错误:调用未定义的函数getClientInfo()
我也尝试过
parent::getClientInfo($db, $client);
并且$this->getClientInfo($db, $client);
毫无成果。
有任何想法吗?