Exemple #1
0
 /**
  * Searches for a title by query, inserts and returns it.
  *
  * @param  string $query
  * @return array
  */
 public function byQuery($query)
 {
     $url = $this->compileSearchUrl($query);
     //scrape and compile results for display in view
     $results = $this->scraper->curl($url);
     $compiled = $this->compileSearchResults($results);
     Event::fire('App.SearchResultsCompiled', array($compiled));
     return $this->writer->insertFromImdbSearch($compiled);
 }
Exemple #2
0
 /**
  * Inserts single seasons eps and returns title with everything.
  * 
  * @param  array  $season
  * @param  int $id
  * @return Collection
  */
 public function saveEpisodes(array $season, $id)
 {
     $this->dbWriter->CompileBatchInsert('episodes', $season)->save();
     return Title::whereId($id)->with('Writer', 'Director', 'Actor', 'Image', 'Review', 'Season.Episode')->first();
 }