Beispiel #1
0
 static function getNovelistRecommendations($userRating, $isbn, $resource, $allRatedTitles, &$suggestions, $notInterestedTitles)
 {
     //We now have the title, we can get the related titles from Novelist
     $novelist = NovelistFactory::getNovelist();
     //Use loadEnrichmentInfo even though there is more data than we need since it uses caching.
     $enrichmentInfo = $novelist->loadEnrichment($isbn);
     $numRecommendations = 0;
     if (isset($enrichmentInfo['similarTitleCountOwned']) && $enrichmentInfo['similarTitleCountOwned'] > 0) {
         //For each related title
         foreach ($enrichmentInfo['similarTitles'] as $similarTitle) {
             if ($similarTitle['libraryOwned']) {
                 Suggestions::addTitleToSuggestions($userRating, $resource->title, $resource->record_id, $similarTitle, $allRatedTitles, $suggestions, $notInterestedTitles);
                 $numRecommendations++;
             }
         }
     }
     return $numRecommendations;
 }