我有一个 PHP 类,它应该将一个数组返回到实例化对象的位置。我试图找出问题所在,但我似乎看不到它。谁能看到我在这里出错的地方或指出我正确的方向?谢谢
这是类(在名为“feeds.php”的文件中。)
class updateFeed {
public function index() {
        $db = JFactory::getDBO();
        $query = "SELECT * FROM tweets";
        $db->setQuery($query);
        $result = $db->loadObject()
        if(strtotime($result->date_added) <= time() - 3200) {
            $this->updateTweets();
        }
        $query = "SELECT * FROM tweets ORDER BY tweet_date DESC LIMIT 0, 3";
        $db->setQuery($query);
        $results = $db->loadObjectList();
        $tweet_db = array();
        foreach($results as $result) {
            $tweet_db[] = array(
                'title'   =>   $result->title,
                'text'    =>   $result->text,
                'tweet_date'   =>   $result->tweet_date
            );
        }   
        return $tweet_db;
    }
这里是对象被实例化的地方(在 index.php 文件中):
include('feeds.php');
$tweet_dbs = new updateFeed;
print_r($tweet_dbs);
索引文件中的 print_r 显示“updateFeed Object ( ) ”。提前致谢。