Esempio n. 1
0
 public function getItems()
 {
     $collection = new Collection;
     foreach ($this->_dbTable->fetchAll() as $item) {
         $collection->append($item->username);
     }
     return $collection;
 }
Esempio n. 2
0
 public function search($text)
 {
     $response = $this->_twitter->search($text);
     $factory = new Factory\Tweet;
     $collection = new Collection\Collection();
     foreach ($response->results as $tweetData) {
         $tweet = $factory->create($tweetData);
         if (!$tweet->hasLocation()) {
             $tweet->setLocation($this->findLocationByUsername($tweet->getFrom()));
         }
         $collection->append($tweet);
     }
     return $collection;
 }
Esempio n. 3
0
 public function __construct(Collection\Collection $tweets)
 {
     $this->_tweets = $tweets->filter(new Tweet\Specification\HasLocation);
 }