Example #1
0
 /**
  * @param $search
  * @return Torrent[]
  */
 public function search($search)
 {
     $response = $this->client->post($this->config->getBaseUrl() . "/torrents/search/{$search}?limit={$this->limit}", array('headers' => array("Authorization" => $this->config->getToken())));
     $data = $response->json();
     $rows = $data['torrents'];
     $torrents = array();
     foreach ($rows as $row) {
         if (is_array($row)) {
             $torrents[] = $this->torrentFactory->create($row);
         }
     }
     return $torrents;
 }