嗨,我是 PHP 新手,我想知道如何填充 tweets 数组以返回它。
<?php
class TwitterService {
private $params = null;
private $tweets = array(
);
public function getParams() {
return $this->params;
}
public function setParams($params) {
$this->params = $params;
}
public function __construct($params) {
$this->setParams($params);
}
public function getTweets(){
private $tweet1 = new Tweet(
id = 253338336415064064,
created_at = 'Wed, 03 Oct 2012 03:39:00 +0000',
profile_image_url = 'http:\/\/a0.twimg.com\/profile_images\/1529778154\/Facebook_normal.jpg',
text = 'Lo real es lo real by @AnaliaRob tratando de expresarse vaya 1 a saber sobre q! Es un proverbio milenario. Only xa genios'
);
private $tweet2 = new Tweet(
id: 253324444091703298,
created_at: 'Wed, 03 Oct 2012 02:43:48 +0000',
profile_image_url: 'http:\/\/a0.twimg.com\/profile_images\/1529778154\/Facebook_normal.jpg',
text: 'Lo real es lo real by @AnaliaRob, trantando de expresarse vaya uno a saber sobre que!'
);
return $tweets;
}
class Tweet{
private $id = null;
private $created_at = null;
private $profile_image_url = null;
private $text= null;
};
非常感谢您。