Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2011-11-18 14:07:00 -05:00
commit b30c95887f
8 changed files with 67 additions and 66 deletions

View file

@ -148,7 +148,7 @@ class Application_Model_Show {
// WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}"; // WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
$sql = "UPDATE cc_show_instances $sql = "UPDATE cc_show_instances
SET deleted_instance = TRUE SET modified_instance = TRUE
WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}"; WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}";
$CC_DBC->query($sql); $CC_DBC->query($sql);
@ -156,7 +156,7 @@ class Application_Model_Show {
// check if we can safely delete the show // check if we can safely delete the show
$showInstancesRow = CcShowInstancesQuery::create() $showInstancesRow = CcShowInstancesQuery::create()
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->filterByDbDeletedInstance(false) ->filterByDbModifiedInstance(false)
->findOne(); ->findOne();
if(is_null($showInstancesRow)){ if(is_null($showInstancesRow)){
@ -209,7 +209,7 @@ class Application_Model_Show {
$showInstancesRow = CcShowInstancesQuery::create() $showInstancesRow = CcShowInstancesQuery::create()
->filterByDbShowId($this->getId()) ->filterByDbShowId($this->getId())
->filterByDbRecord(1) ->filterByDbRecord(1)
->filterByDbDeletedInstance(false) ->filterByDbModifiedInstance(false)
->findOne(); ->findOne();
return !is_null($showInstancesRow); return !is_null($showInstancesRow);
@ -227,7 +227,7 @@ class Application_Model_Show {
$showInstancesRow = CcShowInstancesQuery::create() $showInstancesRow = CcShowInstancesQuery::create()
->filterByDbShowId($this->_showId) ->filterByDbShowId($this->_showId)
->filterByDbRebroadcast(1) ->filterByDbRebroadcast(1)
->filterByDbDeletedInstance(false) ->filterByDbModifiedInstance(false)
->findOne(); ->findOne();
return !is_null($showInstancesRow); return !is_null($showInstancesRow);
@ -250,7 +250,7 @@ class Application_Model_Show {
."FROM cc_show_instances " ."FROM cc_show_instances "
."WHERE show_id = $showId " ."WHERE show_id = $showId "
."AND record = 1 " ."AND record = 1 "
."AND deleted_instance != TRUE"; ."AND modified_instance != TRUE";
$baseDate = $CC_DBC->GetOne($sql); $baseDate = $CC_DBC->GetOne($sql);
if (is_null($baseDate)){ if (is_null($baseDate)){
@ -561,7 +561,7 @@ class Application_Model_Show {
$sql = "SELECT id from cc_show_instances" $sql = "SELECT id from cc_show_instances"
." WHERE show_id = $showId" ." WHERE show_id = $showId"
." AND starts > TIMESTAMP '$timestamp'" ." AND starts > TIMESTAMP '$timestamp'"
." AND deleted_instance != TRUE"; ." AND modified_instance != TRUE";
$rows = $CC_DBC->GetAll($sql); $rows = $CC_DBC->GetAll($sql);
@ -682,8 +682,8 @@ class Application_Model_Show {
} }
/* Only used for shows that are repeating. Note that this will return /* Only used for shows that are repeating. Note that this will return
* true even for dates that only have a "deleted" show instance (does not * true even for dates that only have a "modified" show instance (does not
* check if the "deleted_instance" column is set to true). This is intended * check if the "modified_instance" column is set to true). This is intended
* behaviour. * behaviour.
* *
* @param $p_dateTime: Date for which we are checking if instance * @param $p_dateTime: Date for which we are checking if instance
@ -697,7 +697,7 @@ class Application_Model_Show {
/* Only used for shows that are repeating. Note that this will return /* Only used for shows that are repeating. Note that this will return
* shows that have been "deleted" (does not check if the "deleted_instance" * shows that have been "modified" (does not check if the "modified_instance"
* column is set to true). This is intended behaviour. * column is set to true). This is intended behaviour.
* *
* @param $p_dateTime: Date for which we are getting an instance. * @param $p_dateTime: Date for which we are getting an instance.
@ -1277,7 +1277,7 @@ class Application_Model_Show {
color, background_color, file_id, cc_show_instances.id AS instance_id color, background_color, file_id, cc_show_instances.id AS instance_id
FROM cc_show_instances FROM cc_show_instances
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id
WHERE cc_show_instances.deleted_instance = FALSE"; WHERE cc_show_instances.modified_instance = FALSE";
//only want shows that are starting at the time or later. //only want shows that are starting at the time or later.
$start_string = $start_timestamp->format("Y-m-d H:i:s"); $start_string = $start_timestamp->format("Y-m-d H:i:s");
@ -1416,7 +1416,6 @@ class Application_Model_Show {
$event["description"] = $show["description"]; $event["description"] = $show["description"];
$event["showId"] = $show["show_id"]; $event["showId"] = $show["show_id"];
$event["record"] = intval($show["record"]); $event["record"] = intval($show["record"]);
$event["deleted_instance"] = $show["deleted_instance"];
$event["rebroadcast"] = intval($show["rebroadcast"]); $event["rebroadcast"] = intval($show["rebroadcast"]);
// get soundcloud_id // get soundcloud_id
@ -1470,8 +1469,9 @@ class Application_Model_Show {
public static function GetCurrentShow($timeNow) public static function GetCurrentShow($timeNow)
{ {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id, si.id as instance_id, si.record, s.url" //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin
$sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id, si.id as instance_id, si.record, s.url, starts, ends"
." FROM $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s" ." FROM $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
." WHERE si.show_id = s.id" ." WHERE si.show_id = s.id"
." AND si.starts <= TIMESTAMP '$timeNow'" ." AND si.starts <= TIMESTAMP '$timeNow'"
@ -1505,6 +1505,7 @@ class Application_Model_Show {
$timeEnd = "'$timeEnd'"; $timeEnd = "'$timeEnd'";
} }
//TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin
$sql = "SELECT *, si.starts as start_timestamp, si.ends as end_timestamp FROM " $sql = "SELECT *, si.starts as start_timestamp, si.ends as end_timestamp FROM "
." $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s" ." $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s"
." WHERE si.show_id = s.id" ." WHERE si.show_id = s.id"

View file

@ -139,7 +139,7 @@ class Application_Model_ShowInstance {
public function isDeleted() public function isDeleted()
{ {
$this->_showInstance->getDbDeletedInstance(); $this->_showInstance->getDbModifiedInstance();
} }
public function correctScheduleStartTimes(){ public function correctScheduleStartTimes(){
@ -405,7 +405,7 @@ class Application_Model_ShowInstance {
CcShowInstancesQuery::create() CcShowInstancesQuery::create()
->findPK($this->_instanceId) ->findPK($this->_instanceId)
->setDbDeletedInstance(true) ->setDbModifiedInstance(true)
->save(); ->save();
/* Automatically delete all files scheduled in cc_schedules table. */ /* Automatically delete all files scheduled in cc_schedules table. */
@ -416,7 +416,7 @@ class Application_Model_ShowInstance {
// check if we can safely delete the show // check if we can safely delete the show
$showInstancesRow = CcShowInstancesQuery::create() $showInstancesRow = CcShowInstancesQuery::create()
->filterByDbShowId($showId) ->filterByDbShowId($showId)
->filterByDbDeletedInstance(false) ->filterByDbModifiedInstance(false)
->findOne(); ->findOne();
@ -559,7 +559,7 @@ class Application_Model_ShowInstance {
global $CC_DBC; global $CC_DBC;
$sql = "SELECT id FROM cc_show_instances AS si " $sql = "SELECT id FROM cc_show_instances AS si "
."WHERE deleted_instance != TRUE AND (" ."WHERE modified_instance != TRUE AND ("
."(si.starts < TIMESTAMP '$p_timeNow' - INTERVAL '$p_start seconds' " ."(si.starts < TIMESTAMP '$p_timeNow' - INTERVAL '$p_start seconds' "
."AND si.ends > TIMESTAMP '$p_timeNow' - INTERVAL '$p_start seconds') " ."AND si.ends > TIMESTAMP '$p_timeNow' - INTERVAL '$p_start seconds') "
."OR (si.starts > TIMESTAMP '$p_timeNow' - INTERVAL '$p_start seconds' " ."OR (si.starts > TIMESTAMP '$p_timeNow' - INTERVAL '$p_start seconds' "

View file

@ -47,7 +47,7 @@ class CcShowInstancesTableMap extends TableMap {
$this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); $this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null);
$this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null); $this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null);
$this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null); $this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null);
$this->addColumn('DELETED_INSTANCE', 'DbDeletedInstance', 'BOOLEAN', true, null, false); $this->addColumn('MODIFIED_INSTANCE', 'DbModifiedInstance', 'BOOLEAN', true, null, false);
// validators // validators
} // initialize() } // initialize()

View file

@ -81,11 +81,11 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
protected $time_filled; protected $time_filled;
/** /**
* The value for the deleted_instance field. * The value for the modified_instance field.
* Note: this column has a database default value of: false * Note: this column has a database default value of: false
* @var boolean * @var boolean
*/ */
protected $deleted_instance; protected $modified_instance;
/** /**
* @var CcShow * @var CcShow
@ -136,7 +136,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
{ {
$this->record = 0; $this->record = 0;
$this->rebroadcast = 0; $this->rebroadcast = 0;
$this->deleted_instance = false; $this->modified_instance = false;
} }
/** /**
@ -309,13 +309,13 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
} }
/** /**
* Get the [deleted_instance] column value. * Get the [modified_instance] column value.
* *
* @return boolean * @return boolean
*/ */
public function getDbDeletedInstance() public function getDbModifiedInstance()
{ {
return $this->deleted_instance; return $this->modified_instance;
} }
/** /**
@ -598,24 +598,24 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
} // setDbTimeFilled() } // setDbTimeFilled()
/** /**
* Set the value of [deleted_instance] column. * Set the value of [modified_instance] column.
* *
* @param boolean $v new value * @param boolean $v new value
* @return CcShowInstances The current object (for fluent API support) * @return CcShowInstances The current object (for fluent API support)
*/ */
public function setDbDeletedInstance($v) public function setDbModifiedInstance($v)
{ {
if ($v !== null) { if ($v !== null) {
$v = (boolean) $v; $v = (boolean) $v;
} }
if ($this->deleted_instance !== $v || $this->isNew()) { if ($this->modified_instance !== $v || $this->isNew()) {
$this->deleted_instance = $v; $this->modified_instance = $v;
$this->modifiedColumns[] = CcShowInstancesPeer::DELETED_INSTANCE; $this->modifiedColumns[] = CcShowInstancesPeer::MODIFIED_INSTANCE;
} }
return $this; return $this;
} // setDbDeletedInstance() } // setDbModifiedInstance()
/** /**
* Indicates whether the columns in this object are only set to default values. * Indicates whether the columns in this object are only set to default values.
@ -635,7 +635,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return false; return false;
} }
if ($this->deleted_instance !== false) { if ($this->modified_instance !== false) {
return false; return false;
} }
@ -670,7 +670,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; $this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
$this->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; $this->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
$this->time_filled = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; $this->time_filled = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
$this->deleted_instance = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null; $this->modified_instance = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -1104,7 +1104,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
return $this->getDbTimeFilled(); return $this->getDbTimeFilled();
break; break;
case 9: case 9:
return $this->getDbDeletedInstance(); return $this->getDbModifiedInstance();
break; break;
default: default:
return null; return null;
@ -1139,7 +1139,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$keys[6] => $this->getDbOriginalShow(), $keys[6] => $this->getDbOriginalShow(),
$keys[7] => $this->getDbRecordedFile(), $keys[7] => $this->getDbRecordedFile(),
$keys[8] => $this->getDbTimeFilled(), $keys[8] => $this->getDbTimeFilled(),
$keys[9] => $this->getDbDeletedInstance(), $keys[9] => $this->getDbModifiedInstance(),
); );
if ($includeForeignObjects) { if ($includeForeignObjects) {
if (null !== $this->aCcShow) { if (null !== $this->aCcShow) {
@ -1210,7 +1210,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->setDbTimeFilled($value); $this->setDbTimeFilled($value);
break; break;
case 9: case 9:
$this->setDbDeletedInstance($value); $this->setDbModifiedInstance($value);
break; break;
} // switch() } // switch()
} }
@ -1245,7 +1245,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]); if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]); if (array_key_exists($keys[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbTimeFilled($arr[$keys[8]]); if (array_key_exists($keys[8], $arr)) $this->setDbTimeFilled($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDbDeletedInstance($arr[$keys[9]]); if (array_key_exists($keys[9], $arr)) $this->setDbModifiedInstance($arr[$keys[9]]);
} }
/** /**
@ -1266,7 +1266,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowInstancesPeer::INSTANCE_ID)) $criteria->add(CcShowInstancesPeer::INSTANCE_ID, $this->instance_id); if ($this->isColumnModified(CcShowInstancesPeer::INSTANCE_ID)) $criteria->add(CcShowInstancesPeer::INSTANCE_ID, $this->instance_id);
if ($this->isColumnModified(CcShowInstancesPeer::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id); if ($this->isColumnModified(CcShowInstancesPeer::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id);
if ($this->isColumnModified(CcShowInstancesPeer::TIME_FILLED)) $criteria->add(CcShowInstancesPeer::TIME_FILLED, $this->time_filled); if ($this->isColumnModified(CcShowInstancesPeer::TIME_FILLED)) $criteria->add(CcShowInstancesPeer::TIME_FILLED, $this->time_filled);
if ($this->isColumnModified(CcShowInstancesPeer::DELETED_INSTANCE)) $criteria->add(CcShowInstancesPeer::DELETED_INSTANCE, $this->deleted_instance); if ($this->isColumnModified(CcShowInstancesPeer::MODIFIED_INSTANCE)) $criteria->add(CcShowInstancesPeer::MODIFIED_INSTANCE, $this->modified_instance);
return $criteria; return $criteria;
} }
@ -1336,7 +1336,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$copyObj->setDbOriginalShow($this->instance_id); $copyObj->setDbOriginalShow($this->instance_id);
$copyObj->setDbRecordedFile($this->file_id); $copyObj->setDbRecordedFile($this->file_id);
$copyObj->setDbTimeFilled($this->time_filled); $copyObj->setDbTimeFilled($this->time_filled);
$copyObj->setDbDeletedInstance($this->deleted_instance); $copyObj->setDbModifiedInstance($this->modified_instance);
if ($deepCopy) { if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of // important: temporarily setNew(false) because this affects the behavior of
@ -1854,7 +1854,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
$this->instance_id = null; $this->instance_id = null;
$this->file_id = null; $this->file_id = null;
$this->time_filled = null; $this->time_filled = null;
$this->deleted_instance = null; $this->modified_instance = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
$this->clearAllReferences(); $this->clearAllReferences();

View file

@ -58,8 +58,8 @@ abstract class BaseCcShowInstancesPeer {
/** the column name for the TIME_FILLED field */ /** the column name for the TIME_FILLED field */
const TIME_FILLED = 'cc_show_instances.TIME_FILLED'; const TIME_FILLED = 'cc_show_instances.TIME_FILLED';
/** the column name for the DELETED_INSTANCE field */ /** the column name for the MODIFIED_INSTANCE field */
const DELETED_INSTANCE = 'cc_show_instances.DELETED_INSTANCE'; const MODIFIED_INSTANCE = 'cc_show_instances.MODIFIED_INSTANCE';
/** /**
* An identiy map to hold any loaded instances of CcShowInstances objects. * An identiy map to hold any loaded instances of CcShowInstances objects.
@ -77,11 +77,11 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', 'DbDeletedInstance', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', 'DbModifiedInstance', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', 'dbDeletedInstance', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', 'dbModifiedInstance', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, self::DELETED_INSTANCE, ), BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, self::MODIFIED_INSTANCE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', 'DELETED_INSTANCE', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', 'MODIFIED_INSTANCE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', 'deleted_instance', ), BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', 'modified_instance', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
); );
@ -92,11 +92,11 @@ abstract class BaseCcShowInstancesPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, 'DbDeletedInstance' => 9, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, 'DbModifiedInstance' => 9, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, 'dbDeletedInstance' => 9, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, 'dbModifiedInstance' => 9, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, self::DELETED_INSTANCE => 9, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, self::MODIFIED_INSTANCE => 9, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, 'DELETED_INSTANCE' => 9, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, 'MODIFIED_INSTANCE' => 9, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, 'deleted_instance' => 9, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, 'modified_instance' => 9, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
); );
@ -178,7 +178,7 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID); $criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID); $criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID);
$criteria->addSelectColumn(CcShowInstancesPeer::TIME_FILLED); $criteria->addSelectColumn(CcShowInstancesPeer::TIME_FILLED);
$criteria->addSelectColumn(CcShowInstancesPeer::DELETED_INSTANCE); $criteria->addSelectColumn(CcShowInstancesPeer::MODIFIED_INSTANCE);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STARTS'); $criteria->addSelectColumn($alias . '.STARTS');
@ -189,7 +189,7 @@ abstract class BaseCcShowInstancesPeer {
$criteria->addSelectColumn($alias . '.INSTANCE_ID'); $criteria->addSelectColumn($alias . '.INSTANCE_ID');
$criteria->addSelectColumn($alias . '.FILE_ID'); $criteria->addSelectColumn($alias . '.FILE_ID');
$criteria->addSelectColumn($alias . '.TIME_FILLED'); $criteria->addSelectColumn($alias . '.TIME_FILLED');
$criteria->addSelectColumn($alias . '.DELETED_INSTANCE'); $criteria->addSelectColumn($alias . '.MODIFIED_INSTANCE');
} }
} }

View file

@ -15,7 +15,7 @@
* @method CcShowInstancesQuery orderByDbOriginalShow($order = Criteria::ASC) Order by the instance_id column * @method CcShowInstancesQuery orderByDbOriginalShow($order = Criteria::ASC) Order by the instance_id column
* @method CcShowInstancesQuery orderByDbRecordedFile($order = Criteria::ASC) Order by the file_id column * @method CcShowInstancesQuery orderByDbRecordedFile($order = Criteria::ASC) Order by the file_id column
* @method CcShowInstancesQuery orderByDbTimeFilled($order = Criteria::ASC) Order by the time_filled column * @method CcShowInstancesQuery orderByDbTimeFilled($order = Criteria::ASC) Order by the time_filled column
* @method CcShowInstancesQuery orderByDbDeletedInstance($order = Criteria::ASC) Order by the deleted_instance column * @method CcShowInstancesQuery orderByDbModifiedInstance($order = Criteria::ASC) Order by the modified_instance column
* *
* @method CcShowInstancesQuery groupByDbId() Group by the id column * @method CcShowInstancesQuery groupByDbId() Group by the id column
* @method CcShowInstancesQuery groupByDbStarts() Group by the starts column * @method CcShowInstancesQuery groupByDbStarts() Group by the starts column
@ -26,7 +26,7 @@
* @method CcShowInstancesQuery groupByDbOriginalShow() Group by the instance_id column * @method CcShowInstancesQuery groupByDbOriginalShow() Group by the instance_id column
* @method CcShowInstancesQuery groupByDbRecordedFile() Group by the file_id column * @method CcShowInstancesQuery groupByDbRecordedFile() Group by the file_id column
* @method CcShowInstancesQuery groupByDbTimeFilled() Group by the time_filled column * @method CcShowInstancesQuery groupByDbTimeFilled() Group by the time_filled column
* @method CcShowInstancesQuery groupByDbDeletedInstance() Group by the deleted_instance column * @method CcShowInstancesQuery groupByDbModifiedInstance() Group by the modified_instance column
* *
* @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcShowInstancesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcShowInstancesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -64,7 +64,7 @@
* @method CcShowInstances findOneByDbOriginalShow(int $instance_id) Return the first CcShowInstances filtered by the instance_id column * @method CcShowInstances findOneByDbOriginalShow(int $instance_id) Return the first CcShowInstances filtered by the instance_id column
* @method CcShowInstances findOneByDbRecordedFile(int $file_id) Return the first CcShowInstances filtered by the file_id column * @method CcShowInstances findOneByDbRecordedFile(int $file_id) Return the first CcShowInstances filtered by the file_id column
* @method CcShowInstances findOneByDbTimeFilled(string $time_filled) Return the first CcShowInstances filtered by the time_filled column * @method CcShowInstances findOneByDbTimeFilled(string $time_filled) Return the first CcShowInstances filtered by the time_filled column
* @method CcShowInstances findOneByDbDeletedInstance(boolean $deleted_instance) Return the first CcShowInstances filtered by the deleted_instance column * @method CcShowInstances findOneByDbModifiedInstance(boolean $modified_instance) Return the first CcShowInstances filtered by the modified_instance column
* *
* @method array findByDbId(int $id) Return CcShowInstances objects filtered by the id column * @method array findByDbId(int $id) Return CcShowInstances objects filtered by the id column
* @method array findByDbStarts(string $starts) Return CcShowInstances objects filtered by the starts column * @method array findByDbStarts(string $starts) Return CcShowInstances objects filtered by the starts column
@ -75,7 +75,7 @@
* @method array findByDbOriginalShow(int $instance_id) Return CcShowInstances objects filtered by the instance_id column * @method array findByDbOriginalShow(int $instance_id) Return CcShowInstances objects filtered by the instance_id column
* @method array findByDbRecordedFile(int $file_id) Return CcShowInstances objects filtered by the file_id column * @method array findByDbRecordedFile(int $file_id) Return CcShowInstances objects filtered by the file_id column
* @method array findByDbTimeFilled(string $time_filled) Return CcShowInstances objects filtered by the time_filled column * @method array findByDbTimeFilled(string $time_filled) Return CcShowInstances objects filtered by the time_filled column
* @method array findByDbDeletedInstance(boolean $deleted_instance) Return CcShowInstances objects filtered by the deleted_instance column * @method array findByDbModifiedInstance(boolean $modified_instance) Return CcShowInstances objects filtered by the modified_instance column
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
*/ */
@ -451,20 +451,20 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria
} }
/** /**
* Filter the query on the deleted_instance column * Filter the query on the modified_instance column
* *
* @param boolean|string $dbDeletedInstance The value to use as filter. * @param boolean|string $dbModifiedInstance The value to use as filter.
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return CcShowInstancesQuery The current query, for fluid interface * @return CcShowInstancesQuery The current query, for fluid interface
*/ */
public function filterByDbDeletedInstance($dbDeletedInstance = null, $comparison = null) public function filterByDbModifiedInstance($dbModifiedInstance = null, $comparison = null)
{ {
if (is_string($dbDeletedInstance)) { if (is_string($dbModifiedInstance)) {
$deleted_instance = in_array(strtolower($dbDeletedInstance), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; $modified_instance = in_array(strtolower($dbModifiedInstance), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
} }
return $this->addUsingAlias(CcShowInstancesPeer::DELETED_INSTANCE, $dbDeletedInstance, $comparison); return $this->addUsingAlias(CcShowInstancesPeer::MODIFIED_INSTANCE, $dbModifiedInstance, $comparison);
} }
/** /**

View file

@ -149,11 +149,11 @@
<column name="instance_id" phpName="DbOriginalShow" type="INTEGER" required="false"/> <column name="instance_id" phpName="DbOriginalShow" type="INTEGER" required="false"/>
<column name="file_id" phpName="DbRecordedFile" type="INTEGER" required="false"/> <column name="file_id" phpName="DbRecordedFile" type="INTEGER" required="false"/>
<column name="time_filled" phpName="DbTimeFilled" type="TIME" /> <column name="time_filled" phpName="DbTimeFilled" type="TIME" />
<!-- The purpose of the deleted_instance column is to mark a show instance that was <!-- The purpose of the modified_instance column is to mark a show instance that was
deleted when it was part of repeating show. This is useful because the way shows work, deleted when it was part of repeating show. This is useful because the way shows work,
instances can be regenerated if we edit the show, which is unwanted behaviour. This column serves instances can be regenerated if we edit the show, which is unwanted behaviour. This column serves
to ensure that we don't regenerate the instance. --> to ensure that we don't regenerate the instance. -->
<column name="deleted_instance" phpName="DbDeletedInstance" type="BOOLEAN" required="true" defaultValue="false" /> <column name="modified_instance" phpName="DbModifiedInstance" type="BOOLEAN" required="true" defaultValue="false" />
<behavior name="aggregate_column"> <behavior name="aggregate_column">
<parameter name="name" value="time_filled" /> <parameter name="name" value="time_filled" />
<parameter name="foreign_table" value="cc_schedule" /> <parameter name="foreign_table" value="cc_schedule" />

View file

@ -196,7 +196,7 @@ CREATE TABLE "cc_show_instances"
"instance_id" INTEGER, "instance_id" INTEGER,
"file_id" INTEGER, "file_id" INTEGER,
"time_filled" TIME, "time_filled" TIME,
"deleted_instance" BOOLEAN default 'f' NOT NULL, "modified_instance" BOOLEAN default 'f' NOT NULL,
PRIMARY KEY ("id") PRIMARY KEY ("id")
); );