コード例 #1
0
ファイル: profilemodel.php プロジェクト: gearsandcode/WPSpin
 /**
  * getAllDJProfiles
  *
  * @static
  * @access public
  * @return void
  */
 public static function getAllDJProfiles()
 {
     $shows = ShowModel::getAllShows();
     $profiles = array();
     foreach ($shows as $show) {
         foreach ($show['ShowUsers'] as $user) {
             $profiles[] = array('ShowID' => $show['ShowID'], 'UserID' => $user['UserID'], 'DJName' => $user['DJName'], 'ShowName' => $show['ShowName'], 'ShowDescription' => $show['ShowDescription'], 'ShowURL' => $show['ShowURL'], 'ShowCategory' => $show['ShowCategory']);
         }
     }
     return $profiles;
 }
コード例 #2
0
ファイル: importhelper.php プロジェクト: gearsandcode/WPSpin
 /**
  * import
  *
  * @access public
  * @return void
  */
 public function import()
 {
     $shows = ShowModel::getAllShows();
     if (count($shows) == 0) {
         throw new \Exception("Failed to retrieve all the shows from Spinitron. Check your settings.");
     }
     foreach ($shows as $show) {
         $this->createShow($show);
     }
     $profiles = ProfileModel::getAllDJProfiles();
     if (count($profiles) == 0) {
         throw new \Exception("Failed to retrieve all the DJ profiles from Spinitron. Check your settings.");
     }
     foreach ($profiles as $profile) {
         $this->createProfile($profile);
     }
 }
コード例 #3
0
 public static function getCurrentShow()
 {
     $response = json_encode(ShowModel::getCurrentShow());
     echo $response;
     die;
 }