Exemplo n.º 1
0
 /**
  * Deletes all show instances of current show after a
  * certain date.
  *
  * @param string $p_date
  *      The date which to delete after, if null deletes from the current timestamp.
  */
 public function removeAllInstancesFromDate($p_date = null)
 {
     global $CC_DBC;
     $date = new DateHelper();
     $timestamp = $date->getTimestamp();
     if (is_null($p_date)) {
         $date = new DateHelper();
         $p_date = $date->getDate();
     }
     $showId = $this->getId();
     $sql = "DELETE FROM cc_show_instances " . " WHERE date(starts) >= DATE '{$p_date}'" . " AND starts > TIMESTAMP '{$timestamp}'" . " AND show_id = {$showId}";
     $CC_DBC->query($sql);
     /*
     CcShowInstancesQuery::create()
         ->filterByDbShowId($showId)
         ->filterByDbStartTime($p_date, Criteria::GREATER_EQUAL)
         ->delete();
     */
 }
Exemplo n.º 2
0
 public static function getDateTime($ts)
 {
     return DateHelper::getDate($ts) . " " . DateHelper::getTime($ts);
 }