public static function deleteMemberGoogleCalendar(Member $member)
 {
     Doctrine_Core::getTable('MemberConfig')->createQuery()->delete()->whereIn('name', array('google_calendar_oauth_access_token', 'google_cron_update', 'google_cron_update_public_flag', 'opCalendarPlugin_email'))->andWhere('member_id = ?', $member->id)->execute();
     ScheduleTable::getInstance()->createQuery()->delete()->where('member_id = ?', $member->id)->andWhere('api_id_unique IS NOT NULL')->execute();
 }
예제 #2
0
파일: cstat.php 프로젝트: Hawkart/megatv
 public static function addByShedule($prog_id, $action = false, $recommendations = false)
 {
     global $USER;
     if ($USER->IsAuthorized()) {
         $arStatistic = self::getByUser();
         $arSelect = array("UF_CHANNEL_BASE_ID" => "UF_CHANNEL.UF_BASE_ID", "UF_CATEGORY" => "UF_PROG.UF_CATEGORY", "UF_SERIAL" => "UF_PROG.UF_EPG_ID", "UF_GANRE" => "UF_PROG.UF_GANRE");
         $result = ScheduleTable::getList(array('filter' => array("=ID" => $prog_id), 'select' => $arSelect, 'limit' => 1));
         $arSchedule = $result->fetch();
         $arCount = self::countRate($action, $recommendations);
         if (!empty($arSchedule["UF_CHANNEL_BASE_ID"])) {
             $arStatistic["CHANNELS"][trim($arSchedule["UF_CHANNEL_BASE_ID"])] += floatval($arCount["CHANNELS"]);
         }
         if (!empty($arSchedule["UF_CATEGORY"])) {
             $arStatistic["CATS"][trim($arSchedule["UF_CATEGORY"])] += floatval($arCount["CATS"]);
         }
         if (!empty($arSchedule["UF_SERIAL"])) {
             $arStatistic["SERIALS"][trim($arSchedule["UF_SERIAL"])] += floatval($arCount["SERIALS"]);
         }
         if (!empty($arSchedule["UF_GANRE"])) {
             $arGanres = explode(",", $arSchedule["UF_GANRE"]);
             foreach ($arGanres as $ganre) {
                 $arStatistic["GANRES"][trim($ganre)] += floatval($arCount["GANRES"]) / count($arGanres);
             }
         }
         self::save($arStatistic);
     }
 }