Ejemplo n.º 1
0
 public function deleteShowAction()
 {
     $showInstanceId = $this->_getParam('id');
     $userInfo = Zend_Auth::getInstance()->getStorage()->read();
     $user = new Application_Model_User($userInfo->id);
     if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
         try {
             $showInstance = new Application_Model_ShowInstance($showInstanceId);
         } catch (Exception $e) {
             Logging::info($e->getMessage());
             $this->view->show_error = true;
             return false;
         }
         $showInstance->delete();
         $this->view->show_id = $showInstance->getShowId();
     }
 }
Ejemplo n.º 2
0
    public function cancelShow($day_timestamp)
    {
        $timeinfo = explode(" ", $day_timestamp);
        CcShowDaysQuery::create()->filterByDbShowId($this->_showId)->update(array('DbLastShow' => $timeinfo[0]));
        $sql = <<<SQL
SELECT id from cc_show_instances
WHERE starts >= :dayTimestamp::TIMESTAMP
  AND show_id = :showId
SQL;
        $rows = Application_Common_Database::prepareAndExecute($sql, array(':dayTimestamp' => $day_timestamp, ':showId' => $this->getId()), 'all');
        foreach ($rows as $row) {
            try {
                $showInstance = new Application_Model_ShowInstance($row["id"]);
                $showInstance->delete($rabbitmqPush = false);
            } catch (Exception $e) {
                Logging::info($e->getMessage());
            }
        }
        Application_Model_RabbitMq::PushSchedule();
    }