From 74475d744760ed65dbc653768c4804f464f95ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 6 Feb 2024 11:22:03 +0000 Subject: [PATCH 1/6] Custom Intro/Outro lists per show --- ...0046_add_override_intro_outro_playlists.py | 37 +++ .../legacy/migrations/__init__.py | 2 +- .../legacy/migrations/sql/schema.sql | 14 + api/libretime_api/schedule/models/show.py | 22 ++ .../schedule/serializers/show.py | 4 + api/schema.yml | 22 ++ legacy/application/assets.json | 2 +- .../application/forms/AddShowAutoPlaylist.php | 30 +++ legacy/application/models/Show.php | 52 ++++ legacy/application/models/airtime/CcShow.php | 4 + .../models/airtime/map/CcPlaylistTableMap.php | 2 + .../models/airtime/map/CcShowTableMap.php | 6 + .../models/airtime/om/BaseCcShow.php | 250 +++++++++++++++++- .../models/airtime/om/BaseCcShowPeer.php | 56 +++- .../models/airtime/om/BaseCcShowQuery.php | 160 ++++++++++- .../application/services/ShowFormService.php | 4 + legacy/application/services/ShowService.php | 8 + .../scripts/form/add-show-autoplaylist.phtml | 40 ++- legacy/public/js/airtime/schedule/add-show.js | 22 ++ 19 files changed, 717 insertions(+), 20 deletions(-) create mode 100644 api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py diff --git a/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py b/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py new file mode 100644 index 0000000000..3da4194359 --- /dev/null +++ b/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py @@ -0,0 +1,37 @@ +# pylint: disable=invalid-name + +from django.db import migrations + +from ._migrations import legacy_migration_factory + +UP = """ +ALTER TABLE cc_show ADD COLUMN override_intro_playlist boolean default 'f' NOT NULL; +ALTER TABLE cc_show ADD COLUMN intro_playlist_id integer DEFAULT NULL; +ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_intro_playlist_fkey FOREIGN KEY (intro_playlist_id) REFERENCES cc_playlist (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL; +ALTER TABLE cc_show ADD COLUMN override_outro_playlist boolean default 'f' NOT NULL; +ALTER TABLE cc_show ADD COLUMN outro_playlist_id integer DEFAULT NULL; +ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_outro_playlist_fkey FOREIGN KEY (outro_playlist_id) REFERENCES cc_playlist (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL; +""" + +DOWN = """ +ALTER TABLE cc_show DROP COLUMN IF EXISTS override_intro_playlist; +ALTER TABLE cc_show DROP COLUMN IF EXISTS intro_playlist_id; +ALTER TABLE cc_show DROP CONSTRAINT IF EXISTS cc_playlist_intro_playlist_fkey; +ALTER TABLE cc_show DROP COLUMN IF EXISTS override_outro_playlist; +ALTER TABLE cc_show DROP COLUMN IF EXISTS outro_playlist_id; +ALTER TABLE cc_show DROP CONSTRAINT IF EXISTS cc_playlist_outro_playlist_fkey; +""" + + +class Migration(migrations.Migration): + dependencies = [ + ("legacy", "0045_add_sessions_table"), + ] + operations = [ + migrations.RunPython( + code=legacy_migration_factory( + target="46", + sql=UP, + ) + ) + ] diff --git a/api/libretime_api/legacy/migrations/__init__.py b/api/libretime_api/legacy/migrations/__init__.py index 9082ae2e36..2ae58aad57 100644 --- a/api/libretime_api/legacy/migrations/__init__.py +++ b/api/libretime_api/legacy/migrations/__init__.py @@ -1,2 +1,2 @@ # The schema version is defined using the migration file prefix number -LEGACY_SCHEMA_VERSION = "45" +LEGACY_SCHEMA_VERSION = "46" diff --git a/api/libretime_api/legacy/migrations/sql/schema.sql b/api/libretime_api/legacy/migrations/sql/schema.sql index ca90da4b7f..8e238b1e03 100644 --- a/api/libretime_api/legacy/migrations/sql/schema.sql +++ b/api/libretime_api/legacy/migrations/sql/schema.sql @@ -126,6 +126,10 @@ CREATE TABLE "cc_show" "has_autoplaylist" BOOLEAN DEFAULT 'f' NOT NULL, "autoplaylist_id" INTEGER, "autoplaylist_repeat" BOOLEAN DEFAULT 'f' NOT NULL, + "override_intro_playlist" BOOLEAN DEFAULT 'f' NOT NULL, + "intro_playlist_id" INTEGER, + "override_outro_playlist" BOOLEAN DEFAULT 'f' NOT NULL, + "outro_playlist_id" INTEGER, PRIMARY KEY ("id") ); @@ -718,6 +722,16 @@ ALTER TABLE "cc_show" ADD CONSTRAINT "cc_playlist_autoplaylist_fkey" REFERENCES "cc_playlist" ("id") ON DELETE SET NULL; +ALTER TABLE "cc_show" ADD CONSTRAINT "cc_show_intro_playlist_fkey" + FOREIGN KEY ("intro_playlist_id") + REFERENCES "cc_playlist" ("id") + ON DELETE SET NULL; + +ALTER TABLE "cc_show" ADD CONSTRAINT "cc_show_outro_playlist_fkey" + FOREIGN KEY ("outro_playlist_id") + REFERENCES "cc_playlist" ("id") + ON DELETE SET NULL; + ALTER TABLE "cc_show_instances" ADD CONSTRAINT "cc_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") diff --git a/api/libretime_api/schedule/models/show.py b/api/libretime_api/schedule/models/show.py index a1a6cecf35..0aac0e5326 100644 --- a/api/libretime_api/schedule/models/show.py +++ b/api/libretime_api/schedule/models/show.py @@ -69,6 +69,28 @@ def live_enabled(self) -> bool: auto_playlist_enabled = models.BooleanField(db_column="has_autoplaylist") auto_playlist_repeat = models.BooleanField(db_column="autoplaylist_repeat") + intro_playlist = models.ForeignKey( + "schedule.Playlist", + on_delete=models.DO_NOTHING, + blank=True, + null=True, + db_column="intro_playlist_id", + related_name="intro_playlist", + ) + + override_intro_playlist = models.BooleanField(db_column="override_intro_playlist") + + outro_playlist = models.ForeignKey( + "schedule.Playlist", + on_delete=models.DO_NOTHING, + blank=True, + null=True, + db_column="outro_playlist_id", + related_name="outro_playlist", + ) + + override_outro_playlist = models.BooleanField(db_column="override_outro_playlist") + hosts = models.ManyToManyField( # type: ignore[var-annotated] "core.User", through="ShowHost", diff --git a/api/libretime_api/schedule/serializers/show.py b/api/libretime_api/schedule/serializers/show.py index f25e926cc0..1eefa64c61 100644 --- a/api/libretime_api/schedule/serializers/show.py +++ b/api/libretime_api/schedule/serializers/show.py @@ -21,6 +21,10 @@ class Meta: "auto_playlist", "auto_playlist_enabled", "auto_playlist_repeat", + "intro_playlist", + "override_intro_playlist", + "outro_playlist", + "override_outro_playlist", ] diff --git a/api/schema.yml b/api/schema.yml index 8b55b0c14e..054d1d074b 100644 --- a/api/schema.yml +++ b/api/schema.yml @@ -6409,6 +6409,16 @@ components: type: boolean auto_playlist_repeat: type: boolean + intro_playlist: + type: integer + nullable: true + override_intro_playlist: + type: boolean + outro_playlist: + type: integer + nullable: true + override_outro_playlist: + type: boolean PatchedShowDays: type: object properties: @@ -7241,6 +7251,16 @@ components: type: boolean auto_playlist_repeat: type: boolean + intro_playlist: + type: integer + nullable: true + override_intro_playlist: + type: boolean + outro_playlist: + type: integer + nullable: true + override_outro_playlist: + type: boolean required: - auto_playlist_enabled - auto_playlist_repeat @@ -7249,6 +7269,8 @@ components: - linked - live_enabled - name + - override_intro_playlist + - override_outro_playlist ShowDays: type: object properties: diff --git a/legacy/application/assets.json b/legacy/application/assets.json index dbd8041e6a..ac6db42fd3 100644 --- a/legacy/application/assets.json +++ b/legacy/application/assets.json @@ -80,7 +80,7 @@ "js/airtime/preferences/musicdirs.js": "81eb5dbc292144fe8762ebcae47372a5", "js/airtime/preferences/preferences.js": "af842763a466c9ea5b9d697db424e08f", "js/airtime/preferences/streamsetting.js": "60bb2f4f750594afc330c1f8c2037b91", - "js/airtime/schedule/add-show.js": "6d44396fd42dc3da7d64740564089f4c", + "js/airtime/schedule/add-show.js": "7b3f5e248e958f7d23d728c3b2c9658e", "js/airtime/schedule/full-calendar-functions.js": "6854ef2c1863250c4f2494d5cfedf394", "js/airtime/schedule/schedule.js": "14e2073b1543cb404460317999850c17", "js/airtime/showbuilder/builder.js": "b5addaf98002c1673e4f1c93997b8dae", diff --git a/legacy/application/forms/AddShowAutoPlaylist.php b/legacy/application/forms/AddShowAutoPlaylist.php index 0d463f9105..a0bcdd62cf 100644 --- a/legacy/application/forms/AddShowAutoPlaylist.php +++ b/legacy/application/forms/AddShowAutoPlaylist.php @@ -34,6 +34,36 @@ public function init() 'class' => 'input_text', 'decorators' => ['ViewHelper'], ]); + + // Add override intro playlist checkbox element + $this->addElement('checkbox', 'add_show_override_intro_playlist', [ + 'label' => _('Override Intro Playlist ?'), + 'required' => false, + 'class' => 'input_text', + 'decorators' => ['ViewHelper'], + ]); + + $introPlaylistSelect = new Zend_Form_Element_Select('add_show_intro_playlist_id'); + $introPlaylistSelect->setLabel(_('Select Intro Playlist')); + $introPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames(true)); + $introPlaylistSelect->setValue(null); + $introPlaylistSelect->setDecorators(['ViewHelper']); + $this->addElement($introPlaylistSelect); + + // Add override outro playlist checkbox element + $this->addElement('checkbox', 'add_show_override_outro_playlist', [ + 'label' => _('Override Outro Playlist ?'), + 'required' => false, + 'class' => 'input_text', + 'decorators' => ['ViewHelper'], + ]); + + $outroPlaylistSelect = new Zend_Form_Element_Select('add_show_outro_playlist_id'); + $outroPlaylistSelect->setLabel(_('Select Outro Playlist')); + $outroPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames(true)); + $outroPlaylistSelect->setValue(null); + $outroPlaylistSelect->setDecorators(['ViewHelper']); + $this->addElement($outroPlaylistSelect); } public function disable() diff --git a/legacy/application/models/Show.php b/legacy/application/models/Show.php index 50a6c2451c..650f83f452 100644 --- a/legacy/application/models/Show.php +++ b/legacy/application/models/Show.php @@ -169,6 +169,58 @@ public function setAutoPlaylistId($playlistid) $show->setDbAutoPlaylistId($playlistid); } + public function getHasOverrideIntroPlaylist() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbHasOverrideIntroPlaylist(); + } + + public function setHasOverrideIntroPlaylist($value) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbHasOverrideIntroPlaylist($value); + } + + public function getIntroPlaylistId() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbIntroPlaylistId(); + } + + public function setIntroPlaylistId($playlistid) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbIntroPlaylistId($playlistid); + } + + public function getHasOverrideOutroPlaylist() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbHasOverrideOutroPlaylist(); + } + + public function setHasOverrideOutroPlaylist($value) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbHasOverrideOutroPlaylist($value); + } + + public function getOutroPlaylistId() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbOutroPlaylistId(); + } + + public function setOutroPlaylistId($playlistid) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbOutroPlaylistId($playlistid); + } + public function getHosts() { $sql = <<<'SQL' diff --git a/legacy/application/models/airtime/CcShow.php b/legacy/application/models/airtime/CcShow.php index 81f44f8170..134dd27fd6 100644 --- a/legacy/application/models/airtime/CcShow.php +++ b/legacy/application/models/airtime/CcShow.php @@ -327,6 +327,10 @@ public function getShowInfo() $info['has_autoplaylist'] = $this->getDbHasAutoPlaylist(); $info['autoplaylist_id'] = $this->getDbAutoPlaylistId(); $info['autoplaylist_repeat'] = $this->getDbAutoPlaylistRepeat(); + $info['override_intro_playlist'] = $this->getDbOverrideIntroPlaylist(); + $info['intro_playlist_id'] = $this->getDbIntroPlaylistId(); + $info['override_outro_playlist'] = $this->getDbOverrideOutroPlaylist(); + $info['outro_playlist_id'] = $this->getDbOutroPlaylistId(); return $info; } diff --git a/legacy/application/models/airtime/map/CcPlaylistTableMap.php b/legacy/application/models/airtime/map/CcPlaylistTableMap.php index d35f92e41c..74dfbbbcd2 100644 --- a/legacy/application/models/airtime/map/CcPlaylistTableMap.php +++ b/legacy/application/models/airtime/map/CcPlaylistTableMap.php @@ -56,6 +56,8 @@ public function buildRelations() { $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null); $this->addRelation('CcShow', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'autoplaylist_id', ), 'SET NULL', null, 'CcShows'); + $this->addRelation('CcShow', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'intro_playlist_id', ), 'SET NULL', null, 'CcShows'); + $this->addRelation('CcShow', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'outro_playlist_id', ), 'SET NULL', null, 'CcShows'); $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null, 'CcPlaylistcontentss'); } // buildRelations() diff --git a/legacy/application/models/airtime/map/CcShowTableMap.php b/legacy/application/models/airtime/map/CcShowTableMap.php index 95116bc794..0c88eaad26 100644 --- a/legacy/application/models/airtime/map/CcShowTableMap.php +++ b/legacy/application/models/airtime/map/CcShowTableMap.php @@ -56,6 +56,10 @@ public function initialize() $this->addColumn('has_autoplaylist', 'DbHasAutoPlaylist', 'BOOLEAN', true, null, false); $this->addForeignKey('autoplaylist_id', 'DbAutoPlaylistId', 'INTEGER', 'cc_playlist', 'id', false, null, null); $this->addColumn('autoplaylist_repeat', 'DbAutoPlaylistRepeat', 'BOOLEAN', true, null, false); + $this->addColumn('override_intro_playlist', 'DbOverrideIntroPlaylist', 'BOOLEAN', true, null, false); + $this->addForeignKey('intro_playlist_id', 'DbIntroPlaylistId', 'INTEGER', 'cc_playlist', 'id', false, null, null); + $this->addColumn('override_outro_playlist', 'DbOverrideOutroPlaylist', 'BOOLEAN', true, null, false); + $this->addForeignKey('outro_playlist_id', 'DbOutroPlaylistId', 'INTEGER', 'cc_playlist', 'id', false, null, null); // validators } // initialize() @@ -65,6 +69,8 @@ public function initialize() public function buildRelations() { $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('autoplaylist_id' => 'id', ), 'SET NULL', null); + $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('intro_playlist_id' => 'id', ), 'SET NULL', null); + $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('outro_playlist_id' => 'id', ), 'SET NULL', null); $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null, 'CcShowInstancess'); $this->addRelation('CcShowDays', 'CcShowDays', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null, 'CcShowDayss'); $this->addRelation('CcShowRebroadcast', 'CcShowRebroadcast', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null, 'CcShowRebroadcasts'); diff --git a/legacy/application/models/airtime/om/BaseCcShow.php b/legacy/application/models/airtime/om/BaseCcShow.php index 470c782053..34c46fdfd6 100644 --- a/legacy/application/models/airtime/om/BaseCcShow.php +++ b/legacy/application/models/airtime/om/BaseCcShow.php @@ -141,6 +141,32 @@ abstract class BaseCcShow extends BaseObject implements Persistent */ protected $autoplaylist_repeat; + /** + * The value for the override_intro_playlist field. + * Note: this column has a database default value of: false + * @var boolean + */ + protected $override_intro_playlist; + + /** + * The value for the intro_playlist_id field. + * @var int + */ + protected $intro_playlist_id; + + /** + * The value for the override_outro_playlist field. + * Note: this column has a database default value of: false + * @var boolean + */ + protected $override_outro_playlist; + + /** + * The value for the outro_playlist_id field. + * @var int + */ + protected $outro_playlist_id; + /** * @var CcPlaylist */ @@ -232,6 +258,8 @@ public function applyDefaultValues() $this->image_path = ''; $this->has_autoplaylist = false; $this->autoplaylist_repeat = false; + $this->override_intro_playlist = false; + $this->override_outro_playlist = false; } /** @@ -431,6 +459,51 @@ public function getDbAutoPlaylistRepeat() return $this->autoplaylist_repeat; } + /** + * Get the [override_intro_playlist] column value. + * + * @return boolean + */ + public function getDbOverrideIntroPlaylist() + { + + return $this->override_intro_playlist; + } + + /** + * Get the [intro_playlist_id] column value. + * + * @return int + */ + public function getDbIntroPlaylistId() + { + + return $this->intro_playlist_id; + } + + /** + * Get the [override_outro_playlist] column value. + * + * @return boolean + */ + public function getDbOverrideOutroPlaylist() + { + + return $this->override_outro_playlist; + } + + /** + * Get the [outro_playlist_id] column value. + * + * @return int + */ + + public function getDbOutroPlaylistId() + { + + return $this->outro_playlist_id; + } + /** * Set the value of [id] column. * @@ -840,6 +913,101 @@ public function setDbAutoPlaylistRepeat($v) return $this; } // setDbAutoPlaylistRepeat() + /** + * Sets the value of the [override_intro_playlist] column. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * + * @param boolean|integer|string $v The new value + * @return CcShow The current object (for fluent API support) + */ + public function setDbOverrideIntroPlaylist($v) + { + if ($v !== null) { + if (is_string($v)) { + $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } else { + $v = (boolean) $v; + } + } + + if ($this->override_intro_playlist !== $v) { + $this->override_intro_playlist = $v; + $this->modifiedColumns[] = CcShowPeer::OVERRIDE_INTRO_PLAYLIST; + } + } + + /** + * Set the value of [intro_playlist_id] column. + * + * @param int $v new value + * @return CcShow The current object (for fluent API support) + */ + + public function setDbIntroPlaylistId($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->intro_playlist_id !== $v) { + $this->intro_playlist_id = $v; + $this->modifiedColumns[] = CcShowPeer::INTRO_PLAYLIST_ID; + } + + return $this; + } // setDbIntroPlaylistId() + + /** + * Sets the value of the [override_outro_playlist] column. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * + * @param boolean|integer|string $v The new value + * @return CcShow The current object (for fluent API support) + */ + + public function setDbOverrideOutroPlaylist($v) + { + if ($v !== null) { + if (is_string($v)) { + $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } else { + $v = (boolean) $v; + } + } + + if ($this->override_outro_playlist !== $v) { + $this->override_outro_playlist = $v; + $this->modifiedColumns[] = CcShowPeer::OVERRIDE_OUTRO_PLAYLIST; + } + } + + /** + * Set the value of [outro_playlist_id] column. + * + * @param int $v new value + * @return CcShow The current object (for fluent API support) + */ + + public function setDbOutroPlaylistId($v) + { + if ($v !== null && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->outro_playlist_id !== $v) { + $this->outro_playlist_id = $v; + $this->modifiedColumns[] = CcShowPeer::OUTRO_PLAYLIST_ID; + } + + return $this; + } // setDbOutroPlaylistId() + /** * Indicates whether the columns in this object are only set to default values. * @@ -890,6 +1058,14 @@ public function hasOnlyDefaultValues() return false; } + if ($this->override_intro_playlist !== false) { + return false; + } + + if ($this->override_outro_playlist !== false) { + return false; + } + // otherwise, everything was equal, so return true return true; } // hasOnlyDefaultValues() @@ -929,6 +1105,10 @@ public function hydrate($row, $startcol = 0, $rehydrate = false) $this->has_autoplaylist = ($row[$startcol + 14] !== null) ? (boolean) $row[$startcol + 14] : null; $this->autoplaylist_id = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null; $this->autoplaylist_repeat = ($row[$startcol + 16] !== null) ? (boolean) $row[$startcol + 16] : null; + $this->override_intro_playlist = ($row[$startcol + 17] !== null) ? (boolean) $row[$startcol + 17] : null; + $this->intro_playlist_id = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null; + $this->override_outro_playlist = ($row[$startcol + 19] !== null) ? (boolean) $row[$startcol + 19] : null; + $this->outro_playlist_id = ($row[$startcol + 20] !== null) ? (int) $row[$startcol + 20] : null; $this->resetModified(); $this->setNew(false); @@ -938,7 +1118,7 @@ public function hydrate($row, $startcol = 0, $rehydrate = false) } $this->postHydrate($row, $startcol, $rehydrate); - return $startcol + 17; // 17 = CcShowPeer::NUM_HYDRATE_COLUMNS. + return $startcol + 21; // 21 = CcShowPeer::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating CcShow object", $e); @@ -1303,6 +1483,18 @@ protected function doInsert(PropelPDO $con) if ($this->isColumnModified(CcShowPeer::AUTOPLAYLIST_REPEAT)) { $modifiedColumns[':p' . $index++] = '"autoplaylist_repeat"'; } + if ($this->isColumnModified(CcShowPeer::OVERRIDE_INTRO_PLAYLIST)) { + $modifiedColumns[':p' . $index++] = '"override_intro_playlist"'; + } + if ($this->isColumnModified(CcShowPeer::INTRO_PLAYLIST_ID)) { + $modifiedColumns[':p' . $index++] = '"intro_playlist_id"'; + } + if ($this->isColumnModified(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST)) { + $modifiedColumns[':p' . $index++] = '"override_outro_playlist"'; + } + if ($this->isColumnModified(CcShowPeer::OUTRO_PLAYLIST_ID)) { + $modifiedColumns[':p' . $index++] = '"outro_playlist_id"'; + } $sql = sprintf( 'INSERT INTO "cc_show" (%s) VALUES (%s)', @@ -1365,6 +1557,18 @@ protected function doInsert(PropelPDO $con) case '"autoplaylist_repeat"': $stmt->bindValue($identifier, $this->autoplaylist_repeat, PDO::PARAM_BOOL); break; + case '"override_intro_playlist"': + $stmt->bindValue($identifier, $this->override_intro_playlist, PDO::PARAM_BOOL); + break; + case '"intro_playlist_id"': + $stmt->bindValue($identifier, $this->intro_playlist_id, PDO::PARAM_INT); + break; + case '"override_outro_playlist"': + $stmt->bindValue($identifier, $this->override_outro_playlist, PDO::PARAM_BOOL); + break; + case '"outro_playlist_id"': + $stmt->bindValue($identifier, $this->outro_playlist_id, PDO::PARAM_INT); + break; } } $stmt->execute(); @@ -1587,6 +1791,18 @@ public function getByPosition($pos) case 16: return $this->getDbAutoPlaylistRepeat(); break; + case 17: + return $this->getDbOverrideIntroPlaylist(); + break; + case 18: + return $this->getDbIntroPlaylistId(); + break; + case 19: + return $this->getDbOverrideOutroPlaylist(); + break; + case 20: + return $this->getDbOutroPlaylistId(); + break; default: return null; break; @@ -1633,6 +1849,10 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColum $keys[14] => $this->getDbHasAutoPlaylist(), $keys[15] => $this->getDbAutoPlaylistId(), $keys[16] => $this->getDbAutoPlaylistRepeat(), + $keys[17] => $this->getDbOverrideIntroPlaylist(), + $keys[18] => $this->getDbIntroPlaylistId(), + $keys[19] => $this->getDbOverrideOutroPlaylist(), + $keys[20] => $this->getDbOutroPlaylistId(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -1740,6 +1960,18 @@ public function setByPosition($pos, $value) case 16: $this->setDbAutoPlaylistRepeat($value); break; + case 17: + $this->setDbOverrideIntroPlaylist($value); + break; + case 18: + $this->setDbIntroPlaylistId($value); + break; + case 19: + $this->setDbOverrideOutroPlaylist($value); + break; + case 20: + $this->setDbOutroPlaylistId($value); + break; } // switch() } @@ -1781,6 +2013,10 @@ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) if (array_key_exists($keys[14], $arr)) $this->setDbHasAutoPlaylist($arr[$keys[14]]); if (array_key_exists($keys[15], $arr)) $this->setDbAutoPlaylistId($arr[$keys[15]]); if (array_key_exists($keys[16], $arr)) $this->setDbAutoPlaylistRepeat($arr[$keys[16]]); + if (array_key_exists($keys[17], $arr)) $this->setDbOverrideIntroPlaylist($arr[$keys[17]]); + if (array_key_exists($keys[18], $arr)) $this->setDbIntroPlaylistId($arr[$keys[18]]); + if (array_key_exists($keys[19], $arr)) $this->setDbOverrideOutroPlaylist($arr[$keys[19]]); + if (array_key_exists($keys[20], $arr)) $this->setDbOutroPlaylistId($arr[$keys[20]]); } /** @@ -1809,6 +2045,10 @@ public function buildCriteria() if ($this->isColumnModified(CcShowPeer::HAS_AUTOPLAYLIST)) $criteria->add(CcShowPeer::HAS_AUTOPLAYLIST, $this->has_autoplaylist); if ($this->isColumnModified(CcShowPeer::AUTOPLAYLIST_ID)) $criteria->add(CcShowPeer::AUTOPLAYLIST_ID, $this->autoplaylist_id); if ($this->isColumnModified(CcShowPeer::AUTOPLAYLIST_REPEAT)) $criteria->add(CcShowPeer::AUTOPLAYLIST_REPEAT, $this->autoplaylist_repeat); + if ($this->isColumnModified(CcShowPeer::OVERRIDE_INTRO_PLAYLIST)) $criteria->add(CcShowPeer::OVERRIDE_INTRO_PLAYLIST, $this->override_intro_playlist); + if ($this->isColumnModified(CcShowPeer::INTRO_PLAYLIST_ID)) $criteria->add(CcShowPeer::INTRO_PLAYLIST_ID, $this->intro_playlist_id); + if ($this->isColumnModified(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST)) $criteria->add(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST, $this->override_outro_playlist); + if ($this->isColumnModified(CcShowPeer::OUTRO_PLAYLIST_ID)) $criteria->add(CcShowPeer::OUTRO_PLAYLIST_ID, $this->outro_playlist_id); return $criteria; } @@ -1888,6 +2128,10 @@ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) $copyObj->setDbHasAutoPlaylist($this->getDbHasAutoPlaylist()); $copyObj->setDbAutoPlaylistId($this->getDbAutoPlaylistId()); $copyObj->setDbAutoPlaylistRepeat($this->getDbAutoPlaylistRepeat()); + $copyObj->setDbOverrideIntroPlaylist($this->getDbOverrideIntroPlaylist()); + $copyObj->setDbIntroPlaylistId($this->getDbIntroPlaylistId()); + $copyObj->setDbOverrideOutroPlaylist($this->getDbOverrideOutroPlaylist()); + $copyObj->setDbOutroPlaylistId($this->getDbOutroPlaylistId()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of @@ -3044,6 +3288,10 @@ public function clear() $this->has_autoplaylist = null; $this->autoplaylist_id = null; $this->autoplaylist_repeat = null; + $this->override_intro_playlist = null; + $this->intro_playlist_id = null; + $this->override_outro_playlist = null; + $this->outro_playlist_id = null; $this->alreadyInSave = false; $this->alreadyInValidation = false; $this->alreadyInClearAllReferencesDeep = false; diff --git a/legacy/application/models/airtime/om/BaseCcShowPeer.php b/legacy/application/models/airtime/om/BaseCcShowPeer.php index d34d3f0a2c..1beadf35a2 100644 --- a/legacy/application/models/airtime/om/BaseCcShowPeer.php +++ b/legacy/application/models/airtime/om/BaseCcShowPeer.php @@ -24,13 +24,13 @@ abstract class BaseCcShowPeer const TM_CLASS = 'CcShowTableMap'; /** The total number of columns. */ - const NUM_COLUMNS = 17; + const NUM_COLUMNS = 21; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; /** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 17; + const NUM_HYDRATE_COLUMNS = 21; /** the column name for the id field */ const ID = 'cc_show.id'; @@ -83,6 +83,18 @@ abstract class BaseCcShowPeer /** the column name for the autoplaylist_repeat field */ const AUTOPLAYLIST_REPEAT = 'cc_show.autoplaylist_repeat'; + /** the column name for the override_intro_playlist field */ + const OVERRIDE_INTRO_PLAYLIST = 'cc_show.override_intro_playlist'; + + /** the column name for the intro_playlist_id field */ + const INTRO_PLAYLIST_ID = 'cc_show.intro_playlist_id'; + + /** the column name for the override_outro_playlist field */ + const OVERRIDE_OUTRO_PLAYLIST = 'cc_show.override_outro_playlist'; + + /** the column name for the outro_playlist_id field */ + const OUTRO_PLAYLIST_ID = 'cc_show.outro_playlist_id'; + /** The default string format for model objects of the related table **/ const DEFAULT_STRING_FORMAT = 'YAML'; @@ -102,12 +114,12 @@ abstract class BaseCcShowPeer * e.g. CcShowPeer::$fieldNames[CcShowPeer::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', 'DbImagePath', 'DbHasAutoPlaylist', 'DbAutoPlaylistId', 'DbAutoPlaylistRepeat', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', 'dbImagePath', 'dbHasAutoPlaylist', 'dbAutoPlaylistId', 'dbAutoPlaylistRepeat', ), - BasePeer::TYPE_COLNAME => array (CcShowPeer::ID, CcShowPeer::NAME, CcShowPeer::URL, CcShowPeer::GENRE, CcShowPeer::DESCRIPTION, CcShowPeer::COLOR, CcShowPeer::BACKGROUND_COLOR, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, CcShowPeer::LIVE_STREAM_USER, CcShowPeer::LIVE_STREAM_PASS, CcShowPeer::LINKED, CcShowPeer::IS_LINKABLE, CcShowPeer::IMAGE_PATH, CcShowPeer::HAS_AUTOPLAYLIST, CcShowPeer::AUTOPLAYLIST_ID, CcShowPeer::AUTOPLAYLIST_REPEAT, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', 'IMAGE_PATH', 'HAS_AUTOPLAYLIST', 'AUTOPLAYLIST_ID', 'AUTOPLAYLIST_REPEAT', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', 'image_path', 'has_autoplaylist', 'autoplaylist_id', 'autoplaylist_repeat', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ) + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', 'DbImagePath', 'DbHasAutoPlaylist', 'DbAutoPlaylistId', 'DbAutoPlaylistRepeat', 'DbOverrideIntroPlaylist', 'DbIntroPlaylistId', 'DbOverrideOutroPlaylist', 'DbOutroPlaylistId',), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', 'dbImagePath', 'dbHasAutoPlaylist', 'dbAutoPlaylistId', 'dbAutoPlaylistRepeat', 'dbOverrideIntroPlaylist', 'dbIntroPlaylistId', 'dbOverrideOutroPlaylist', 'dbOutroPlaylistId',), + BasePeer::TYPE_COLNAME => array (CcShowPeer::ID, CcShowPeer::NAME, CcShowPeer::URL, CcShowPeer::GENRE, CcShowPeer::DESCRIPTION, CcShowPeer::COLOR, CcShowPeer::BACKGROUND_COLOR, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, CcShowPeer::LIVE_STREAM_USER, CcShowPeer::LIVE_STREAM_PASS, CcShowPeer::LINKED, CcShowPeer::IS_LINKABLE, CcShowPeer::IMAGE_PATH, CcShowPeer::HAS_AUTOPLAYLIST, CcShowPeer::AUTOPLAYLIST_ID, CcShowPeer::AUTOPLAYLIST_REPEAT, CCShowPeer::OVERRIDE_INTRO_PLAYLIST, CCShowPeer::INTRO_PLAYLIST_ID, CCShowPeer::OVERRIDE_OUTRO_PLAYLIST, CCShowPeer::OUTRO_PLAYLIST_ID, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', 'IMAGE_PATH', 'HAS_AUTOPLAYLIST', 'AUTOPLAYLIST_ID', 'AUTOPLAYLIST_REPEAT', 'OVERRIDE_INTRO_PLAYLIST', 'INTRO_PLAYLIST_ID', 'OVERRIDE_OUTRO_PLAYLIST', 'OUTRO_PLAYLIST_ID',), + BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', 'image_path', 'has_autoplaylist', 'autoplaylist_id', 'autoplaylist_repeat', 'override_intro_playlist', 'intro_playlist_id', 'override_outro_playlist', 'outro_playlist_id',), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) ); /** @@ -117,12 +129,12 @@ abstract class BaseCcShowPeer * e.g. CcShowPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, 'DbLinked' => 11, 'DbIsLinkable' => 12, 'DbImagePath' => 13, 'DbHasAutoPlaylist' => 14, 'DbAutoPlaylistId' => 15, 'DbAutoPlaylistRepeat' => 16, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, 'dbLinked' => 11, 'dbIsLinkable' => 12, 'dbImagePath' => 13, 'dbHasAutoPlaylist' => 14, 'dbAutoPlaylistId' => 15, 'dbAutoPlaylistRepeat' => 16, ), - BasePeer::TYPE_COLNAME => array (CcShowPeer::ID => 0, CcShowPeer::NAME => 1, CcShowPeer::URL => 2, CcShowPeer::GENRE => 3, CcShowPeer::DESCRIPTION => 4, CcShowPeer::COLOR => 5, CcShowPeer::BACKGROUND_COLOR => 6, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH => 7, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH => 8, CcShowPeer::LIVE_STREAM_USER => 9, CcShowPeer::LIVE_STREAM_PASS => 10, CcShowPeer::LINKED => 11, CcShowPeer::IS_LINKABLE => 12, CcShowPeer::IMAGE_PATH => 13, CcShowPeer::HAS_AUTOPLAYLIST => 14, CcShowPeer::AUTOPLAYLIST_ID => 15, CcShowPeer::AUTOPLAYLIST_REPEAT => 16, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, 'IMAGE_PATH' => 13, 'HAS_AUTOPLAYLIST' => 14, 'AUTOPLAYLIST_ID' => 15, 'AUTOPLAYLIST_REPEAT' => 16, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, 'image_path' => 13, 'has_autoplaylist' => 14, 'autoplaylist_id' => 15, 'autoplaylist_repeat' => 16, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ) + BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, 'DbLinked' => 11, 'DbIsLinkable' => 12, 'DbImagePath' => 13, 'DbHasAutoPlaylist' => 14, 'DbAutoPlaylistId' => 15, 'DbAutoPlaylistRepeat' => 16, 'DbOverrideIntroPlaylist' => 17, 'DbIntroPlaylistId' => 18, 'DbOverrideOutroPlaylist' => 19, 'DbOutroPlaylistId' => 20, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, 'dbLinked' => 11, 'dbIsLinkable' => 12, 'dbImagePath' => 13, 'dbHasAutoPlaylist' => 14, 'dbAutoPlaylistId' => 15, 'dbAutoPlaylistRepeat' => 16, 'dbOverrideIntroPlaylist' => 17, 'dbIntroPlaylistId' => 18, 'dbOverrideOutroPlaylist' => 19, 'dbOutroPlaylistId' => 20, ), + BasePeer::TYPE_COLNAME => array (CcShowPeer::ID => 0, CcShowPeer::NAME => 1, CcShowPeer::URL => 2, CcShowPeer::GENRE => 3, CcShowPeer::DESCRIPTION => 4, CcShowPeer::COLOR => 5, CcShowPeer::BACKGROUND_COLOR => 6, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH => 7, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH => 8, CcShowPeer::LIVE_STREAM_USER => 9, CcShowPeer::LIVE_STREAM_PASS => 10, CcShowPeer::LINKED => 11, CcShowPeer::IS_LINKABLE => 12, CcShowPeer::IMAGE_PATH => 13, CcShowPeer::HAS_AUTOPLAYLIST => 14, CcShowPeer::AUTOPLAYLIST_ID => 15, CcShowPeer::AUTOPLAYLIST_REPEAT => 16, CcShowPeer::OVERRIDE_INTRO_PLAYLIST => 17, CcShowPeer::INTRO_PLAYLIST_ID => 18, CcShowPeer::OVERRIDE_OUTRO_PLAYLIST => 19, CcShowPeer::OUTRO_PLAYLIST_ID => 20, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, 'IMAGE_PATH' => 13, 'HAS_AUTOPLAYLIST' => 14, 'AUTOPLAYLIST_ID' => 15, 'AUTOPLAYLIST_REPEAT' => 16, 'OVERRIDE_INTRO_PLAYLIST' => 17, 'INTRO_PLAYLIST_ID' => 18, 'OVERRIDE_OUTRO_PLAYLIST' => 19, 'OUTRO_PLAYLIST_ID' => 20,), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, 'image_path' => 13, 'has_autoplaylist' => 14, 'autoplaylist_id' => 15, 'autoplaylist_repeat' => 16, 'override_intro_playlist' => 17, 'intro_playlist_id' => 18, 'override_outro_playlist' => 19, 'outro_playlist_id' => 20,), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) ); /** @@ -213,6 +225,10 @@ public static function addSelectColumns(Criteria $criteria, $alias = null) $criteria->addSelectColumn(CcShowPeer::HAS_AUTOPLAYLIST); $criteria->addSelectColumn(CcShowPeer::AUTOPLAYLIST_ID); $criteria->addSelectColumn(CcShowPeer::AUTOPLAYLIST_REPEAT); + $criteria->addSelectColumn(CcShowPeer::OVERRIDE_INTRO_PLAYLIST); + $criteria->addSelectColumn(CcShowPeer::INTRO_PLAYLIST_ID); + $criteria->addSelectColumn(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST); + $criteria->addSelectColumn(CcShowPeer::OUTRO_PLAYLIST_ID); } else { $criteria->addSelectColumn($alias . '.id'); $criteria->addSelectColumn($alias . '.name'); @@ -231,6 +247,10 @@ public static function addSelectColumns(Criteria $criteria, $alias = null) $criteria->addSelectColumn($alias . '.has_autoplaylist'); $criteria->addSelectColumn($alias . '.autoplaylist_id'); $criteria->addSelectColumn($alias . '.autoplaylist_repeat'); + $criteria->addSelectColumn($alias . '.override_intro_playlist'); + $criteria->addSelectColumn($alias . '.intro_playlist_id'); + $criteria->addSelectColumn($alias . '.override_outro_playlist'); + $criteria->addSelectColumn($alias . '.outro_playlist_id'); } } @@ -581,6 +601,8 @@ public static function doCountJoinCcPlaylist(Criteria $criteria, $distinct = fal } $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doCount($criteria, $con); @@ -618,6 +640,8 @@ public static function doSelectJoinCcPlaylist(Criteria $criteria, $con = null, $ CcPlaylistPeer::addSelectColumns($criteria); $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doSelect($criteria, $con); $results = array(); @@ -699,6 +723,8 @@ public static function doCountJoinAll(Criteria $criteria, $distinct = false, Pro } $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doCount($criteria, $con); @@ -738,6 +764,8 @@ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_be $startcol3 = $startcol2 + CcPlaylistPeer::NUM_HYDRATE_COLUMNS; $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doSelect($criteria, $con); $results = array(); diff --git a/legacy/application/models/airtime/om/BaseCcShowQuery.php b/legacy/application/models/airtime/om/BaseCcShowQuery.php index 7f5976c633..9985f198b9 100644 --- a/legacy/application/models/airtime/om/BaseCcShowQuery.php +++ b/legacy/application/models/airtime/om/BaseCcShowQuery.php @@ -23,6 +23,10 @@ * @method CcShowQuery orderByDbHasAutoPlaylist($order = Criteria::ASC) Order by the has_autoplaylist column * @method CcShowQuery orderByDbAutoPlaylistId($order = Criteria::ASC) Order by the autoplaylist_id column * @method CcShowQuery orderByDbAutoPlaylistRepeat($order = Criteria::ASC) Order by the autoplaylist_repeat column + * @method CcShowQuery orderByDbOverrideIntroPlaylist($order = Criteria::ASC) Order by the override_intro_playlist column + * @method CcShowQuery orderByDbIntroPlaylistId($order = Criteria::ASC) Order by the intro_playlist_id column + * @method CcShowQuery orderByDbOverrideOutroPlaylist($order = Criteria::ASC) Order by the override_outro_playlist column + * @method CcShowQuery orderByDbOutroPlaylistId($order = Criteria::ASC) Order by the outro_playlist_id column * * @method CcShowQuery groupByDbId() Group by the id column * @method CcShowQuery groupByDbName() Group by the name column @@ -41,6 +45,10 @@ * @method CcShowQuery groupByDbHasAutoPlaylist() Group by the has_autoplaylist column * @method CcShowQuery groupByDbAutoPlaylistId() Group by the autoplaylist_id column * @method CcShowQuery groupByDbAutoPlaylistRepeat() Group by the autoplaylist_repeat column + * @method CcShowQuery groupByDbOverrideIntroPlaylist() Group by the override_intro_playlist column + * @method CcShowQuery groupByDbIntroPlaylistId() Group by the intro_playlist_id column + * @method CcShowQuery groupByDbOverrideOutroPlaylist() Group by the override_outro_playlist column + * @method CcShowQuery groupByDbOutroPlaylistId() Group by the outro_playlist_id column * * @method CcShowQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcShowQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query @@ -85,6 +93,10 @@ * @method CcShow findOneByDbHasAutoPlaylist(boolean $has_autoplaylist) Return the first CcShow filtered by the has_autoplaylist column * @method CcShow findOneByDbAutoPlaylistId(int $autoplaylist_id) Return the first CcShow filtered by the autoplaylist_id column * @method CcShow findOneByDbAutoPlaylistRepeat(boolean $autoplaylist_repeat) Return the first CcShow filtered by the autoplaylist_repeat column + * @method CcShow findOneByDbOverrideIntroPlaylist(boolean $override_intro_playlist) Return the first CcShow filtered by the override_intro_playlist column + * @method CcShow findOneByDbIntroPlaylistId(int $intro_playlist_id) Return the first CcShow filtered by the intro_playlist_id column + * @method CcShow findOneByDbOverrideOutroPlaylist(boolean $override_outro_playlist) Return the first CcShow filtered by the override_outro_playlist column + * @method CcShow findOneByDbOutroPlaylistId(int $outro_playlist_id) Return the first CcShow filtered by the outro_playlist_id column * * @method array findByDbId(int $id) Return CcShow objects filtered by the id column * @method array findByDbName(string $name) Return CcShow objects filtered by the name column @@ -103,6 +115,10 @@ * @method array findByDbHasAutoPlaylist(boolean $has_autoplaylist) Return CcShow objects filtered by the has_autoplaylist column * @method array findByDbAutoPlaylistId(int $autoplaylist_id) Return CcShow objects filtered by the autoplaylist_id column * @method array findByDbAutoPlaylistRepeat(boolean $autoplaylist_repeat) Return CcShow objects filtered by the autoplaylist_repeat column + * @method array findByDbOverrideIntroPlaylist(boolean $override_intro_playlist) Return CcShow objects filtered by the override_intro_playlist column + * @method array findByDbIntroPlaylistId(int $intro_playlist_id) Return CcShow objects filtered by the intro_playlist_id column + * @method array findByDbOverrideOutroPlaylist(boolean $override_outro_playlist) Return CcShow objects filtered by the override_outro_playlist column + * @method array findByDbOutroPlaylistId(int $outro_playlist_id) Return CcShow objects filtered by the outro_playlist_id column * * @package propel.generator.airtime.om */ @@ -210,7 +226,7 @@ public function findOneByDbId($key, $con = null) */ protected function findPkSimple($key, $con) { - $sql = 'SELECT "id", "name", "url", "genre", "description", "color", "background_color", "live_stream_using_airtime_auth", "live_stream_using_custom_auth", "live_stream_user", "live_stream_pass", "linked", "is_linkable", "image_path", "has_autoplaylist", "autoplaylist_id", "autoplaylist_repeat" FROM "cc_show" WHERE "id" = :p0'; + $sql = 'SELECT "id", "name", "url", "genre", "description", "color", "background_color", "live_stream_using_airtime_auth", "live_stream_using_custom_auth", "live_stream_user", "live_stream_pass", "linked", "is_linkable", "image_path", "has_autoplaylist", "autoplaylist_id", "autoplaylist_repeat", "override_intro_playlist", "intro_playlist_id", "override_outro_playlist", "outro_playlist_id" FROM "cc_show" WHERE "id" = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -808,6 +824,148 @@ public function filterByDbAutoPlaylistRepeat($dbAutoPlaylistRepeat = null, $comp return $this->addUsingAlias(CcShowPeer::AUTOPLAYLIST_REPEAT, $dbAutoPlaylistRepeat, $comparison); } + /** + * Filter the query on the override_intro_playlist column + * + * Example usage: + * + * $query->filterByDbOverrideIntroPlaylist(true); // WHERE override_intro_playlist = true + * $query->filterByDbOverrideIntroPlaylist('yes'); // WHERE override_intro_playlist = true + * + * + * @param boolean|string $dbOverrideIntroPlaylist The value to use as filter. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowQuery The current query, for fluid interface + */ + public function filterByDbOverrideIntroPlaylist($dbOverrideIntroPlaylist = null, $comparison = null) + { + if (is_string($dbOverrideIntroPlaylist)) { + $dbOverrideIntroPlaylist = in_array(strtolower($dbOverrideIntroPlaylist), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } + + return $this->addUsingAlias(CcShowPeer::OVERRIDE_INTRO_PLAYLIST, $dbOverrideIntroPlaylist, $comparison); + } + + /** + * Filter the query on the intro_playlist_id column + * + * Example usage: + * + * $query->filterByDbIntroPlaylistId(1234); // WHERE intro_playlist_id = 1234 + * $query->filterByDbIntroPlaylistId(array(12, 34)); // WHERE intro_playlist_id IN (12, 34) + * $query->filterByDbIntroPlaylistId(array('min' => 12)); // WHERE intro_playlist_id >= 12 + * $query->filterByDbIntroPlaylistId(array('max' => 12)); // WHERE intro_playlist_id <= 12 + * + * + * @see filterByCcPlaylist() + * + * @param mixed $dbIntroPlaylistId The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowQuery The current query, for fluid interface + */ + public function filterByDbIntroPlaylistId($dbIntroPlaylistId = null, $comparison = null) + { + if (is_array($dbIntroPlaylistId)) { + $useMinMax = false; + if (isset($dbIntroPlaylistId['min'])) { + $this->addUsingAlias(CcShowPeer::INTRO_PLAYLIST_ID, $dbIntroPlaylistId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbIntroPlaylistId['max'])) { + $this->addUsingAlias(CcShowPeer::INTRO_PLAYLIST_ID, $dbIntroPlaylistId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CcShowPeer::INTRO_PLAYLIST_ID, $dbIntroPlaylistId, $comparison); + } + + /** + * Filter the query on the override_outro_playlist column + * + * Example usage: + * + * $query->filterByDbOverrideOutroPlaylist(true); // WHERE override_outro_playlist = true + * $query->filterByDbOverrideOutroPlaylist('yes'); // WHERE override_outro_playlist = true + * + * + * @param boolean|string $dbOverrideOutroPlaylist The value to use as filter. + * Non-boolean arguments are converted using the following rules: + * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true + * * 0, '0', 'false', 'off', and 'no' are converted to boolean false + * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowQuery The current query, for fluid interface + */ + public function filterByDbOverrideOutroPlaylist($dbOverrideOutroPlaylist = null, $comparison = null) + { + if (is_string($dbOverrideOutroPlaylist)) { + $dbOverrideOutroPlaylist = in_array(strtolower($dbOverrideOutroPlaylist), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; + } + + return $this->addUsingAlias(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST, $dbOverrideOutroPlaylist, $comparison); + } + + /** + * Filter the query on the outro_playlist_id column + * + * Example usage: + * + * $query->filterByDbOutroPlaylistId(1234); // WHERE outro_playlist_id = 1234 + * $query->filterByDbOutroPlaylistId(array(12, 34)); // WHERE outro_playlist_id IN (12, 34) + * $query->filterByDbOutroPlaylistId(array('min' => 12)); // WHERE outro_playlist_id >= 12 + * $query->filterByDbOutroPlaylistId(array('max' => 12)); // WHERE outro_playlist_id <= 12 + * + * + * @see filterByCcPlaylist() + * + * @param mixed $dbOutroPlaylistId The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowQuery The current query, for fluid interface + */ + public function filterByDbOutroPlaylistId($dbOutroPlaylistId = null, $comparison = null) + { + if (is_array($dbOutroPlaylistId)) { + $useMinMax = false; + if (isset($dbOutroPlaylistId['min'])) { + $this->addUsingAlias(CcShowPeer::OUTRO_PLAYLIST_ID, $dbOutroPlaylistId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbOutroPlaylistId['max'])) { + $this->addUsingAlias(CcShowPeer::OUTRO_PLAYLIST_ID, $dbOutroPlaylistId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(CcShowPeer::OUTRO_PLAYLIST_ID, $dbOutroPlaylistId, $comparison); + } + /** * Filter the query by a related CcPlaylist object * diff --git a/legacy/application/services/ShowFormService.php b/legacy/application/services/ShowFormService.php index 3935a4189c..044e5114c8 100644 --- a/legacy/application/services/ShowFormService.php +++ b/legacy/application/services/ShowFormService.php @@ -164,6 +164,10 @@ private function populateFormAutoPlaylist($form) 'add_show_has_autoplaylist' => $this->ccShow->getDbHasAutoPlaylist() ? 1 : 0, 'add_show_autoplaylist_id' => $this->ccShow->getDbAutoPlaylistId(), 'add_show_autoplaylist_repeat' => $this->ccShow->getDbAutoPlaylistRepeat(), + 'add_show_override_intro_playlist' => $this->ccShow->getDbOverrideIntroPlaylist() ? 1 : 0, + 'add_show_intro_playlist_id' => $this->ccShow->getDbIntroPlaylistId(), + 'add_show_override_outro_playlist' => $this->ccShow->getDbOverrideOutroPlaylist() ? 1 : 0, + 'add_show_outro_playlist_id' => $this->ccShow->getDbOutroPlaylistId(), ] ); } diff --git a/legacy/application/services/ShowService.php b/legacy/application/services/ShowService.php index 3bedbcba8f..c49b51da60 100644 --- a/legacy/application/services/ShowService.php +++ b/legacy/application/services/ShowService.php @@ -1667,6 +1667,14 @@ public function setCcShow($showData) if ($showData['add_show_autoplaylist_id'] != '') { $ccShow->setDbAutoPlaylistId($showData['add_show_autoplaylist_id']); } + $ccShow->setDbOverrideIntroPlaylist($showData['add_show_override_intro_playlist'] == 1); + $ccShow->setDbOverrideOutroPlaylist($showData['add_show_override_outro_playlist'] == 1); + if ($showData['add_show_intro_playlist_id'] != '') { + $ccShow->setDbAutoPlaylistId($showData['add_show_intro_playlist_id']); + } + if ($showData['add_show_outro_playlist_id'] != '') { + $ccShow->setDbAutoPlaylistId($showData['add_show_outro_playlist_id']); + } // Here a user has edited a show and linked it. // We need to grab the existing show instances ids and fill their content diff --git a/legacy/application/views/scripts/form/add-show-autoplaylist.phtml b/legacy/application/views/scripts/form/add-show-autoplaylist.phtml index 684e532b6c..5cf8efb1a1 100644 --- a/legacy/application/views/scripts/form/add-show-autoplaylist.phtml +++ b/legacy/application/views/scripts/form/add-show-autoplaylist.phtml @@ -19,6 +19,7 @@
element->getElement('add_show_autoplaylist_id') ?> +
@@ -30,7 +31,42 @@ element->getElement('add_show_autoplaylist_repeat') ?>
- - +
+
+ +
+
+ element->getElement('add_show_override_intro_playlist') ?> +
+
+
+ +
+
+ element->getElement('add_show_intro_playlist_id') ?> +
+
+
+ +
+
+ element->getElement('add_show_override_outro_playlist') ?> +
+
+
+ +
+
+ element->getElement('add_show_outro_playlist_id') ?> +
+
diff --git a/legacy/public/js/airtime/schedule/add-show.js b/legacy/public/js/airtime/schedule/add-show.js index a4591b1a21..a59b029dfb 100644 --- a/legacy/public/js/airtime/schedule/add-show.js +++ b/legacy/public/js/airtime/schedule/add-show.js @@ -294,6 +294,18 @@ function setAddShowEvents(form) { $("#add_show_playlist_dropdown").show(); } + if (!form.find("#add_show_override_intro_playlist").attr("checked")) { + form.find("#add_show_override_intro_playlist_dropdown").hide(); + } else { + $("#add_show_override_intro_playlist_dropdown").show(); + } + + if (!form.find("#add_show_override_outro_playlist").attr("checked")) { + form.find("#add_show_override_outro_playlist_dropdown").hide(); + } else { + $("#add_show_override_outro_playlist_dropdown").show(); + } + if (!form.find("#add_show_repeats").attr("checked")) { form.find("#schedule-show-when > fieldset:last").hide(); $("#add_show_rebroadcast_relative").hide(); @@ -328,6 +340,16 @@ function setAddShowEvents(form) { form.find("#add_show_autoplaylist_repeat").toggle(); }); + form.find("#add_show_override_intro_playlist").click(function () { + $(this).blur(); + form.find("#add_show_override_intro_playlist_dropdown").toggle(); + }); + + form.find("#add_show_override_outro_playlist").click(function () { + $(this).blur(); + form.find("#add_show_override_outro_playlist_dropdown").toggle(); + }); + form.find("#add_show_repeats").click(function () { $(this).blur(); form.find("#schedule-show-when > fieldset:last").toggle(); From 7b67bd35ba500223a00ddd78af760f20d1fddcb7 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 7 Feb 2024 16:24:47 +0000 Subject: [PATCH 2/6] fix loading of lists --- legacy/application/common/AutoPlaylistManager.php | 13 +++++++++++-- legacy/application/models/Show.php | 8 ++++---- legacy/application/services/ShowService.php | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/legacy/application/common/AutoPlaylistManager.php b/legacy/application/common/AutoPlaylistManager.php index e504c30136..2354668aae 100644 --- a/legacy/application/common/AutoPlaylistManager.php +++ b/legacy/application/common/AutoPlaylistManager.php @@ -33,8 +33,17 @@ public static function buildAutoPlaylist() // call the addPlaylist to show function and don't check for user permission to avoid call to non-existant user object $sid = $si->getShowId(); $playlistrepeat = new Application_Model_Show($sid); - $introplaylistid = Application_Model_Preference::GetIntroPlaylist(); - $outroplaylistid = Application_Model_Preference::GetOutroPlaylist(); + if ($playlistrepeat->getHasOverrideIntroPlaylist()) { + $introplaylistid = $playlistrepeat->getIntroPlaylistId(); + } else { + $introplaylistid = Application_Model_Preference::GetIntroPlaylist(); + } + + if ($playlistrepeat->getHasOverrideOutroPlaylist()) { + $outroplaylistid = $playlistrepeat->getOutroPlaylistId(); + } else { + $outroplaylistid = Application_Model_Preference::GetOutroPlaylist(); + } // we want to check and see if we need to repeat this process until the show is 100% scheduled // so we create a while loop and break it immediately if repeat until full isn't enabled diff --git a/legacy/application/models/Show.php b/legacy/application/models/Show.php index 650f83f452..a934e72917 100644 --- a/legacy/application/models/Show.php +++ b/legacy/application/models/Show.php @@ -173,13 +173,13 @@ public function getHasOverrideIntroPlaylist() { $show = CcShowQuery::create()->findPK($this->_showId); - return $show->getDbHasOverrideIntroPlaylist(); + return $show->getDbOverrideIntroPlaylist(); } public function setHasOverrideIntroPlaylist($value) { $show = CcShowQuery::create()->findPK($this->_showId); - $show->setDbHasOverrideIntroPlaylist($value); + $show->setDbOverrideIntroPlaylist($value); } public function getIntroPlaylistId() @@ -199,13 +199,13 @@ public function getHasOverrideOutroPlaylist() { $show = CcShowQuery::create()->findPK($this->_showId); - return $show->getDbHasOverrideOutroPlaylist(); + return $show->getDbOverrideOutroPlaylist(); } public function setHasOverrideOutroPlaylist($value) { $show = CcShowQuery::create()->findPK($this->_showId); - $show->setDbHasOverrideOutroPlaylist($value); + $show->setDbOverrideOutroPlaylist($value); } public function getOutroPlaylistId() diff --git a/legacy/application/services/ShowService.php b/legacy/application/services/ShowService.php index c49b51da60..a0686fa5cc 100644 --- a/legacy/application/services/ShowService.php +++ b/legacy/application/services/ShowService.php @@ -1670,10 +1670,10 @@ public function setCcShow($showData) $ccShow->setDbOverrideIntroPlaylist($showData['add_show_override_intro_playlist'] == 1); $ccShow->setDbOverrideOutroPlaylist($showData['add_show_override_outro_playlist'] == 1); if ($showData['add_show_intro_playlist_id'] != '') { - $ccShow->setDbAutoPlaylistId($showData['add_show_intro_playlist_id']); + $ccShow->setDbIntroPlaylistId($showData['add_show_intro_playlist_id']); } if ($showData['add_show_outro_playlist_id'] != '') { - $ccShow->setDbAutoPlaylistId($showData['add_show_outro_playlist_id']); + $ccShow->setDbOutroPlaylistId($showData['add_show_outro_playlist_id']); } // Here a user has edited a show and linked it. From a18b443ef57ee5d36ab38a787a3cf71ea6112ab4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 7 Feb 2024 22:06:25 +0000 Subject: [PATCH 3/6] fix SQL statements --- .../migrations/0046_add_override_intro_outro_playlists.py | 4 ++-- api/libretime_api/legacy/migrations/sql/schema.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py b/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py index 3da4194359..3e2b04882f 100644 --- a/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py +++ b/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py @@ -7,10 +7,10 @@ UP = """ ALTER TABLE cc_show ADD COLUMN override_intro_playlist boolean default 'f' NOT NULL; ALTER TABLE cc_show ADD COLUMN intro_playlist_id integer DEFAULT NULL; -ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_intro_playlist_fkey FOREIGN KEY (intro_playlist_id) REFERENCES cc_playlist (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL; +ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_intro_playlist_fkey FOREIGN KEY (intro_playlist_id) REFERENCES cc_playlist (id) ON DELETE SET NULL; ALTER TABLE cc_show ADD COLUMN override_outro_playlist boolean default 'f' NOT NULL; ALTER TABLE cc_show ADD COLUMN outro_playlist_id integer DEFAULT NULL; -ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_outro_playlist_fkey FOREIGN KEY (outro_playlist_id) REFERENCES cc_playlist (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL; +ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_outro_playlist_fkey FOREIGN KEY (outro_playlist_id) REFERENCES cc_playlist (id) ON DELETE SET NULL; """ DOWN = """ diff --git a/api/libretime_api/legacy/migrations/sql/schema.sql b/api/libretime_api/legacy/migrations/sql/schema.sql index 8e238b1e03..47033018a2 100644 --- a/api/libretime_api/legacy/migrations/sql/schema.sql +++ b/api/libretime_api/legacy/migrations/sql/schema.sql @@ -722,12 +722,12 @@ ALTER TABLE "cc_show" ADD CONSTRAINT "cc_playlist_autoplaylist_fkey" REFERENCES "cc_playlist" ("id") ON DELETE SET NULL; -ALTER TABLE "cc_show" ADD CONSTRAINT "cc_show_intro_playlist_fkey" +ALTER TABLE "cc_show" ADD CONSTRAINT "cc_playlist_intro_playlist_fkey" FOREIGN KEY ("intro_playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE SET NULL; -ALTER TABLE "cc_show" ADD CONSTRAINT "cc_show_outro_playlist_fkey" +ALTER TABLE "cc_show" ADD CONSTRAINT "cc_playlist_outro_playlist_fkey" FOREIGN KEY ("outro_playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE SET NULL; From 639c0521fba14b486f5b89f368c3963f27271a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 8 Feb 2024 13:57:23 +0100 Subject: [PATCH 4/6] amends test for new database fields --- .../datasets/test_checkOverlappingShows.yml | 4 +++ .../services/database/ShowServiceDbTest.php | 4 +++ .../test_ccShowInsertedIntoDatabase.yml | 4 +++ ...hangeRepeatDayUpdatesScheduleCorrectly.yml | 4 +++ ...test_createBiWeeklyRepeatNoEndNoRRShow.yml | 4 +++ .../datasets/test_createLinkedShow.yml | 4 +++ ...reateMonthlyMonthlyRepeatNoEndNoRRShow.yml | 4 +++ ...createMonthlyWeeklyRepeatNoEndNoRRShow.yml | 4 +++ .../datasets/test_createNoRepeatNoRRShow.yml | 4 +++ .../datasets/test_createNoRepeatRRShow.yml | 4 +++ ...st_createQuadWeeklyRepeatNoEndNoRRShow.yml | 4 +++ ...est_createTriWeeklyRepeatNoEndNoRRShow.yml | 4 +++ .../test_createWeeklyRepeatNoEndNoRRShow.yml | 4 +++ .../test_createWeeklyRepeatRRShow.yml | 4 +++ .../datasets/test_deleteShowInstance.yml | 4 +++ ...test_deleteShowInstanceAndAllFollowing.yml | 4 +++ ...est_editRepeatingShowChangeNoEndOption.yml | 4 +++ .../test_editRepeatingShowInstance.yml | 4 +++ ...tRepeatShowDayUpdatesScheduleCorrectly.yml | 4 +++ ...CreationWhenUserMovesForwardInCalendar.yml | 4 +++ .../datasets/test_unlinkLinkedShow.yml | 4 +++ .../datasets/test_weeklyToBiWeekly.yml | 4 +++ .../datasets/test_weeklyToNoRepeat.yml | 4 +++ .../application/testdata/ShowServiceData.php | 28 +++++++++++++++++++ 24 files changed, 120 insertions(+) diff --git a/legacy/tests/application/models/database/datasets/test_checkOverlappingShows.yml b/legacy/tests/application/models/database/datasets/test_checkOverlappingShows.yml index 1973934b05..f6fdd4217c 100644 --- a/legacy/tests/application/models/database/datasets/test_checkOverlappingShows.yml +++ b/legacy/tests/application/models/database/datasets/test_checkOverlappingShows.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2014-01-05" diff --git a/legacy/tests/application/services/database/ShowServiceDbTest.php b/legacy/tests/application/services/database/ShowServiceDbTest.php index 682e1eee9d..a091e7d48e 100644 --- a/legacy/tests/application/services/database/ShowServiceDbTest.php +++ b/legacy/tests/application/services/database/ShowServiceDbTest.php @@ -77,6 +77,10 @@ public function testCcShowInsertedIntoDatabase() 'add_show_has_autoplaylist' => 0, 'add_show_autoplaylist_id' => null, 'add_show_autoplaylist_repeat' => 0, + 'add_show_override_intro_playlist' => 0, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => 0, + 'add_show_outro_playlist_id' => null, ]; $showService->setCcShow($data); diff --git a/legacy/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml b/legacy/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml index e7d2ed0aac..daf65a263d 100644 --- a/legacy/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml +++ b/legacy/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml @@ -16,3 +16,7 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null diff --git a/legacy/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml b/legacy/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml index 267de11c7b..e57c01a78d 100644 --- a/legacy/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml +++ b/legacy/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "2" first_show: "2044-01-30" diff --git a/legacy/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml index 7eceb68870..08282649e7 100644 --- a/legacy/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createLinkedShow.yml b/legacy/tests/application/services/database/datasets/test_createLinkedShow.yml index f22cdb2f18..7c89d4db98 100644 --- a/legacy/tests/application/services/database/datasets/test_createLinkedShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createLinkedShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml index 32414f3c8d..5a5ae1cc9c 100644 --- a/legacy/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml index 7ebbfff4e4..3c71c985e8 100644 --- a/legacy/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml index 7d54d580f4..d3885e5baa 100644 --- a/legacy/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml b/legacy/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml index 9a89a18dd7..61c3ed24b8 100644 --- a/legacy/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml index 7a1286cbb5..a50dadaa76 100644 --- a/legacy/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml index fa8198f74a..13f28703b4 100644 --- a/legacy/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml b/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml index c39af7a110..991f2c83c1 100644 --- a/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml b/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml index dd26a66f81..a64b10a4f3 100644 --- a/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml +++ b/legacy/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_deleteShowInstance.yml b/legacy/tests/application/services/database/datasets/test_deleteShowInstance.yml index 00ae0be88c..bc4313d793 100644 --- a/legacy/tests/application/services/database/datasets/test_deleteShowInstance.yml +++ b/legacy/tests/application/services/database/datasets/test_deleteShowInstance.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml b/legacy/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml index 34bcd6aefd..4dc96bdd81 100644 --- a/legacy/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml +++ b/legacy/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml b/legacy/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml index bc79d22840..f974deba98 100644 --- a/legacy/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml +++ b/legacy/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml b/legacy/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml index 378e3aef6a..a3ef3b291c 100644 --- a/legacy/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml +++ b/legacy/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml b/legacy/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml index 267de11c7b..e57c01a78d 100644 --- a/legacy/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml +++ b/legacy/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "2" first_show: "2044-01-30" diff --git a/legacy/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml b/legacy/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml index d7a6b85f4e..c575ca11b7 100644 --- a/legacy/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml +++ b/legacy/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_unlinkLinkedShow.yml b/legacy/tests/application/services/database/datasets/test_unlinkLinkedShow.yml index a80045af6d..c5f0b56249 100644 --- a/legacy/tests/application/services/database/datasets/test_unlinkLinkedShow.yml +++ b/legacy/tests/application/services/database/datasets/test_unlinkLinkedShow.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "1" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml b/legacy/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml index ae468aacb3..38b3c82b1e 100644 --- a/legacy/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml +++ b/legacy/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "2" first_show: "2044-01-01" diff --git a/legacy/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml b/legacy/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml index 1382e2eead..335d0b2513 100644 --- a/legacy/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml +++ b/legacy/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml @@ -16,6 +16,10 @@ cc_show: has_autoplaylist: false autoplaylist_id: null autoplaylist_repeat: false + override_intro_playlist: false + intro_playlist_id: null + override_outro_playlist: false + outro_playlist_id: null cc_show_days: - id: "2" first_show: "2044-01-01" diff --git a/legacy/tests/application/testdata/ShowServiceData.php b/legacy/tests/application/testdata/ShowServiceData.php index 55da33e273..49755f26f8 100644 --- a/legacy/tests/application/testdata/ShowServiceData.php +++ b/legacy/tests/application/testdata/ShowServiceData.php @@ -21,6 +21,10 @@ public static function getNoRepeatNoRRData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 0, 'add_show_linked' => 0, 'add_show_repeat_type' => 0, @@ -99,6 +103,10 @@ public static function getWeeklyRepeatNoEndNoRRData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 1, 'add_show_linked' => 0, 'add_show_repeat_type' => 0, @@ -177,6 +185,10 @@ public static function getWeeklyRepeatWithEndNoRRData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 1, 'add_show_linked' => 0, 'add_show_repeat_type' => 0, @@ -266,6 +278,10 @@ public static function getEditRepeatInstanceData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 0, 'add_show_linked' => 0, 'add_show_no_end' => 0, @@ -295,6 +311,10 @@ public static function getOverlappingShowCheckTestData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 1, 'add_show_linked' => 0, 'add_show_repeat_type' => 0, @@ -374,6 +394,10 @@ public static function getNoRepeatRRData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 0, 'add_show_linked' => 0, 'add_show_repeat_type' => 0, @@ -452,6 +476,10 @@ public static function getWeeklyRepeatRRData() 'add_show_has_autoplaylist' => false, 'add_show_autoplaylist_repeat' => false, 'add_show_autoplaylist_id' => null, + 'add_show_override_intro_playlist' => false, + 'add_show_intro_playlist_id' => null, + 'add_show_override_outro_playlist' => false, + 'add_show_outro_playlist_id' => null, 'add_show_repeats' => 1, 'add_show_linked' => 0, 'add_show_repeat_type' => 0, From 68971f8b9bc2bdcd7ce91c5868c4be43150e7698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 18 Feb 2024 20:19:05 +0100 Subject: [PATCH 5/6] update schema.xml and run propel --- legacy/application/configs/airtime-conf.php | 2 +- .../models/airtime/map/CcPlaylistTableMap.php | 6 +- .../models/airtime/map/CcShowTableMap.php | 6 +- .../models/airtime/om/BaseCcPlaylist.php | 770 +++++++++++++++--- .../models/airtime/om/BaseCcPlaylistPeer.php | 6 + .../models/airtime/om/BaseCcPlaylistQuery.php | 184 ++++- .../models/airtime/om/BaseCcShow.php | 238 +++++- .../models/airtime/om/BaseCcShowPeer.php | 599 +++++++++++++- .../models/airtime/om/BaseCcShowQuery.php | 192 ++++- legacy/build/schema.xml | 10 + 10 files changed, 1833 insertions(+), 180 deletions(-) diff --git a/legacy/application/configs/airtime-conf.php b/legacy/application/configs/airtime-conf.php index 378ae414d8..b3aa0fe500 100644 --- a/legacy/application/configs/airtime-conf.php +++ b/legacy/application/configs/airtime-conf.php @@ -1,7 +1,7 @@ [ 'airtime' => [ diff --git a/legacy/application/models/airtime/map/CcPlaylistTableMap.php b/legacy/application/models/airtime/map/CcPlaylistTableMap.php index 74dfbbbcd2..677af1de50 100644 --- a/legacy/application/models/airtime/map/CcPlaylistTableMap.php +++ b/legacy/application/models/airtime/map/CcPlaylistTableMap.php @@ -55,9 +55,9 @@ public function initialize() public function buildRelations() { $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcShow', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'autoplaylist_id', ), 'SET NULL', null, 'CcShows'); - $this->addRelation('CcShow', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'intro_playlist_id', ), 'SET NULL', null, 'CcShows'); - $this->addRelation('CcShow', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'outro_playlist_id', ), 'SET NULL', null, 'CcShows'); + $this->addRelation('CcShowRelatedByDbAutoPlaylistId', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'autoplaylist_id', ), 'SET NULL', null, 'CcShowsRelatedByDbAutoPlaylistId'); + $this->addRelation('CcShowRelatedByDbIntroPlaylistId', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'intro_playlist_id', ), 'SET NULL', null, 'CcShowsRelatedByDbIntroPlaylistId'); + $this->addRelation('CcShowRelatedByDbOutroPlaylistId', 'CcShow', RelationMap::ONE_TO_MANY, array('id' => 'outro_playlist_id', ), 'SET NULL', null, 'CcShowsRelatedByDbOutroPlaylistId'); $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null, 'CcPlaylistcontentss'); } // buildRelations() diff --git a/legacy/application/models/airtime/map/CcShowTableMap.php b/legacy/application/models/airtime/map/CcShowTableMap.php index 0c88eaad26..ac766011e9 100644 --- a/legacy/application/models/airtime/map/CcShowTableMap.php +++ b/legacy/application/models/airtime/map/CcShowTableMap.php @@ -68,9 +68,9 @@ public function initialize() */ public function buildRelations() { - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('autoplaylist_id' => 'id', ), 'SET NULL', null); - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('intro_playlist_id' => 'id', ), 'SET NULL', null); - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('outro_playlist_id' => 'id', ), 'SET NULL', null); + $this->addRelation('CcPlaylistRelatedByDbAutoPlaylistId', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('autoplaylist_id' => 'id', ), 'SET NULL', null); + $this->addRelation('CcPlaylistRelatedByDbIntroPlaylistId', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('intro_playlist_id' => 'id', ), 'SET NULL', null); + $this->addRelation('CcPlaylistRelatedByDbOutroPlaylistId', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('outro_playlist_id' => 'id', ), 'SET NULL', null); $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null, 'CcShowInstancess'); $this->addRelation('CcShowDays', 'CcShowDays', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null, 'CcShowDayss'); $this->addRelation('CcShowRebroadcast', 'CcShowRebroadcast', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null, 'CcShowRebroadcasts'); diff --git a/legacy/application/models/airtime/om/BaseCcPlaylist.php b/legacy/application/models/airtime/om/BaseCcPlaylist.php index 83f4ce55b9..e3e1160561 100644 --- a/legacy/application/models/airtime/om/BaseCcPlaylist.php +++ b/legacy/application/models/airtime/om/BaseCcPlaylist.php @@ -81,8 +81,20 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent /** * @var PropelObjectCollection|CcShow[] Collection to store aggregation of CcShow objects. */ - protected $collCcShows; - protected $collCcShowsPartial; + protected $collCcShowsRelatedByDbAutoPlaylistId; + protected $collCcShowsRelatedByDbAutoPlaylistIdPartial; + + /** + * @var PropelObjectCollection|CcShow[] Collection to store aggregation of CcShow objects. + */ + protected $collCcShowsRelatedByDbIntroPlaylistId; + protected $collCcShowsRelatedByDbIntroPlaylistIdPartial; + + /** + * @var PropelObjectCollection|CcShow[] Collection to store aggregation of CcShow objects. + */ + protected $collCcShowsRelatedByDbOutroPlaylistId; + protected $collCcShowsRelatedByDbOutroPlaylistIdPartial; /** * @var PropelObjectCollection|CcPlaylistcontents[] Collection to store aggregation of CcPlaylistcontents objects. @@ -114,7 +126,19 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * An array of objects scheduled for deletion. * @var PropelObjectCollection */ - protected $ccShowsScheduledForDeletion = null; + protected $ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion = null; + + /** + * An array of objects scheduled for deletion. + * @var PropelObjectCollection + */ + protected $ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion = null; + + /** + * An array of objects scheduled for deletion. + * @var PropelObjectCollection + */ + protected $ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion = null; /** * An array of objects scheduled for deletion. @@ -546,7 +570,11 @@ public function reload($deep = false, PropelPDO $con = null) if ($deep) { // also de-associate any related objects? $this->aCcSubjs = null; - $this->collCcShows = null; + $this->collCcShowsRelatedByDbAutoPlaylistId = null; + + $this->collCcShowsRelatedByDbIntroPlaylistId = null; + + $this->collCcShowsRelatedByDbOutroPlaylistId = null; $this->collCcPlaylistcontentss = null; @@ -694,18 +722,54 @@ protected function doSave(PropelPDO $con) $this->resetModified(); } - if ($this->ccShowsScheduledForDeletion !== null) { - if (!$this->ccShowsScheduledForDeletion->isEmpty()) { - foreach ($this->ccShowsScheduledForDeletion as $ccShow) { + if ($this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion !== null) { + if (!$this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion->isEmpty()) { + foreach ($this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion as $ccShowRelatedByDbAutoPlaylistId) { // need to save related object because we set the relation to null - $ccShow->save($con); + $ccShowRelatedByDbAutoPlaylistId->save($con); } - $this->ccShowsScheduledForDeletion = null; + $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion = null; } } - if ($this->collCcShows !== null) { - foreach ($this->collCcShows as $referrerFK) { + if ($this->collCcShowsRelatedByDbAutoPlaylistId !== null) { + foreach ($this->collCcShowsRelatedByDbAutoPlaylistId as $referrerFK) { + if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion !== null) { + if (!$this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion->isEmpty()) { + foreach ($this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion as $ccShowRelatedByDbIntroPlaylistId) { + // need to save related object because we set the relation to null + $ccShowRelatedByDbIntroPlaylistId->save($con); + } + $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion = null; + } + } + + if ($this->collCcShowsRelatedByDbIntroPlaylistId !== null) { + foreach ($this->collCcShowsRelatedByDbIntroPlaylistId as $referrerFK) { + if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { + $affectedRows += $referrerFK->save($con); + } + } + } + + if ($this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion !== null) { + if (!$this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion->isEmpty()) { + foreach ($this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion as $ccShowRelatedByDbOutroPlaylistId) { + // need to save related object because we set the relation to null + $ccShowRelatedByDbOutroPlaylistId->save($con); + } + $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion = null; + } + } + + if ($this->collCcShowsRelatedByDbOutroPlaylistId !== null) { + foreach ($this->collCcShowsRelatedByDbOutroPlaylistId as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } @@ -922,8 +986,24 @@ protected function doValidate($columns = null) } - if ($this->collCcShows !== null) { - foreach ($this->collCcShows as $referrerFK) { + if ($this->collCcShowsRelatedByDbAutoPlaylistId !== null) { + foreach ($this->collCcShowsRelatedByDbAutoPlaylistId as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collCcShowsRelatedByDbIntroPlaylistId !== null) { + foreach ($this->collCcShowsRelatedByDbIntroPlaylistId as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + if ($this->collCcShowsRelatedByDbOutroPlaylistId !== null) { + foreach ($this->collCcShowsRelatedByDbOutroPlaylistId as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -1040,8 +1120,14 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColum if (null !== $this->aCcSubjs) { $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } - if (null !== $this->collCcShows) { - $result['CcShows'] = $this->collCcShows->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + if (null !== $this->collCcShowsRelatedByDbAutoPlaylistId) { + $result['CcShowsRelatedByDbAutoPlaylistId'] = $this->collCcShowsRelatedByDbAutoPlaylistId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + } + if (null !== $this->collCcShowsRelatedByDbIntroPlaylistId) { + $result['CcShowsRelatedByDbIntroPlaylistId'] = $this->collCcShowsRelatedByDbIntroPlaylistId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); + } + if (null !== $this->collCcShowsRelatedByDbOutroPlaylistId) { + $result['CcShowsRelatedByDbOutroPlaylistId'] = $this->collCcShowsRelatedByDbOutroPlaylistId->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collCcPlaylistcontentss) { $result['CcPlaylistcontentss'] = $this->collCcPlaylistcontentss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); @@ -1227,9 +1313,21 @@ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) // store object hash to prevent cycle $this->startCopy = true; - foreach ($this->getCcShows() as $relObj) { + foreach ($this->getCcShowsRelatedByDbAutoPlaylistId() as $relObj) { + if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves + $copyObj->addCcShowRelatedByDbAutoPlaylistId($relObj->copy($deepCopy)); + } + } + + foreach ($this->getCcShowsRelatedByDbIntroPlaylistId() as $relObj) { + if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves + $copyObj->addCcShowRelatedByDbIntroPlaylistId($relObj->copy($deepCopy)); + } + } + + foreach ($this->getCcShowsRelatedByDbOutroPlaylistId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShow($relObj->copy($deepCopy)); + $copyObj->addCcShowRelatedByDbOutroPlaylistId($relObj->copy($deepCopy)); } } @@ -1352,8 +1450,14 @@ public function getCcSubjs(PropelPDO $con = null, $doQuery = true) */ public function initRelation($relationName) { - if ('CcShow' == $relationName) { - $this->initCcShows(); + if ('CcShowRelatedByDbAutoPlaylistId' == $relationName) { + $this->initCcShowsRelatedByDbAutoPlaylistId(); + } + if ('CcShowRelatedByDbIntroPlaylistId' == $relationName) { + $this->initCcShowsRelatedByDbIntroPlaylistId(); + } + if ('CcShowRelatedByDbOutroPlaylistId' == $relationName) { + $this->initCcShowsRelatedByDbOutroPlaylistId(); } if ('CcPlaylistcontents' == $relationName) { $this->initCcPlaylistcontentss(); @@ -1361,36 +1465,36 @@ public function initRelation($relationName) } /** - * Clears out the collCcShows collection + * Clears out the collCcShowsRelatedByDbAutoPlaylistId collection * * This does not modify the database; however, it will remove any associated objects, causing * them to be refetched by subsequent calls to accessor method. * * @return CcPlaylist The current object (for fluent API support) - * @see addCcShows() + * @see addCcShowsRelatedByDbAutoPlaylistId() */ - public function clearCcShows() + public function clearCcShowsRelatedByDbAutoPlaylistId() { - $this->collCcShows = null; // important to set this to null since that means it is uninitialized - $this->collCcShowsPartial = null; + $this->collCcShowsRelatedByDbAutoPlaylistId = null; // important to set this to null since that means it is uninitialized + $this->collCcShowsRelatedByDbAutoPlaylistIdPartial = null; return $this; } /** - * reset is the collCcShows collection loaded partially + * reset is the collCcShowsRelatedByDbAutoPlaylistId collection loaded partially * * @return void */ - public function resetPartialCcShows($v = true) + public function resetPartialCcShowsRelatedByDbAutoPlaylistId($v = true) { - $this->collCcShowsPartial = $v; + $this->collCcShowsRelatedByDbAutoPlaylistIdPartial = $v; } /** - * Initializes the collCcShows collection. + * Initializes the collCcShowsRelatedByDbAutoPlaylistId collection. * - * By default this just sets the collCcShows collection to an empty array (like clearcollCcShows()); + * By default this just sets the collCcShowsRelatedByDbAutoPlaylistId collection to an empty array (like clearcollCcShowsRelatedByDbAutoPlaylistId()); * however, you may wish to override this method in your stub class to provide setting appropriate * to your application -- for example, setting the initial array to the values stored in database. * @@ -1399,13 +1503,13 @@ public function resetPartialCcShows($v = true) * * @return void */ - public function initCcShows($overrideExisting = true) + public function initCcShowsRelatedByDbAutoPlaylistId($overrideExisting = true) { - if (null !== $this->collCcShows && !$overrideExisting) { + if (null !== $this->collCcShowsRelatedByDbAutoPlaylistId && !$overrideExisting) { return; } - $this->collCcShows = new PropelObjectCollection(); - $this->collCcShows->setModel('CcShow'); + $this->collCcShowsRelatedByDbAutoPlaylistId = new PropelObjectCollection(); + $this->collCcShowsRelatedByDbAutoPlaylistId->setModel('CcShow'); } /** @@ -1422,79 +1526,79 @@ public function initCcShows($overrideExisting = true) * @return PropelObjectCollection|CcShow[] List of CcShow objects * @throws PropelException */ - public function getCcShows($criteria = null, PropelPDO $con = null) + public function getCcShowsRelatedByDbAutoPlaylistId($criteria = null, PropelPDO $con = null) { - $partial = $this->collCcShowsPartial && !$this->isNew(); - if (null === $this->collCcShows || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collCcShows) { + $partial = $this->collCcShowsRelatedByDbAutoPlaylistIdPartial && !$this->isNew(); + if (null === $this->collCcShowsRelatedByDbAutoPlaylistId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCcShowsRelatedByDbAutoPlaylistId) { // return empty collection - $this->initCcShows(); + $this->initCcShowsRelatedByDbAutoPlaylistId(); } else { - $collCcShows = CcShowQuery::create(null, $criteria) - ->filterByCcPlaylist($this) + $collCcShowsRelatedByDbAutoPlaylistId = CcShowQuery::create(null, $criteria) + ->filterByCcPlaylistRelatedByDbAutoPlaylistId($this) ->find($con); if (null !== $criteria) { - if (false !== $this->collCcShowsPartial && count($collCcShows)) { - $this->initCcShows(false); + if (false !== $this->collCcShowsRelatedByDbAutoPlaylistIdPartial && count($collCcShowsRelatedByDbAutoPlaylistId)) { + $this->initCcShowsRelatedByDbAutoPlaylistId(false); - foreach ($collCcShows as $obj) { - if (false == $this->collCcShows->contains($obj)) { - $this->collCcShows->append($obj); + foreach ($collCcShowsRelatedByDbAutoPlaylistId as $obj) { + if (false == $this->collCcShowsRelatedByDbAutoPlaylistId->contains($obj)) { + $this->collCcShowsRelatedByDbAutoPlaylistId->append($obj); } } - $this->collCcShowsPartial = true; + $this->collCcShowsRelatedByDbAutoPlaylistIdPartial = true; } - $collCcShows->getInternalIterator()->rewind(); + $collCcShowsRelatedByDbAutoPlaylistId->getInternalIterator()->rewind(); - return $collCcShows; + return $collCcShowsRelatedByDbAutoPlaylistId; } - if ($partial && $this->collCcShows) { - foreach ($this->collCcShows as $obj) { + if ($partial && $this->collCcShowsRelatedByDbAutoPlaylistId) { + foreach ($this->collCcShowsRelatedByDbAutoPlaylistId as $obj) { if ($obj->isNew()) { - $collCcShows[] = $obj; + $collCcShowsRelatedByDbAutoPlaylistId[] = $obj; } } } - $this->collCcShows = $collCcShows; - $this->collCcShowsPartial = false; + $this->collCcShowsRelatedByDbAutoPlaylistId = $collCcShowsRelatedByDbAutoPlaylistId; + $this->collCcShowsRelatedByDbAutoPlaylistIdPartial = false; } } - return $this->collCcShows; + return $this->collCcShowsRelatedByDbAutoPlaylistId; } /** - * Sets a collection of CcShow objects related by a one-to-many relationship + * Sets a collection of CcShowRelatedByDbAutoPlaylistId objects related by a one-to-many relationship * to the current object. * It will also schedule objects for deletion based on a diff between old objects (aka persisted) * and new objects from the given Propel collection. * - * @param PropelCollection $ccShows A Propel collection. + * @param PropelCollection $ccShowsRelatedByDbAutoPlaylistId A Propel collection. * @param PropelPDO $con Optional connection object * @return CcPlaylist The current object (for fluent API support) */ - public function setCcShows(PropelCollection $ccShows, PropelPDO $con = null) + public function setCcShowsRelatedByDbAutoPlaylistId(PropelCollection $ccShowsRelatedByDbAutoPlaylistId, PropelPDO $con = null) { - $ccShowsToDelete = $this->getCcShows(new Criteria(), $con)->diff($ccShows); + $ccShowsRelatedByDbAutoPlaylistIdToDelete = $this->getCcShowsRelatedByDbAutoPlaylistId(new Criteria(), $con)->diff($ccShowsRelatedByDbAutoPlaylistId); - $this->ccShowsScheduledForDeletion = $ccShowsToDelete; + $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion = $ccShowsRelatedByDbAutoPlaylistIdToDelete; - foreach ($ccShowsToDelete as $ccShowRemoved) { - $ccShowRemoved->setCcPlaylist(null); + foreach ($ccShowsRelatedByDbAutoPlaylistIdToDelete as $ccShowRelatedByDbAutoPlaylistIdRemoved) { + $ccShowRelatedByDbAutoPlaylistIdRemoved->setCcPlaylistRelatedByDbAutoPlaylistId(null); } - $this->collCcShows = null; - foreach ($ccShows as $ccShow) { - $this->addCcShow($ccShow); + $this->collCcShowsRelatedByDbAutoPlaylistId = null; + foreach ($ccShowsRelatedByDbAutoPlaylistId as $ccShowRelatedByDbAutoPlaylistId) { + $this->addCcShowRelatedByDbAutoPlaylistId($ccShowRelatedByDbAutoPlaylistId); } - $this->collCcShows = $ccShows; - $this->collCcShowsPartial = false; + $this->collCcShowsRelatedByDbAutoPlaylistId = $ccShowsRelatedByDbAutoPlaylistId; + $this->collCcShowsRelatedByDbAutoPlaylistIdPartial = false; return $this; } @@ -1508,16 +1612,16 @@ public function setCcShows(PropelCollection $ccShows, PropelPDO $con = null) * @return int Count of related CcShow objects. * @throws PropelException */ - public function countCcShows(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcShowsRelatedByDbAutoPlaylistId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - $partial = $this->collCcShowsPartial && !$this->isNew(); - if (null === $this->collCcShows || null !== $criteria || $partial) { - if ($this->isNew() && null === $this->collCcShows) { + $partial = $this->collCcShowsRelatedByDbAutoPlaylistIdPartial && !$this->isNew(); + if (null === $this->collCcShowsRelatedByDbAutoPlaylistId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCcShowsRelatedByDbAutoPlaylistId) { return 0; } if ($partial && !$criteria) { - return count($this->getCcShows()); + return count($this->getCcShowsRelatedByDbAutoPlaylistId()); } $query = CcShowQuery::create(null, $criteria); if ($distinct) { @@ -1525,11 +1629,461 @@ public function countCcShows(Criteria $criteria = null, $distinct = false, Prope } return $query - ->filterByCcPlaylist($this) + ->filterByCcPlaylistRelatedByDbAutoPlaylistId($this) + ->count($con); + } + + return count($this->collCcShowsRelatedByDbAutoPlaylistId); + } + + /** + * Method called to associate a CcShow object to this object + * through the CcShow foreign key attribute. + * + * @param CcShow $l CcShow + * @return CcPlaylist The current object (for fluent API support) + */ + public function addCcShowRelatedByDbAutoPlaylistId(CcShow $l) + { + if ($this->collCcShowsRelatedByDbAutoPlaylistId === null) { + $this->initCcShowsRelatedByDbAutoPlaylistId(); + $this->collCcShowsRelatedByDbAutoPlaylistIdPartial = true; + } + + if (!in_array($l, $this->collCcShowsRelatedByDbAutoPlaylistId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddCcShowRelatedByDbAutoPlaylistId($l); + + if ($this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion and $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion->contains($l)) { + $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion->remove($this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion->search($l)); + } + } + + return $this; + } + + /** + * @param CcShowRelatedByDbAutoPlaylistId $ccShowRelatedByDbAutoPlaylistId The ccShowRelatedByDbAutoPlaylistId object to add. + */ + protected function doAddCcShowRelatedByDbAutoPlaylistId($ccShowRelatedByDbAutoPlaylistId) + { + $this->collCcShowsRelatedByDbAutoPlaylistId[]= $ccShowRelatedByDbAutoPlaylistId; + $ccShowRelatedByDbAutoPlaylistId->setCcPlaylistRelatedByDbAutoPlaylistId($this); + } + + /** + * @param CcShowRelatedByDbAutoPlaylistId $ccShowRelatedByDbAutoPlaylistId The ccShowRelatedByDbAutoPlaylistId object to remove. + * @return CcPlaylist The current object (for fluent API support) + */ + public function removeCcShowRelatedByDbAutoPlaylistId($ccShowRelatedByDbAutoPlaylistId) + { + if ($this->getCcShowsRelatedByDbAutoPlaylistId()->contains($ccShowRelatedByDbAutoPlaylistId)) { + $this->collCcShowsRelatedByDbAutoPlaylistId->remove($this->collCcShowsRelatedByDbAutoPlaylistId->search($ccShowRelatedByDbAutoPlaylistId)); + if (null === $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion) { + $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion = clone $this->collCcShowsRelatedByDbAutoPlaylistId; + $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion->clear(); + } + $this->ccShowsRelatedByDbAutoPlaylistIdScheduledForDeletion[]= $ccShowRelatedByDbAutoPlaylistId; + $ccShowRelatedByDbAutoPlaylistId->setCcPlaylistRelatedByDbAutoPlaylistId(null); + } + + return $this; + } + + /** + * Clears out the collCcShowsRelatedByDbIntroPlaylistId collection + * + * This does not modify the database; however, it will remove any associated objects, causing + * them to be refetched by subsequent calls to accessor method. + * + * @return CcPlaylist The current object (for fluent API support) + * @see addCcShowsRelatedByDbIntroPlaylistId() + */ + public function clearCcShowsRelatedByDbIntroPlaylistId() + { + $this->collCcShowsRelatedByDbIntroPlaylistId = null; // important to set this to null since that means it is uninitialized + $this->collCcShowsRelatedByDbIntroPlaylistIdPartial = null; + + return $this; + } + + /** + * reset is the collCcShowsRelatedByDbIntroPlaylistId collection loaded partially + * + * @return void + */ + public function resetPartialCcShowsRelatedByDbIntroPlaylistId($v = true) + { + $this->collCcShowsRelatedByDbIntroPlaylistIdPartial = $v; + } + + /** + * Initializes the collCcShowsRelatedByDbIntroPlaylistId collection. + * + * By default this just sets the collCcShowsRelatedByDbIntroPlaylistId collection to an empty array (like clearcollCcShowsRelatedByDbIntroPlaylistId()); + * however, you may wish to override this method in your stub class to provide setting appropriate + * to your application -- for example, setting the initial array to the values stored in database. + * + * @param boolean $overrideExisting If set to true, the method call initializes + * the collection even if it is not empty + * + * @return void + */ + public function initCcShowsRelatedByDbIntroPlaylistId($overrideExisting = true) + { + if (null !== $this->collCcShowsRelatedByDbIntroPlaylistId && !$overrideExisting) { + return; + } + $this->collCcShowsRelatedByDbIntroPlaylistId = new PropelObjectCollection(); + $this->collCcShowsRelatedByDbIntroPlaylistId->setModel('CcShow'); + } + + /** + * Gets an array of CcShow objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this CcPlaylist is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @return PropelObjectCollection|CcShow[] List of CcShow objects + * @throws PropelException + */ + public function getCcShowsRelatedByDbIntroPlaylistId($criteria = null, PropelPDO $con = null) + { + $partial = $this->collCcShowsRelatedByDbIntroPlaylistIdPartial && !$this->isNew(); + if (null === $this->collCcShowsRelatedByDbIntroPlaylistId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCcShowsRelatedByDbIntroPlaylistId) { + // return empty collection + $this->initCcShowsRelatedByDbIntroPlaylistId(); + } else { + $collCcShowsRelatedByDbIntroPlaylistId = CcShowQuery::create(null, $criteria) + ->filterByCcPlaylistRelatedByDbIntroPlaylistId($this) + ->find($con); + if (null !== $criteria) { + if (false !== $this->collCcShowsRelatedByDbIntroPlaylistIdPartial && count($collCcShowsRelatedByDbIntroPlaylistId)) { + $this->initCcShowsRelatedByDbIntroPlaylistId(false); + + foreach ($collCcShowsRelatedByDbIntroPlaylistId as $obj) { + if (false == $this->collCcShowsRelatedByDbIntroPlaylistId->contains($obj)) { + $this->collCcShowsRelatedByDbIntroPlaylistId->append($obj); + } + } + + $this->collCcShowsRelatedByDbIntroPlaylistIdPartial = true; + } + + $collCcShowsRelatedByDbIntroPlaylistId->getInternalIterator()->rewind(); + + return $collCcShowsRelatedByDbIntroPlaylistId; + } + + if ($partial && $this->collCcShowsRelatedByDbIntroPlaylistId) { + foreach ($this->collCcShowsRelatedByDbIntroPlaylistId as $obj) { + if ($obj->isNew()) { + $collCcShowsRelatedByDbIntroPlaylistId[] = $obj; + } + } + } + + $this->collCcShowsRelatedByDbIntroPlaylistId = $collCcShowsRelatedByDbIntroPlaylistId; + $this->collCcShowsRelatedByDbIntroPlaylistIdPartial = false; + } + } + + return $this->collCcShowsRelatedByDbIntroPlaylistId; + } + + /** + * Sets a collection of CcShowRelatedByDbIntroPlaylistId objects related by a one-to-many relationship + * to the current object. + * It will also schedule objects for deletion based on a diff between old objects (aka persisted) + * and new objects from the given Propel collection. + * + * @param PropelCollection $ccShowsRelatedByDbIntroPlaylistId A Propel collection. + * @param PropelPDO $con Optional connection object + * @return CcPlaylist The current object (for fluent API support) + */ + public function setCcShowsRelatedByDbIntroPlaylistId(PropelCollection $ccShowsRelatedByDbIntroPlaylistId, PropelPDO $con = null) + { + $ccShowsRelatedByDbIntroPlaylistIdToDelete = $this->getCcShowsRelatedByDbIntroPlaylistId(new Criteria(), $con)->diff($ccShowsRelatedByDbIntroPlaylistId); + + + $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion = $ccShowsRelatedByDbIntroPlaylistIdToDelete; + + foreach ($ccShowsRelatedByDbIntroPlaylistIdToDelete as $ccShowRelatedByDbIntroPlaylistIdRemoved) { + $ccShowRelatedByDbIntroPlaylistIdRemoved->setCcPlaylistRelatedByDbIntroPlaylistId(null); + } + + $this->collCcShowsRelatedByDbIntroPlaylistId = null; + foreach ($ccShowsRelatedByDbIntroPlaylistId as $ccShowRelatedByDbIntroPlaylistId) { + $this->addCcShowRelatedByDbIntroPlaylistId($ccShowRelatedByDbIntroPlaylistId); + } + + $this->collCcShowsRelatedByDbIntroPlaylistId = $ccShowsRelatedByDbIntroPlaylistId; + $this->collCcShowsRelatedByDbIntroPlaylistIdPartial = false; + + return $this; + } + + /** + * Returns the number of related CcShow objects. + * + * @param Criteria $criteria + * @param boolean $distinct + * @param PropelPDO $con + * @return int Count of related CcShow objects. + * @throws PropelException + */ + public function countCcShowsRelatedByDbIntroPlaylistId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + { + $partial = $this->collCcShowsRelatedByDbIntroPlaylistIdPartial && !$this->isNew(); + if (null === $this->collCcShowsRelatedByDbIntroPlaylistId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCcShowsRelatedByDbIntroPlaylistId) { + return 0; + } + + if ($partial && !$criteria) { + return count($this->getCcShowsRelatedByDbIntroPlaylistId()); + } + $query = CcShowQuery::create(null, $criteria); + if ($distinct) { + $query->distinct(); + } + + return $query + ->filterByCcPlaylistRelatedByDbIntroPlaylistId($this) + ->count($con); + } + + return count($this->collCcShowsRelatedByDbIntroPlaylistId); + } + + /** + * Method called to associate a CcShow object to this object + * through the CcShow foreign key attribute. + * + * @param CcShow $l CcShow + * @return CcPlaylist The current object (for fluent API support) + */ + public function addCcShowRelatedByDbIntroPlaylistId(CcShow $l) + { + if ($this->collCcShowsRelatedByDbIntroPlaylistId === null) { + $this->initCcShowsRelatedByDbIntroPlaylistId(); + $this->collCcShowsRelatedByDbIntroPlaylistIdPartial = true; + } + + if (!in_array($l, $this->collCcShowsRelatedByDbIntroPlaylistId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddCcShowRelatedByDbIntroPlaylistId($l); + + if ($this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion and $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion->contains($l)) { + $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion->remove($this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion->search($l)); + } + } + + return $this; + } + + /** + * @param CcShowRelatedByDbIntroPlaylistId $ccShowRelatedByDbIntroPlaylistId The ccShowRelatedByDbIntroPlaylistId object to add. + */ + protected function doAddCcShowRelatedByDbIntroPlaylistId($ccShowRelatedByDbIntroPlaylistId) + { + $this->collCcShowsRelatedByDbIntroPlaylistId[]= $ccShowRelatedByDbIntroPlaylistId; + $ccShowRelatedByDbIntroPlaylistId->setCcPlaylistRelatedByDbIntroPlaylistId($this); + } + + /** + * @param CcShowRelatedByDbIntroPlaylistId $ccShowRelatedByDbIntroPlaylistId The ccShowRelatedByDbIntroPlaylistId object to remove. + * @return CcPlaylist The current object (for fluent API support) + */ + public function removeCcShowRelatedByDbIntroPlaylistId($ccShowRelatedByDbIntroPlaylistId) + { + if ($this->getCcShowsRelatedByDbIntroPlaylistId()->contains($ccShowRelatedByDbIntroPlaylistId)) { + $this->collCcShowsRelatedByDbIntroPlaylistId->remove($this->collCcShowsRelatedByDbIntroPlaylistId->search($ccShowRelatedByDbIntroPlaylistId)); + if (null === $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion) { + $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion = clone $this->collCcShowsRelatedByDbIntroPlaylistId; + $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion->clear(); + } + $this->ccShowsRelatedByDbIntroPlaylistIdScheduledForDeletion[]= $ccShowRelatedByDbIntroPlaylistId; + $ccShowRelatedByDbIntroPlaylistId->setCcPlaylistRelatedByDbIntroPlaylistId(null); + } + + return $this; + } + + /** + * Clears out the collCcShowsRelatedByDbOutroPlaylistId collection + * + * This does not modify the database; however, it will remove any associated objects, causing + * them to be refetched by subsequent calls to accessor method. + * + * @return CcPlaylist The current object (for fluent API support) + * @see addCcShowsRelatedByDbOutroPlaylistId() + */ + public function clearCcShowsRelatedByDbOutroPlaylistId() + { + $this->collCcShowsRelatedByDbOutroPlaylistId = null; // important to set this to null since that means it is uninitialized + $this->collCcShowsRelatedByDbOutroPlaylistIdPartial = null; + + return $this; + } + + /** + * reset is the collCcShowsRelatedByDbOutroPlaylistId collection loaded partially + * + * @return void + */ + public function resetPartialCcShowsRelatedByDbOutroPlaylistId($v = true) + { + $this->collCcShowsRelatedByDbOutroPlaylistIdPartial = $v; + } + + /** + * Initializes the collCcShowsRelatedByDbOutroPlaylistId collection. + * + * By default this just sets the collCcShowsRelatedByDbOutroPlaylistId collection to an empty array (like clearcollCcShowsRelatedByDbOutroPlaylistId()); + * however, you may wish to override this method in your stub class to provide setting appropriate + * to your application -- for example, setting the initial array to the values stored in database. + * + * @param boolean $overrideExisting If set to true, the method call initializes + * the collection even if it is not empty + * + * @return void + */ + public function initCcShowsRelatedByDbOutroPlaylistId($overrideExisting = true) + { + if (null !== $this->collCcShowsRelatedByDbOutroPlaylistId && !$overrideExisting) { + return; + } + $this->collCcShowsRelatedByDbOutroPlaylistId = new PropelObjectCollection(); + $this->collCcShowsRelatedByDbOutroPlaylistId->setModel('CcShow'); + } + + /** + * Gets an array of CcShow objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this CcPlaylist is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @return PropelObjectCollection|CcShow[] List of CcShow objects + * @throws PropelException + */ + public function getCcShowsRelatedByDbOutroPlaylistId($criteria = null, PropelPDO $con = null) + { + $partial = $this->collCcShowsRelatedByDbOutroPlaylistIdPartial && !$this->isNew(); + if (null === $this->collCcShowsRelatedByDbOutroPlaylistId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCcShowsRelatedByDbOutroPlaylistId) { + // return empty collection + $this->initCcShowsRelatedByDbOutroPlaylistId(); + } else { + $collCcShowsRelatedByDbOutroPlaylistId = CcShowQuery::create(null, $criteria) + ->filterByCcPlaylistRelatedByDbOutroPlaylistId($this) + ->find($con); + if (null !== $criteria) { + if (false !== $this->collCcShowsRelatedByDbOutroPlaylistIdPartial && count($collCcShowsRelatedByDbOutroPlaylistId)) { + $this->initCcShowsRelatedByDbOutroPlaylistId(false); + + foreach ($collCcShowsRelatedByDbOutroPlaylistId as $obj) { + if (false == $this->collCcShowsRelatedByDbOutroPlaylistId->contains($obj)) { + $this->collCcShowsRelatedByDbOutroPlaylistId->append($obj); + } + } + + $this->collCcShowsRelatedByDbOutroPlaylistIdPartial = true; + } + + $collCcShowsRelatedByDbOutroPlaylistId->getInternalIterator()->rewind(); + + return $collCcShowsRelatedByDbOutroPlaylistId; + } + + if ($partial && $this->collCcShowsRelatedByDbOutroPlaylistId) { + foreach ($this->collCcShowsRelatedByDbOutroPlaylistId as $obj) { + if ($obj->isNew()) { + $collCcShowsRelatedByDbOutroPlaylistId[] = $obj; + } + } + } + + $this->collCcShowsRelatedByDbOutroPlaylistId = $collCcShowsRelatedByDbOutroPlaylistId; + $this->collCcShowsRelatedByDbOutroPlaylistIdPartial = false; + } + } + + return $this->collCcShowsRelatedByDbOutroPlaylistId; + } + + /** + * Sets a collection of CcShowRelatedByDbOutroPlaylistId objects related by a one-to-many relationship + * to the current object. + * It will also schedule objects for deletion based on a diff between old objects (aka persisted) + * and new objects from the given Propel collection. + * + * @param PropelCollection $ccShowsRelatedByDbOutroPlaylistId A Propel collection. + * @param PropelPDO $con Optional connection object + * @return CcPlaylist The current object (for fluent API support) + */ + public function setCcShowsRelatedByDbOutroPlaylistId(PropelCollection $ccShowsRelatedByDbOutroPlaylistId, PropelPDO $con = null) + { + $ccShowsRelatedByDbOutroPlaylistIdToDelete = $this->getCcShowsRelatedByDbOutroPlaylistId(new Criteria(), $con)->diff($ccShowsRelatedByDbOutroPlaylistId); + + + $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion = $ccShowsRelatedByDbOutroPlaylistIdToDelete; + + foreach ($ccShowsRelatedByDbOutroPlaylistIdToDelete as $ccShowRelatedByDbOutroPlaylistIdRemoved) { + $ccShowRelatedByDbOutroPlaylistIdRemoved->setCcPlaylistRelatedByDbOutroPlaylistId(null); + } + + $this->collCcShowsRelatedByDbOutroPlaylistId = null; + foreach ($ccShowsRelatedByDbOutroPlaylistId as $ccShowRelatedByDbOutroPlaylistId) { + $this->addCcShowRelatedByDbOutroPlaylistId($ccShowRelatedByDbOutroPlaylistId); + } + + $this->collCcShowsRelatedByDbOutroPlaylistId = $ccShowsRelatedByDbOutroPlaylistId; + $this->collCcShowsRelatedByDbOutroPlaylistIdPartial = false; + + return $this; + } + + /** + * Returns the number of related CcShow objects. + * + * @param Criteria $criteria + * @param boolean $distinct + * @param PropelPDO $con + * @return int Count of related CcShow objects. + * @throws PropelException + */ + public function countCcShowsRelatedByDbOutroPlaylistId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + { + $partial = $this->collCcShowsRelatedByDbOutroPlaylistIdPartial && !$this->isNew(); + if (null === $this->collCcShowsRelatedByDbOutroPlaylistId || null !== $criteria || $partial) { + if ($this->isNew() && null === $this->collCcShowsRelatedByDbOutroPlaylistId) { + return 0; + } + + if ($partial && !$criteria) { + return count($this->getCcShowsRelatedByDbOutroPlaylistId()); + } + $query = CcShowQuery::create(null, $criteria); + if ($distinct) { + $query->distinct(); + } + + return $query + ->filterByCcPlaylistRelatedByDbOutroPlaylistId($this) ->count($con); } - return count($this->collCcShows); + return count($this->collCcShowsRelatedByDbOutroPlaylistId); } /** @@ -1539,18 +2093,18 @@ public function countCcShows(Criteria $criteria = null, $distinct = false, Prope * @param CcShow $l CcShow * @return CcPlaylist The current object (for fluent API support) */ - public function addCcShow(CcShow $l) + public function addCcShowRelatedByDbOutroPlaylistId(CcShow $l) { - if ($this->collCcShows === null) { - $this->initCcShows(); - $this->collCcShowsPartial = true; + if ($this->collCcShowsRelatedByDbOutroPlaylistId === null) { + $this->initCcShowsRelatedByDbOutroPlaylistId(); + $this->collCcShowsRelatedByDbOutroPlaylistIdPartial = true; } - if (!in_array($l, $this->collCcShows->getArrayCopy(), true)) { // only add it if the **same** object is not already associated - $this->doAddCcShow($l); + if (!in_array($l, $this->collCcShowsRelatedByDbOutroPlaylistId->getArrayCopy(), true)) { // only add it if the **same** object is not already associated + $this->doAddCcShowRelatedByDbOutroPlaylistId($l); - if ($this->ccShowsScheduledForDeletion and $this->ccShowsScheduledForDeletion->contains($l)) { - $this->ccShowsScheduledForDeletion->remove($this->ccShowsScheduledForDeletion->search($l)); + if ($this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion and $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion->contains($l)) { + $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion->remove($this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion->search($l)); } } @@ -1558,28 +2112,28 @@ public function addCcShow(CcShow $l) } /** - * @param CcShow $ccShow The ccShow object to add. + * @param CcShowRelatedByDbOutroPlaylistId $ccShowRelatedByDbOutroPlaylistId The ccShowRelatedByDbOutroPlaylistId object to add. */ - protected function doAddCcShow($ccShow) + protected function doAddCcShowRelatedByDbOutroPlaylistId($ccShowRelatedByDbOutroPlaylistId) { - $this->collCcShows[]= $ccShow; - $ccShow->setCcPlaylist($this); + $this->collCcShowsRelatedByDbOutroPlaylistId[]= $ccShowRelatedByDbOutroPlaylistId; + $ccShowRelatedByDbOutroPlaylistId->setCcPlaylistRelatedByDbOutroPlaylistId($this); } /** - * @param CcShow $ccShow The ccShow object to remove. + * @param CcShowRelatedByDbOutroPlaylistId $ccShowRelatedByDbOutroPlaylistId The ccShowRelatedByDbOutroPlaylistId object to remove. * @return CcPlaylist The current object (for fluent API support) */ - public function removeCcShow($ccShow) + public function removeCcShowRelatedByDbOutroPlaylistId($ccShowRelatedByDbOutroPlaylistId) { - if ($this->getCcShows()->contains($ccShow)) { - $this->collCcShows->remove($this->collCcShows->search($ccShow)); - if (null === $this->ccShowsScheduledForDeletion) { - $this->ccShowsScheduledForDeletion = clone $this->collCcShows; - $this->ccShowsScheduledForDeletion->clear(); + if ($this->getCcShowsRelatedByDbOutroPlaylistId()->contains($ccShowRelatedByDbOutroPlaylistId)) { + $this->collCcShowsRelatedByDbOutroPlaylistId->remove($this->collCcShowsRelatedByDbOutroPlaylistId->search($ccShowRelatedByDbOutroPlaylistId)); + if (null === $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion) { + $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion = clone $this->collCcShowsRelatedByDbOutroPlaylistId; + $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion->clear(); } - $this->ccShowsScheduledForDeletion[]= $ccShow; - $ccShow->setCcPlaylist(null); + $this->ccShowsRelatedByDbOutroPlaylistIdScheduledForDeletion[]= $ccShowRelatedByDbOutroPlaylistId; + $ccShowRelatedByDbOutroPlaylistId->setCcPlaylistRelatedByDbOutroPlaylistId(null); } return $this; @@ -1895,8 +2449,18 @@ public function clearAllReferences($deep = false) { if ($deep && !$this->alreadyInClearAllReferencesDeep) { $this->alreadyInClearAllReferencesDeep = true; - if ($this->collCcShows) { - foreach ($this->collCcShows as $o) { + if ($this->collCcShowsRelatedByDbAutoPlaylistId) { + foreach ($this->collCcShowsRelatedByDbAutoPlaylistId as $o) { + $o->clearAllReferences($deep); + } + } + if ($this->collCcShowsRelatedByDbIntroPlaylistId) { + foreach ($this->collCcShowsRelatedByDbIntroPlaylistId as $o) { + $o->clearAllReferences($deep); + } + } + if ($this->collCcShowsRelatedByDbOutroPlaylistId) { + foreach ($this->collCcShowsRelatedByDbOutroPlaylistId as $o) { $o->clearAllReferences($deep); } } @@ -1912,10 +2476,18 @@ public function clearAllReferences($deep = false) $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) - if ($this->collCcShows instanceof PropelCollection) { - $this->collCcShows->clearIterator(); + if ($this->collCcShowsRelatedByDbAutoPlaylistId instanceof PropelCollection) { + $this->collCcShowsRelatedByDbAutoPlaylistId->clearIterator(); + } + $this->collCcShowsRelatedByDbAutoPlaylistId = null; + if ($this->collCcShowsRelatedByDbIntroPlaylistId instanceof PropelCollection) { + $this->collCcShowsRelatedByDbIntroPlaylistId->clearIterator(); + } + $this->collCcShowsRelatedByDbIntroPlaylistId = null; + if ($this->collCcShowsRelatedByDbOutroPlaylistId instanceof PropelCollection) { + $this->collCcShowsRelatedByDbOutroPlaylistId->clearIterator(); } - $this->collCcShows = null; + $this->collCcShowsRelatedByDbOutroPlaylistId = null; if ($this->collCcPlaylistcontentss instanceof PropelCollection) { $this->collCcPlaylistcontentss->clearIterator(); } diff --git a/legacy/application/models/airtime/om/BaseCcPlaylistPeer.php b/legacy/application/models/airtime/om/BaseCcPlaylistPeer.php index 8c7bcb92ef..42ee1798b7 100644 --- a/legacy/application/models/airtime/om/BaseCcPlaylistPeer.php +++ b/legacy/application/models/airtime/om/BaseCcPlaylistPeer.php @@ -385,6 +385,12 @@ public static function clearInstancePool($and_clear_all_references = false) */ public static function clearRelatedInstancePool() { + // Invalidate objects in CcShowPeer instance pool, + // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. + CcShowPeer::clearInstancePool(); + // Invalidate objects in CcShowPeer instance pool, + // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. + CcShowPeer::clearInstancePool(); // Invalidate objects in CcShowPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcShowPeer::clearInstancePool(); diff --git a/legacy/application/models/airtime/om/BaseCcPlaylistQuery.php b/legacy/application/models/airtime/om/BaseCcPlaylistQuery.php index 4735966f15..1d480b9081 100644 --- a/legacy/application/models/airtime/om/BaseCcPlaylistQuery.php +++ b/legacy/application/models/airtime/om/BaseCcPlaylistQuery.php @@ -30,9 +30,17 @@ * @method CcPlaylistQuery rightJoinCcSubjs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcSubjs relation * @method CcPlaylistQuery innerJoinCcSubjs($relationAlias = null) Adds a INNER JOIN clause to the query using the CcSubjs relation * - * @method CcPlaylistQuery leftJoinCcShow($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcShow relation - * @method CcPlaylistQuery rightJoinCcShow($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcShow relation - * @method CcPlaylistQuery innerJoinCcShow($relationAlias = null) Adds a INNER JOIN clause to the query using the CcShow relation + * @method CcPlaylistQuery leftJoinCcShowRelatedByDbAutoPlaylistId($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcShowRelatedByDbAutoPlaylistId relation + * @method CcPlaylistQuery rightJoinCcShowRelatedByDbAutoPlaylistId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcShowRelatedByDbAutoPlaylistId relation + * @method CcPlaylistQuery innerJoinCcShowRelatedByDbAutoPlaylistId($relationAlias = null) Adds a INNER JOIN clause to the query using the CcShowRelatedByDbAutoPlaylistId relation + * + * @method CcPlaylistQuery leftJoinCcShowRelatedByDbIntroPlaylistId($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcShowRelatedByDbIntroPlaylistId relation + * @method CcPlaylistQuery rightJoinCcShowRelatedByDbIntroPlaylistId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcShowRelatedByDbIntroPlaylistId relation + * @method CcPlaylistQuery innerJoinCcShowRelatedByDbIntroPlaylistId($relationAlias = null) Adds a INNER JOIN clause to the query using the CcShowRelatedByDbIntroPlaylistId relation + * + * @method CcPlaylistQuery leftJoinCcShowRelatedByDbOutroPlaylistId($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcShowRelatedByDbOutroPlaylistId relation + * @method CcPlaylistQuery rightJoinCcShowRelatedByDbOutroPlaylistId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcShowRelatedByDbOutroPlaylistId relation + * @method CcPlaylistQuery innerJoinCcShowRelatedByDbOutroPlaylistId($relationAlias = null) Adds a INNER JOIN clause to the query using the CcShowRelatedByDbOutroPlaylistId relation * * @method CcPlaylistQuery leftJoinCcPlaylistcontents($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcPlaylistcontents relation * @method CcPlaylistQuery rightJoinCcPlaylistcontents($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPlaylistcontents relation @@ -595,33 +603,181 @@ public function useCcSubjsQuery($relationAlias = null, $joinType = Criteria::LEF * @return CcPlaylistQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ - public function filterByCcShow($ccShow, $comparison = null) + public function filterByCcShowRelatedByDbAutoPlaylistId($ccShow, $comparison = null) { if ($ccShow instanceof CcShow) { return $this ->addUsingAlias(CcPlaylistPeer::ID, $ccShow->getDbAutoPlaylistId(), $comparison); } elseif ($ccShow instanceof PropelObjectCollection) { return $this - ->useCcShowQuery() + ->useCcShowRelatedByDbAutoPlaylistIdQuery() + ->filterByPrimaryKeys($ccShow->getPrimaryKeys()) + ->endUse(); + } else { + throw new PropelException('filterByCcShowRelatedByDbAutoPlaylistId() only accepts arguments of type CcShow or PropelCollection'); + } + } + + /** + * Adds a JOIN clause to the query using the CcShowRelatedByDbAutoPlaylistId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcPlaylistQuery The current query, for fluid interface + */ + public function joinCcShowRelatedByDbAutoPlaylistId($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcShowRelatedByDbAutoPlaylistId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'CcShowRelatedByDbAutoPlaylistId'); + } + + return $this; + } + + /** + * Use the CcShowRelatedByDbAutoPlaylistId relation CcShow object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowQuery A secondary query class using the current class as primary query + */ + public function useCcShowRelatedByDbAutoPlaylistIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcShowRelatedByDbAutoPlaylistId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcShowRelatedByDbAutoPlaylistId', 'CcShowQuery'); + } + + /** + * Filter the query by a related CcShow object + * + * @param CcShow|PropelObjectCollection $ccShow the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcPlaylistQuery The current query, for fluid interface + * @throws PropelException - if the provided filter is invalid. + */ + public function filterByCcShowRelatedByDbIntroPlaylistId($ccShow, $comparison = null) + { + if ($ccShow instanceof CcShow) { + return $this + ->addUsingAlias(CcPlaylistPeer::ID, $ccShow->getDbIntroPlaylistId(), $comparison); + } elseif ($ccShow instanceof PropelObjectCollection) { + return $this + ->useCcShowRelatedByDbIntroPlaylistIdQuery() + ->filterByPrimaryKeys($ccShow->getPrimaryKeys()) + ->endUse(); + } else { + throw new PropelException('filterByCcShowRelatedByDbIntroPlaylistId() only accepts arguments of type CcShow or PropelCollection'); + } + } + + /** + * Adds a JOIN clause to the query using the CcShowRelatedByDbIntroPlaylistId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcPlaylistQuery The current query, for fluid interface + */ + public function joinCcShowRelatedByDbIntroPlaylistId($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcShowRelatedByDbIntroPlaylistId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'CcShowRelatedByDbIntroPlaylistId'); + } + + return $this; + } + + /** + * Use the CcShowRelatedByDbIntroPlaylistId relation CcShow object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowQuery A secondary query class using the current class as primary query + */ + public function useCcShowRelatedByDbIntroPlaylistIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcShowRelatedByDbIntroPlaylistId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcShowRelatedByDbIntroPlaylistId', 'CcShowQuery'); + } + + /** + * Filter the query by a related CcShow object + * + * @param CcShow|PropelObjectCollection $ccShow the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcPlaylistQuery The current query, for fluid interface + * @throws PropelException - if the provided filter is invalid. + */ + public function filterByCcShowRelatedByDbOutroPlaylistId($ccShow, $comparison = null) + { + if ($ccShow instanceof CcShow) { + return $this + ->addUsingAlias(CcPlaylistPeer::ID, $ccShow->getDbOutroPlaylistId(), $comparison); + } elseif ($ccShow instanceof PropelObjectCollection) { + return $this + ->useCcShowRelatedByDbOutroPlaylistIdQuery() ->filterByPrimaryKeys($ccShow->getPrimaryKeys()) ->endUse(); } else { - throw new PropelException('filterByCcShow() only accepts arguments of type CcShow or PropelCollection'); + throw new PropelException('filterByCcShowRelatedByDbOutroPlaylistId() only accepts arguments of type CcShow or PropelCollection'); } } /** - * Adds a JOIN clause to the query using the CcShow relation + * Adds a JOIN clause to the query using the CcShowRelatedByDbOutroPlaylistId relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return CcPlaylistQuery The current query, for fluid interface */ - public function joinCcShow($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinCcShowRelatedByDbOutroPlaylistId($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShow'); + $relationMap = $tableMap->getRelation('CcShowRelatedByDbOutroPlaylistId'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -636,14 +792,14 @@ public function joinCcShow($relationAlias = null, $joinType = Criteria::LEFT_JOI $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShow'); + $this->addJoinObject($join, 'CcShowRelatedByDbOutroPlaylistId'); } return $this; } /** - * Use the CcShow relation CcShow object + * Use the CcShowRelatedByDbOutroPlaylistId relation CcShow object * * @see useQuery() * @@ -653,11 +809,11 @@ public function joinCcShow($relationAlias = null, $joinType = Criteria::LEFT_JOI * * @return CcShowQuery A secondary query class using the current class as primary query */ - public function useCcShowQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useCcShowRelatedByDbOutroPlaylistIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcShow($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShow', 'CcShowQuery'); + ->joinCcShowRelatedByDbOutroPlaylistId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcShowRelatedByDbOutroPlaylistId', 'CcShowQuery'); } /** diff --git a/legacy/application/models/airtime/om/BaseCcShow.php b/legacy/application/models/airtime/om/BaseCcShow.php index 34c46fdfd6..512f474bac 100644 --- a/legacy/application/models/airtime/om/BaseCcShow.php +++ b/legacy/application/models/airtime/om/BaseCcShow.php @@ -170,7 +170,17 @@ abstract class BaseCcShow extends BaseObject implements Persistent /** * @var CcPlaylist */ - protected $aCcPlaylist; + protected $aCcPlaylistRelatedByDbAutoPlaylistId; + + /** + * @var CcPlaylist + */ + protected $aCcPlaylistRelatedByDbIntroPlaylistId; + + /** + * @var CcPlaylist + */ + protected $aCcPlaylistRelatedByDbOutroPlaylistId; /** * @var PropelObjectCollection|CcShowInstances[] Collection to store aggregation of CcShowInstances objects. @@ -497,7 +507,6 @@ public function getDbOverrideOutroPlaylist() * * @return int */ - public function getDbOutroPlaylistId() { @@ -876,8 +885,8 @@ public function setDbAutoPlaylistId($v) $this->modifiedColumns[] = CcShowPeer::AUTOPLAYLIST_ID; } - if ($this->aCcPlaylist !== null && $this->aCcPlaylist->getDbId() !== $v) { - $this->aCcPlaylist = null; + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId !== null && $this->aCcPlaylistRelatedByDbAutoPlaylistId->getDbId() !== $v) { + $this->aCcPlaylistRelatedByDbAutoPlaylistId = null; } @@ -937,7 +946,10 @@ public function setDbOverrideIntroPlaylist($v) $this->override_intro_playlist = $v; $this->modifiedColumns[] = CcShowPeer::OVERRIDE_INTRO_PLAYLIST; } - } + + + return $this; + } // setDbOverrideIntroPlaylist() /** * Set the value of [intro_playlist_id] column. @@ -945,7 +957,6 @@ public function setDbOverrideIntroPlaylist($v) * @param int $v new value * @return CcShow The current object (for fluent API support) */ - public function setDbIntroPlaylistId($v) { if ($v !== null && is_numeric($v)) { @@ -957,6 +968,11 @@ public function setDbIntroPlaylistId($v) $this->modifiedColumns[] = CcShowPeer::INTRO_PLAYLIST_ID; } + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId !== null && $this->aCcPlaylistRelatedByDbIntroPlaylistId->getDbId() !== $v) { + $this->aCcPlaylistRelatedByDbIntroPlaylistId = null; + } + + return $this; } // setDbIntroPlaylistId() @@ -970,7 +986,6 @@ public function setDbIntroPlaylistId($v) * @param boolean|integer|string $v The new value * @return CcShow The current object (for fluent API support) */ - public function setDbOverrideOutroPlaylist($v) { if ($v !== null) { @@ -985,7 +1000,10 @@ public function setDbOverrideOutroPlaylist($v) $this->override_outro_playlist = $v; $this->modifiedColumns[] = CcShowPeer::OVERRIDE_OUTRO_PLAYLIST; } - } + + + return $this; + } // setDbOverrideOutroPlaylist() /** * Set the value of [outro_playlist_id] column. @@ -993,7 +1011,6 @@ public function setDbOverrideOutroPlaylist($v) * @param int $v new value * @return CcShow The current object (for fluent API support) */ - public function setDbOutroPlaylistId($v) { if ($v !== null && is_numeric($v)) { @@ -1005,6 +1022,11 @@ public function setDbOutroPlaylistId($v) $this->modifiedColumns[] = CcShowPeer::OUTRO_PLAYLIST_ID; } + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId !== null && $this->aCcPlaylistRelatedByDbOutroPlaylistId->getDbId() !== $v) { + $this->aCcPlaylistRelatedByDbOutroPlaylistId = null; + } + + return $this; } // setDbOutroPlaylistId() @@ -1141,8 +1163,14 @@ public function hydrate($row, $startcol = 0, $rehydrate = false) public function ensureConsistency() { - if ($this->aCcPlaylist !== null && $this->autoplaylist_id !== $this->aCcPlaylist->getDbId()) { - $this->aCcPlaylist = null; + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId !== null && $this->autoplaylist_id !== $this->aCcPlaylistRelatedByDbAutoPlaylistId->getDbId()) { + $this->aCcPlaylistRelatedByDbAutoPlaylistId = null; + } + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId !== null && $this->intro_playlist_id !== $this->aCcPlaylistRelatedByDbIntroPlaylistId->getDbId()) { + $this->aCcPlaylistRelatedByDbIntroPlaylistId = null; + } + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId !== null && $this->outro_playlist_id !== $this->aCcPlaylistRelatedByDbOutroPlaylistId->getDbId()) { + $this->aCcPlaylistRelatedByDbOutroPlaylistId = null; } } // ensureConsistency @@ -1183,7 +1211,9 @@ public function reload($deep = false, PropelPDO $con = null) if ($deep) { // also de-associate any related objects? - $this->aCcPlaylist = null; + $this->aCcPlaylistRelatedByDbAutoPlaylistId = null; + $this->aCcPlaylistRelatedByDbIntroPlaylistId = null; + $this->aCcPlaylistRelatedByDbOutroPlaylistId = null; $this->collCcShowInstancess = null; $this->collCcShowDayss = null; @@ -1310,11 +1340,25 @@ protected function doSave(PropelPDO $con) // method. This object relates to these object(s) by a // foreign key reference. - if ($this->aCcPlaylist !== null) { - if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) { - $affectedRows += $this->aCcPlaylist->save($con); + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId !== null) { + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId->isModified() || $this->aCcPlaylistRelatedByDbAutoPlaylistId->isNew()) { + $affectedRows += $this->aCcPlaylistRelatedByDbAutoPlaylistId->save($con); + } + $this->setCcPlaylistRelatedByDbAutoPlaylistId($this->aCcPlaylistRelatedByDbAutoPlaylistId); + } + + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId !== null) { + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId->isModified() || $this->aCcPlaylistRelatedByDbIntroPlaylistId->isNew()) { + $affectedRows += $this->aCcPlaylistRelatedByDbIntroPlaylistId->save($con); + } + $this->setCcPlaylistRelatedByDbIntroPlaylistId($this->aCcPlaylistRelatedByDbIntroPlaylistId); + } + + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId !== null) { + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId->isModified() || $this->aCcPlaylistRelatedByDbOutroPlaylistId->isNew()) { + $affectedRows += $this->aCcPlaylistRelatedByDbOutroPlaylistId->save($con); } - $this->setCcPlaylist($this->aCcPlaylist); + $this->setCcPlaylistRelatedByDbOutroPlaylistId($this->aCcPlaylistRelatedByDbOutroPlaylistId); } if ($this->isNew() || $this->isModified()) { @@ -1661,9 +1705,21 @@ protected function doValidate($columns = null) // method. This object relates to these object(s) by a // foreign key reference. - if ($this->aCcPlaylist !== null) { - if (!$this->aCcPlaylist->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures()); + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId !== null) { + if (!$this->aCcPlaylistRelatedByDbAutoPlaylistId->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcPlaylistRelatedByDbAutoPlaylistId->getValidationFailures()); + } + } + + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId !== null) { + if (!$this->aCcPlaylistRelatedByDbIntroPlaylistId->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcPlaylistRelatedByDbIntroPlaylistId->getValidationFailures()); + } + } + + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId !== null) { + if (!$this->aCcPlaylistRelatedByDbOutroPlaylistId->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcPlaylistRelatedByDbOutroPlaylistId->getValidationFailures()); } } @@ -1860,8 +1916,14 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColum } if ($includeForeignObjects) { - if (null !== $this->aCcPlaylist) { - $result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + if (null !== $this->aCcPlaylistRelatedByDbAutoPlaylistId) { + $result['CcPlaylistRelatedByDbAutoPlaylistId'] = $this->aCcPlaylistRelatedByDbAutoPlaylistId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + } + if (null !== $this->aCcPlaylistRelatedByDbIntroPlaylistId) { + $result['CcPlaylistRelatedByDbIntroPlaylistId'] = $this->aCcPlaylistRelatedByDbIntroPlaylistId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); + } + if (null !== $this->aCcPlaylistRelatedByDbOutroPlaylistId) { + $result['CcPlaylistRelatedByDbOutroPlaylistId'] = $this->aCcPlaylistRelatedByDbOutroPlaylistId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collCcShowInstancess) { $result['CcShowInstancess'] = $this->collCcShowInstancess->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); @@ -2221,7 +2283,7 @@ public function getPeer() * @return CcShow The current object (for fluent API support) * @throws PropelException */ - public function setCcPlaylist(CcPlaylist $v = null) + public function setCcPlaylistRelatedByDbAutoPlaylistId(CcPlaylist $v = null) { if ($v === null) { $this->setDbAutoPlaylistId(NULL); @@ -2229,12 +2291,116 @@ public function setCcPlaylist(CcPlaylist $v = null) $this->setDbAutoPlaylistId($v->getDbId()); } - $this->aCcPlaylist = $v; + $this->aCcPlaylistRelatedByDbAutoPlaylistId = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcPlaylist object, it will not be re-added. + if ($v !== null) { + $v->addCcShowRelatedByDbAutoPlaylistId($this); + } + + + return $this; + } + + + /** + * Get the associated CcPlaylist object + * + * @param PropelPDO $con Optional Connection object. + * @param $doQuery Executes a query to get the object if required + * @return CcPlaylist The associated CcPlaylist object. + * @throws PropelException + */ + public function getCcPlaylistRelatedByDbAutoPlaylistId(PropelPDO $con = null, $doQuery = true) + { + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId === null && ($this->autoplaylist_id !== null) && $doQuery) { + $this->aCcPlaylistRelatedByDbAutoPlaylistId = CcPlaylistQuery::create()->findPk($this->autoplaylist_id, $con); + /* The following can be used additionally to + guarantee the related object contains a reference + to this object. This level of coupling may, however, be + undesirable since it could result in an only partially populated collection + in the referenced object. + $this->aCcPlaylistRelatedByDbAutoPlaylistId->addCcShowsRelatedByDbAutoPlaylistId($this); + */ + } + + return $this->aCcPlaylistRelatedByDbAutoPlaylistId; + } + + /** + * Declares an association between this object and a CcPlaylist object. + * + * @param CcPlaylist $v + * @return CcShow The current object (for fluent API support) + * @throws PropelException + */ + public function setCcPlaylistRelatedByDbIntroPlaylistId(CcPlaylist $v = null) + { + if ($v === null) { + $this->setDbIntroPlaylistId(NULL); + } else { + $this->setDbIntroPlaylistId($v->getDbId()); + } + + $this->aCcPlaylistRelatedByDbIntroPlaylistId = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcPlaylist object, it will not be re-added. + if ($v !== null) { + $v->addCcShowRelatedByDbIntroPlaylistId($this); + } + + + return $this; + } + + + /** + * Get the associated CcPlaylist object + * + * @param PropelPDO $con Optional Connection object. + * @param $doQuery Executes a query to get the object if required + * @return CcPlaylist The associated CcPlaylist object. + * @throws PropelException + */ + public function getCcPlaylistRelatedByDbIntroPlaylistId(PropelPDO $con = null, $doQuery = true) + { + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId === null && ($this->intro_playlist_id !== null) && $doQuery) { + $this->aCcPlaylistRelatedByDbIntroPlaylistId = CcPlaylistQuery::create()->findPk($this->intro_playlist_id, $con); + /* The following can be used additionally to + guarantee the related object contains a reference + to this object. This level of coupling may, however, be + undesirable since it could result in an only partially populated collection + in the referenced object. + $this->aCcPlaylistRelatedByDbIntroPlaylistId->addCcShowsRelatedByDbIntroPlaylistId($this); + */ + } + + return $this->aCcPlaylistRelatedByDbIntroPlaylistId; + } + + /** + * Declares an association between this object and a CcPlaylist object. + * + * @param CcPlaylist $v + * @return CcShow The current object (for fluent API support) + * @throws PropelException + */ + public function setCcPlaylistRelatedByDbOutroPlaylistId(CcPlaylist $v = null) + { + if ($v === null) { + $this->setDbOutroPlaylistId(NULL); + } else { + $this->setDbOutroPlaylistId($v->getDbId()); + } + + $this->aCcPlaylistRelatedByDbOutroPlaylistId = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the CcPlaylist object, it will not be re-added. if ($v !== null) { - $v->addCcShow($this); + $v->addCcShowRelatedByDbOutroPlaylistId($this); } @@ -2250,20 +2416,20 @@ public function setCcPlaylist(CcPlaylist $v = null) * @return CcPlaylist The associated CcPlaylist object. * @throws PropelException */ - public function getCcPlaylist(PropelPDO $con = null, $doQuery = true) + public function getCcPlaylistRelatedByDbOutroPlaylistId(PropelPDO $con = null, $doQuery = true) { - if ($this->aCcPlaylist === null && ($this->autoplaylist_id !== null) && $doQuery) { - $this->aCcPlaylist = CcPlaylistQuery::create()->findPk($this->autoplaylist_id, $con); + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId === null && ($this->outro_playlist_id !== null) && $doQuery) { + $this->aCcPlaylistRelatedByDbOutroPlaylistId = CcPlaylistQuery::create()->findPk($this->outro_playlist_id, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. - $this->aCcPlaylist->addCcShows($this); + $this->aCcPlaylistRelatedByDbOutroPlaylistId->addCcShowsRelatedByDbOutroPlaylistId($this); */ } - return $this->aCcPlaylist; + return $this->aCcPlaylistRelatedByDbOutroPlaylistId; } @@ -3335,8 +3501,14 @@ public function clearAllReferences($deep = false) $o->clearAllReferences($deep); } } - if ($this->aCcPlaylist instanceof Persistent) { - $this->aCcPlaylist->clearAllReferences($deep); + if ($this->aCcPlaylistRelatedByDbAutoPlaylistId instanceof Persistent) { + $this->aCcPlaylistRelatedByDbAutoPlaylistId->clearAllReferences($deep); + } + if ($this->aCcPlaylistRelatedByDbIntroPlaylistId instanceof Persistent) { + $this->aCcPlaylistRelatedByDbIntroPlaylistId->clearAllReferences($deep); + } + if ($this->aCcPlaylistRelatedByDbOutroPlaylistId instanceof Persistent) { + $this->aCcPlaylistRelatedByDbOutroPlaylistId->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; @@ -3358,7 +3530,9 @@ public function clearAllReferences($deep = false) $this->collCcShowHostss->clearIterator(); } $this->collCcShowHostss = null; - $this->aCcPlaylist = null; + $this->aCcPlaylistRelatedByDbAutoPlaylistId = null; + $this->aCcPlaylistRelatedByDbIntroPlaylistId = null; + $this->aCcPlaylistRelatedByDbOutroPlaylistId = null; } /** diff --git a/legacy/application/models/airtime/om/BaseCcShowPeer.php b/legacy/application/models/airtime/om/BaseCcShowPeer.php index 1beadf35a2..1843f5b5bf 100644 --- a/legacy/application/models/airtime/om/BaseCcShowPeer.php +++ b/legacy/application/models/airtime/om/BaseCcShowPeer.php @@ -114,11 +114,11 @@ abstract class BaseCcShowPeer * e.g. CcShowPeer::$fieldNames[CcShowPeer::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', 'DbImagePath', 'DbHasAutoPlaylist', 'DbAutoPlaylistId', 'DbAutoPlaylistRepeat', 'DbOverrideIntroPlaylist', 'DbIntroPlaylistId', 'DbOverrideOutroPlaylist', 'DbOutroPlaylistId',), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', 'dbImagePath', 'dbHasAutoPlaylist', 'dbAutoPlaylistId', 'dbAutoPlaylistRepeat', 'dbOverrideIntroPlaylist', 'dbIntroPlaylistId', 'dbOverrideOutroPlaylist', 'dbOutroPlaylistId',), - BasePeer::TYPE_COLNAME => array (CcShowPeer::ID, CcShowPeer::NAME, CcShowPeer::URL, CcShowPeer::GENRE, CcShowPeer::DESCRIPTION, CcShowPeer::COLOR, CcShowPeer::BACKGROUND_COLOR, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, CcShowPeer::LIVE_STREAM_USER, CcShowPeer::LIVE_STREAM_PASS, CcShowPeer::LINKED, CcShowPeer::IS_LINKABLE, CcShowPeer::IMAGE_PATH, CcShowPeer::HAS_AUTOPLAYLIST, CcShowPeer::AUTOPLAYLIST_ID, CcShowPeer::AUTOPLAYLIST_REPEAT, CCShowPeer::OVERRIDE_INTRO_PLAYLIST, CCShowPeer::INTRO_PLAYLIST_ID, CCShowPeer::OVERRIDE_OUTRO_PLAYLIST, CCShowPeer::OUTRO_PLAYLIST_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', 'IMAGE_PATH', 'HAS_AUTOPLAYLIST', 'AUTOPLAYLIST_ID', 'AUTOPLAYLIST_REPEAT', 'OVERRIDE_INTRO_PLAYLIST', 'INTRO_PLAYLIST_ID', 'OVERRIDE_OUTRO_PLAYLIST', 'OUTRO_PLAYLIST_ID',), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', 'image_path', 'has_autoplaylist', 'autoplaylist_id', 'autoplaylist_repeat', 'override_intro_playlist', 'intro_playlist_id', 'override_outro_playlist', 'outro_playlist_id',), + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', 'DbImagePath', 'DbHasAutoPlaylist', 'DbAutoPlaylistId', 'DbAutoPlaylistRepeat', 'DbOverrideIntroPlaylist', 'DbIntroPlaylistId', 'DbOverrideOutroPlaylist', 'DbOutroPlaylistId', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', 'dbImagePath', 'dbHasAutoPlaylist', 'dbAutoPlaylistId', 'dbAutoPlaylistRepeat', 'dbOverrideIntroPlaylist', 'dbIntroPlaylistId', 'dbOverrideOutroPlaylist', 'dbOutroPlaylistId', ), + BasePeer::TYPE_COLNAME => array (CcShowPeer::ID, CcShowPeer::NAME, CcShowPeer::URL, CcShowPeer::GENRE, CcShowPeer::DESCRIPTION, CcShowPeer::COLOR, CcShowPeer::BACKGROUND_COLOR, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, CcShowPeer::LIVE_STREAM_USER, CcShowPeer::LIVE_STREAM_PASS, CcShowPeer::LINKED, CcShowPeer::IS_LINKABLE, CcShowPeer::IMAGE_PATH, CcShowPeer::HAS_AUTOPLAYLIST, CcShowPeer::AUTOPLAYLIST_ID, CcShowPeer::AUTOPLAYLIST_REPEAT, CcShowPeer::OVERRIDE_INTRO_PLAYLIST, CcShowPeer::INTRO_PLAYLIST_ID, CcShowPeer::OVERRIDE_OUTRO_PLAYLIST, CcShowPeer::OUTRO_PLAYLIST_ID, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', 'IMAGE_PATH', 'HAS_AUTOPLAYLIST', 'AUTOPLAYLIST_ID', 'AUTOPLAYLIST_REPEAT', 'OVERRIDE_INTRO_PLAYLIST', 'INTRO_PLAYLIST_ID', 'OVERRIDE_OUTRO_PLAYLIST', 'OUTRO_PLAYLIST_ID', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', 'image_path', 'has_autoplaylist', 'autoplaylist_id', 'autoplaylist_repeat', 'override_intro_playlist', 'intro_playlist_id', 'override_outro_playlist', 'outro_playlist_id', ), BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) ); @@ -132,8 +132,8 @@ abstract class BaseCcShowPeer BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, 'DbLinked' => 11, 'DbIsLinkable' => 12, 'DbImagePath' => 13, 'DbHasAutoPlaylist' => 14, 'DbAutoPlaylistId' => 15, 'DbAutoPlaylistRepeat' => 16, 'DbOverrideIntroPlaylist' => 17, 'DbIntroPlaylistId' => 18, 'DbOverrideOutroPlaylist' => 19, 'DbOutroPlaylistId' => 20, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, 'dbLinked' => 11, 'dbIsLinkable' => 12, 'dbImagePath' => 13, 'dbHasAutoPlaylist' => 14, 'dbAutoPlaylistId' => 15, 'dbAutoPlaylistRepeat' => 16, 'dbOverrideIntroPlaylist' => 17, 'dbIntroPlaylistId' => 18, 'dbOverrideOutroPlaylist' => 19, 'dbOutroPlaylistId' => 20, ), BasePeer::TYPE_COLNAME => array (CcShowPeer::ID => 0, CcShowPeer::NAME => 1, CcShowPeer::URL => 2, CcShowPeer::GENRE => 3, CcShowPeer::DESCRIPTION => 4, CcShowPeer::COLOR => 5, CcShowPeer::BACKGROUND_COLOR => 6, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH => 7, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH => 8, CcShowPeer::LIVE_STREAM_USER => 9, CcShowPeer::LIVE_STREAM_PASS => 10, CcShowPeer::LINKED => 11, CcShowPeer::IS_LINKABLE => 12, CcShowPeer::IMAGE_PATH => 13, CcShowPeer::HAS_AUTOPLAYLIST => 14, CcShowPeer::AUTOPLAYLIST_ID => 15, CcShowPeer::AUTOPLAYLIST_REPEAT => 16, CcShowPeer::OVERRIDE_INTRO_PLAYLIST => 17, CcShowPeer::INTRO_PLAYLIST_ID => 18, CcShowPeer::OVERRIDE_OUTRO_PLAYLIST => 19, CcShowPeer::OUTRO_PLAYLIST_ID => 20, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, 'IMAGE_PATH' => 13, 'HAS_AUTOPLAYLIST' => 14, 'AUTOPLAYLIST_ID' => 15, 'AUTOPLAYLIST_REPEAT' => 16, 'OVERRIDE_INTRO_PLAYLIST' => 17, 'INTRO_PLAYLIST_ID' => 18, 'OVERRIDE_OUTRO_PLAYLIST' => 19, 'OUTRO_PLAYLIST_ID' => 20,), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, 'image_path' => 13, 'has_autoplaylist' => 14, 'autoplaylist_id' => 15, 'autoplaylist_repeat' => 16, 'override_intro_playlist' => 17, 'intro_playlist_id' => 18, 'override_outro_playlist' => 19, 'outro_playlist_id' => 20,), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, 'IMAGE_PATH' => 13, 'HAS_AUTOPLAYLIST' => 14, 'AUTOPLAYLIST_ID' => 15, 'AUTOPLAYLIST_REPEAT' => 16, 'OVERRIDE_INTRO_PLAYLIST' => 17, 'INTRO_PLAYLIST_ID' => 18, 'OVERRIDE_OUTRO_PLAYLIST' => 19, 'OUTRO_PLAYLIST_ID' => 20, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, 'image_path' => 13, 'has_autoplaylist' => 14, 'autoplaylist_id' => 15, 'autoplaylist_repeat' => 16, 'override_intro_playlist' => 17, 'intro_playlist_id' => 18, 'override_outro_playlist' => 19, 'outro_playlist_id' => 20, ), BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) ); @@ -565,7 +565,7 @@ public static function populateObject($row, $startcol = 0) /** - * Returns the number of rows matching criteria, joining the related CcPlaylist table + * Returns the number of rows matching criteria, joining the related CcPlaylistRelatedByDbAutoPlaylistId table * * @param Criteria $criteria * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. @@ -573,7 +573,7 @@ public static function populateObject($row, $startcol = 0) * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @return int Number of matching rows. */ - public static function doCountJoinCcPlaylist(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) + public static function doCountJoinCcPlaylistRelatedByDbAutoPlaylistId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) { // we're going to modify criteria, so copy it first $criteria = clone $criteria; @@ -601,7 +601,107 @@ public static function doCountJoinCcPlaylist(Criteria $criteria, $distinct = fal } $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylistRelatedByDbIntroPlaylistId table + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return int Number of matching rows. + */ + public static function doCountJoinCcPlaylistRelatedByDbIntroPlaylistId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count + + // Set the correct dbName + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylistRelatedByDbOutroPlaylistId table + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return int Number of matching rows. + */ + public static function doCountJoinCcPlaylistRelatedByDbOutroPlaylistId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count + + // Set the correct dbName + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doCount($criteria, $con); @@ -626,7 +726,7 @@ public static function doCountJoinCcPlaylist(Criteria $criteria, $distinct = fal * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ - public static function doSelectJoinCcPlaylist(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public static function doSelectJoinCcPlaylistRelatedByDbAutoPlaylistId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $criteria = clone $criteria; @@ -640,7 +740,139 @@ public static function doSelectJoinCcPlaylist(Criteria $criteria, $con = null, $ CcPlaylistPeer::addSelectColumns($criteria); $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowPeer::getInstanceFromPool($key1))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj1->hydrate($row, 0, true); // rehydrate + } else { + + $cls = CcShowPeer::getOMClass(); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcPlaylistPeer::getOMClass(); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcPlaylistPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcShow) to $obj2 (CcPlaylist) + $obj2->addCcShowRelatedByDbAutoPlaylistId($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + + return $results; + } + + + /** + * Selects a collection of CcShow objects pre-filled with their CcPlaylist objects. + * @param Criteria $criteria + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return array Array of CcShow objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcPlaylistRelatedByDbIntroPlaylistId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + } + + CcShowPeer::addSelectColumns($criteria); + $startcol = CcShowPeer::NUM_HYDRATE_COLUMNS; + CcPlaylistPeer::addSelectColumns($criteria); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowPeer::getInstanceFromPool($key1))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj1->hydrate($row, 0, true); // rehydrate + } else { + + $cls = CcShowPeer::getOMClass(); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcPlaylistPeer::getOMClass(); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcPlaylistPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcShow) to $obj2 (CcPlaylist) + $obj2->addCcShowRelatedByDbIntroPlaylistId($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + + return $results; + } + + + /** + * Selects a collection of CcShow objects pre-filled with their CcPlaylist objects. + * @param Criteria $criteria + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return array Array of CcShow objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcPlaylistRelatedByDbOutroPlaylistId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + } + + CcShowPeer::addSelectColumns($criteria); + $startcol = CcShowPeer::NUM_HYDRATE_COLUMNS; + CcPlaylistPeer::addSelectColumns($criteria); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doSelect($criteria, $con); @@ -674,7 +906,7 @@ public static function doSelectJoinCcPlaylist(Criteria $criteria, $con = null, $ } // if obj2 already loaded // Add the $obj1 (CcShow) to $obj2 (CcPlaylist) - $obj2->addCcShow($obj1); + $obj2->addCcShowRelatedByDbOutroPlaylistId($obj1); } // if joined row was not null @@ -723,7 +955,9 @@ public static function doCountJoinAll(Criteria $criteria, $distinct = false, Pro } $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doCount($criteria, $con); @@ -763,8 +997,16 @@ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_be CcPlaylistPeer::addSelectColumns($criteria); $startcol3 = $startcol2 + CcPlaylistPeer::NUM_HYDRATE_COLUMNS; + CcPlaylistPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + CcPlaylistPeer::NUM_HYDRATE_COLUMNS; + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + CcPlaylistPeer::NUM_HYDRATE_COLUMNS; + $criteria->addJoin(CcShowPeer::AUTOPLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::INTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + $criteria->addJoin(CcShowPeer::OUTRO_PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); $stmt = BasePeer::doSelect($criteria, $con); @@ -799,9 +1041,342 @@ public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_be } // if obj2 loaded // Add the $obj1 (CcShow) to the collection in $obj2 (CcPlaylist) - $obj2->addCcShow($obj1); + $obj2->addCcShowRelatedByDbAutoPlaylistId($obj1); + } // if joined row not null + + // Add objects for joined CcPlaylist rows + + $key3 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcPlaylistPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcPlaylistPeer::getOMClass(); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcPlaylistPeer::addInstanceToPool($obj3, $key3); + } // if obj3 loaded + + // Add the $obj1 (CcShow) to the collection in $obj3 (CcPlaylist) + $obj3->addCcShowRelatedByDbIntroPlaylistId($obj1); } // if joined row not null + // Add objects for joined CcPlaylist rows + + $key4 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcPlaylistPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcPlaylistPeer::getOMClass(); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcPlaylistPeer::addInstanceToPool($obj4, $key4); + } // if obj4 loaded + + // Add the $obj1 (CcShow) to the collection in $obj4 (CcPlaylist) + $obj4->addCcShowRelatedByDbOutroPlaylistId($obj1); + } // if joined row not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + + return $results; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylistRelatedByDbAutoPlaylistId table + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return int Number of matching rows. + */ + public static function doCountJoinAllExceptCcPlaylistRelatedByDbAutoPlaylistId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylistRelatedByDbIntroPlaylistId table + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return int Number of matching rows. + */ + public static function doCountJoinAllExceptCcPlaylistRelatedByDbIntroPlaylistId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylistRelatedByDbOutroPlaylistId table + * + * @param Criteria $criteria + * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return int Number of matching rows. + */ + public static function doCountJoinAllExceptCcPlaylistRelatedByDbOutroPlaylistId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + // we're going to modify criteria, so copy it first + $criteria = clone $criteria; + + // We need to set the primary table name, since in the case that there are no WHERE columns + // it will be impossible for the BasePeer::createSelectSql() method to determine which + // tables go into the FROM clause. + $criteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $stmt = BasePeer::doCount($criteria, $con); + + if ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $count = (int) $row[0]; + } else { + $count = 0; // no rows returned; we infer that means 0 matches. + } + $stmt->closeCursor(); + + return $count; + } + + + /** + * Selects a collection of CcShow objects pre-filled with all related objects except CcPlaylistRelatedByDbAutoPlaylistId. + * + * @param Criteria $criteria + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return array Array of CcShow objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcPlaylistRelatedByDbAutoPlaylistId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + } + + CcShowPeer::addSelectColumns($criteria); + $startcol2 = CcShowPeer::NUM_HYDRATE_COLUMNS; + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowPeer::getInstanceFromPool($key1))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj1->hydrate($row, 0, true); // rehydrate + } else { + $cls = CcShowPeer::getOMClass(); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + $results[] = $obj1; + } + $stmt->closeCursor(); + + return $results; + } + + + /** + * Selects a collection of CcShow objects pre-filled with all related objects except CcPlaylistRelatedByDbIntroPlaylistId. + * + * @param Criteria $criteria + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return array Array of CcShow objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcPlaylistRelatedByDbIntroPlaylistId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + } + + CcShowPeer::addSelectColumns($criteria); + $startcol2 = CcShowPeer::NUM_HYDRATE_COLUMNS; + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowPeer::getInstanceFromPool($key1))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj1->hydrate($row, 0, true); // rehydrate + } else { + $cls = CcShowPeer::getOMClass(); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + $results[] = $obj1; + } + $stmt->closeCursor(); + + return $results; + } + + + /** + * Selects a collection of CcShow objects pre-filled with all related objects except CcPlaylistRelatedByDbOutroPlaylistId. + * + * @param Criteria $criteria + * @param PropelPDO $con + * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN + * @return array Array of CcShow objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcPlaylistRelatedByDbOutroPlaylistId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(CcShowPeer::DATABASE_NAME); + } + + CcShowPeer::addSelectColumns($criteria); + $startcol2 = CcShowPeer::NUM_HYDRATE_COLUMNS; + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowPeer::getInstanceFromPool($key1))) { + // We no longer rehydrate the object, since this can cause data loss. + // See http://www.propelorm.org/ticket/509 + // $obj1->hydrate($row, 0, true); // rehydrate + } else { + $cls = CcShowPeer::getOMClass(); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + $results[] = $obj1; } $stmt->closeCursor(); diff --git a/legacy/application/models/airtime/om/BaseCcShowQuery.php b/legacy/application/models/airtime/om/BaseCcShowQuery.php index 9985f198b9..0445c121e7 100644 --- a/legacy/application/models/airtime/om/BaseCcShowQuery.php +++ b/legacy/application/models/airtime/om/BaseCcShowQuery.php @@ -54,9 +54,17 @@ * @method CcShowQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcShowQuery innerJoin($relation) Adds a INNER JOIN clause to the query * - * @method CcShowQuery leftJoinCcPlaylist($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcPlaylist relation - * @method CcShowQuery rightJoinCcPlaylist($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPlaylist relation - * @method CcShowQuery innerJoinCcPlaylist($relationAlias = null) Adds a INNER JOIN clause to the query using the CcPlaylist relation + * @method CcShowQuery leftJoinCcPlaylistRelatedByDbAutoPlaylistId($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcPlaylistRelatedByDbAutoPlaylistId relation + * @method CcShowQuery rightJoinCcPlaylistRelatedByDbAutoPlaylistId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPlaylistRelatedByDbAutoPlaylistId relation + * @method CcShowQuery innerJoinCcPlaylistRelatedByDbAutoPlaylistId($relationAlias = null) Adds a INNER JOIN clause to the query using the CcPlaylistRelatedByDbAutoPlaylistId relation + * + * @method CcShowQuery leftJoinCcPlaylistRelatedByDbIntroPlaylistId($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcPlaylistRelatedByDbIntroPlaylistId relation + * @method CcShowQuery rightJoinCcPlaylistRelatedByDbIntroPlaylistId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPlaylistRelatedByDbIntroPlaylistId relation + * @method CcShowQuery innerJoinCcPlaylistRelatedByDbIntroPlaylistId($relationAlias = null) Adds a INNER JOIN clause to the query using the CcPlaylistRelatedByDbIntroPlaylistId relation + * + * @method CcShowQuery leftJoinCcPlaylistRelatedByDbOutroPlaylistId($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcPlaylistRelatedByDbOutroPlaylistId relation + * @method CcShowQuery rightJoinCcPlaylistRelatedByDbOutroPlaylistId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPlaylistRelatedByDbOutroPlaylistId relation + * @method CcShowQuery innerJoinCcPlaylistRelatedByDbOutroPlaylistId($relationAlias = null) Adds a INNER JOIN clause to the query using the CcPlaylistRelatedByDbOutroPlaylistId relation * * @method CcShowQuery leftJoinCcShowInstances($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcShowInstances relation * @method CcShowQuery rightJoinCcShowInstances($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcShowInstances relation @@ -764,7 +772,7 @@ public function filterByDbHasAutoPlaylist($dbHasAutoPlaylist = null, $comparison * $query->filterByDbAutoPlaylistId(array('max' => 12)); // WHERE autoplaylist_id <= 12 * * - * @see filterByCcPlaylist() + * @see filterByCcPlaylistRelatedByDbAutoPlaylistId() * * @param mixed $dbAutoPlaylistId The value to use as filter. * Use scalar values for equality. @@ -862,7 +870,7 @@ public function filterByDbOverrideIntroPlaylist($dbOverrideIntroPlaylist = null, * $query->filterByDbIntroPlaylistId(array('max' => 12)); // WHERE intro_playlist_id <= 12 * * - * @see filterByCcPlaylist() + * @see filterByCcPlaylistRelatedByDbIntroPlaylistId() * * @param mixed $dbIntroPlaylistId The value to use as filter. * Use scalar values for equality. @@ -933,7 +941,7 @@ public function filterByDbOverrideOutroPlaylist($dbOverrideOutroPlaylist = null, * $query->filterByDbOutroPlaylistId(array('max' => 12)); // WHERE outro_playlist_id <= 12 * * - * @see filterByCcPlaylist() + * @see filterByCcPlaylistRelatedByDbOutroPlaylistId() * * @param mixed $dbOutroPlaylistId The value to use as filter. * Use scalar values for equality. @@ -975,7 +983,7 @@ public function filterByDbOutroPlaylistId($dbOutroPlaylistId = null, $comparison * @return CcShowQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ - public function filterByCcPlaylist($ccPlaylist, $comparison = null) + public function filterByCcPlaylistRelatedByDbAutoPlaylistId($ccPlaylist, $comparison = null) { if ($ccPlaylist instanceof CcPlaylist) { return $this @@ -988,22 +996,174 @@ public function filterByCcPlaylist($ccPlaylist, $comparison = null) return $this ->addUsingAlias(CcShowPeer::AUTOPLAYLIST_ID, $ccPlaylist->toKeyValue('PrimaryKey', 'DbId'), $comparison); } else { - throw new PropelException('filterByCcPlaylist() only accepts arguments of type CcPlaylist or PropelCollection'); + throw new PropelException('filterByCcPlaylistRelatedByDbAutoPlaylistId() only accepts arguments of type CcPlaylist or PropelCollection'); + } + } + + /** + * Adds a JOIN clause to the query using the CcPlaylistRelatedByDbAutoPlaylistId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowQuery The current query, for fluid interface + */ + public function joinCcPlaylistRelatedByDbAutoPlaylistId($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcPlaylistRelatedByDbAutoPlaylistId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'CcPlaylistRelatedByDbAutoPlaylistId'); + } + + return $this; + } + + /** + * Use the CcPlaylistRelatedByDbAutoPlaylistId relation CcPlaylist object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcPlaylistQuery A secondary query class using the current class as primary query + */ + public function useCcPlaylistRelatedByDbAutoPlaylistIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcPlaylistRelatedByDbAutoPlaylistId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistRelatedByDbAutoPlaylistId', 'CcPlaylistQuery'); + } + + /** + * Filter the query by a related CcPlaylist object + * + * @param CcPlaylist|PropelObjectCollection $ccPlaylist The related object(s) to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowQuery The current query, for fluid interface + * @throws PropelException - if the provided filter is invalid. + */ + public function filterByCcPlaylistRelatedByDbIntroPlaylistId($ccPlaylist, $comparison = null) + { + if ($ccPlaylist instanceof CcPlaylist) { + return $this + ->addUsingAlias(CcShowPeer::INTRO_PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); + } elseif ($ccPlaylist instanceof PropelObjectCollection) { + if (null === $comparison) { + $comparison = Criteria::IN; + } + + return $this + ->addUsingAlias(CcShowPeer::INTRO_PLAYLIST_ID, $ccPlaylist->toKeyValue('PrimaryKey', 'DbId'), $comparison); + } else { + throw new PropelException('filterByCcPlaylistRelatedByDbIntroPlaylistId() only accepts arguments of type CcPlaylist or PropelCollection'); + } + } + + /** + * Adds a JOIN clause to the query using the CcPlaylistRelatedByDbIntroPlaylistId relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowQuery The current query, for fluid interface + */ + public function joinCcPlaylistRelatedByDbIntroPlaylistId($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcPlaylistRelatedByDbIntroPlaylistId'); + + // create a ModelJoin object for this join + $join = new ModelJoin(); + $join->setJoinType($joinType); + $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias); + if ($previousJoin = $this->getPreviousJoin()) { + $join->setPreviousJoin($previousJoin); + } + + // add the ModelJoin to the current object + if ($relationAlias) { + $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); + $this->addJoinObject($join, $relationAlias); + } else { + $this->addJoinObject($join, 'CcPlaylistRelatedByDbIntroPlaylistId'); + } + + return $this; + } + + /** + * Use the CcPlaylistRelatedByDbIntroPlaylistId relation CcPlaylist object + * + * @see useQuery() + * + * @param string $relationAlias optional alias for the relation, + * to be used as main alias in the secondary query + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcPlaylistQuery A secondary query class using the current class as primary query + */ + public function useCcPlaylistRelatedByDbIntroPlaylistIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcPlaylistRelatedByDbIntroPlaylistId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistRelatedByDbIntroPlaylistId', 'CcPlaylistQuery'); + } + + /** + * Filter the query by a related CcPlaylist object + * + * @param CcPlaylist|PropelObjectCollection $ccPlaylist The related object(s) to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowQuery The current query, for fluid interface + * @throws PropelException - if the provided filter is invalid. + */ + public function filterByCcPlaylistRelatedByDbOutroPlaylistId($ccPlaylist, $comparison = null) + { + if ($ccPlaylist instanceof CcPlaylist) { + return $this + ->addUsingAlias(CcShowPeer::OUTRO_PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); + } elseif ($ccPlaylist instanceof PropelObjectCollection) { + if (null === $comparison) { + $comparison = Criteria::IN; + } + + return $this + ->addUsingAlias(CcShowPeer::OUTRO_PLAYLIST_ID, $ccPlaylist->toKeyValue('PrimaryKey', 'DbId'), $comparison); + } else { + throw new PropelException('filterByCcPlaylistRelatedByDbOutroPlaylistId() only accepts arguments of type CcPlaylist or PropelCollection'); } } /** - * Adds a JOIN clause to the query using the CcPlaylist relation + * Adds a JOIN clause to the query using the CcPlaylistRelatedByDbOutroPlaylistId relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return CcShowQuery The current query, for fluid interface */ - public function joinCcPlaylist($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function joinCcPlaylistRelatedByDbOutroPlaylistId($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylist'); + $relationMap = $tableMap->getRelation('CcPlaylistRelatedByDbOutroPlaylistId'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -1018,14 +1178,14 @@ public function joinCcPlaylist($relationAlias = null, $joinType = Criteria::LEFT $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcPlaylist'); + $this->addJoinObject($join, 'CcPlaylistRelatedByDbOutroPlaylistId'); } return $this; } /** - * Use the CcPlaylist relation CcPlaylist object + * Use the CcPlaylistRelatedByDbOutroPlaylistId relation CcPlaylist object * * @see useQuery() * @@ -1035,11 +1195,11 @@ public function joinCcPlaylist($relationAlias = null, $joinType = Criteria::LEFT * * @return CcPlaylistQuery A secondary query class using the current class as primary query */ - public function useCcPlaylistQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) + public function useCcPlaylistRelatedByDbOutroPlaylistIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcPlaylist($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); + ->joinCcPlaylistRelatedByDbOutroPlaylistId($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistRelatedByDbOutroPlaylistId', 'CcPlaylistQuery'); } /** diff --git a/legacy/build/schema.xml b/legacy/build/schema.xml index 47dce104a9..64f4ee9fcd 100644 --- a/legacy/build/schema.xml +++ b/legacy/build/schema.xml @@ -122,9 +122,19 @@ + + + + + + + + + + From c50d865cfc40aa4a500a73f564238599d4daef40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 18 Feb 2024 21:05:57 +0100 Subject: [PATCH 6/6] remove bool checkboxes from the form --- ...0046_add_override_intro_outro_playlists.py | 4 - .../legacy/migrations/sql/schema.sql | 2 - api/libretime_api/schedule/models/show.py | 4 - .../schedule/serializers/show.py | 2 - api/schema.yml | 10 -- legacy/application/assets.json | 2 +- .../common/AutoPlaylistManager.php | 8 +- legacy/application/configs/airtime-conf.php | 2 +- .../application/forms/AddShowAutoPlaylist.php | 25 +-- legacy/application/models/Show.php | 26 --- legacy/application/models/airtime/CcShow.php | 2 - .../models/airtime/map/CcShowTableMap.php | 2 - .../models/airtime/om/BaseCcShow.php | 158 +----------------- .../models/airtime/om/BaseCcShowPeer.php | 38 ++--- .../models/airtime/om/BaseCcShowQuery.php | 64 +------ .../application/services/ShowFormService.php | 2 - legacy/application/services/ShowService.php | 2 - .../scripts/form/add-show-autoplaylist.phtml | 16 -- legacy/build/schema.xml | 2 - legacy/public/js/airtime/schedule/add-show.js | 22 --- .../datasets/test_checkOverlappingShows.yml | 2 - .../services/database/ShowServiceDbTest.php | 2 - .../test_ccShowInsertedIntoDatabase.yml | 2 - ...hangeRepeatDayUpdatesScheduleCorrectly.yml | 2 - ...test_createBiWeeklyRepeatNoEndNoRRShow.yml | 2 - .../datasets/test_createLinkedShow.yml | 2 - ...reateMonthlyMonthlyRepeatNoEndNoRRShow.yml | 2 - ...createMonthlyWeeklyRepeatNoEndNoRRShow.yml | 2 - .../datasets/test_createNoRepeatNoRRShow.yml | 2 - .../datasets/test_createNoRepeatRRShow.yml | 2 - ...st_createQuadWeeklyRepeatNoEndNoRRShow.yml | 2 - ...est_createTriWeeklyRepeatNoEndNoRRShow.yml | 2 - .../test_createWeeklyRepeatNoEndNoRRShow.yml | 2 - .../test_createWeeklyRepeatRRShow.yml | 2 - .../datasets/test_deleteShowInstance.yml | 2 - ...test_deleteShowInstanceAndAllFollowing.yml | 2 - ...est_editRepeatingShowChangeNoEndOption.yml | 2 - .../test_editRepeatingShowInstance.yml | 2 - ...tRepeatShowDayUpdatesScheduleCorrectly.yml | 2 - ...CreationWhenUserMovesForwardInCalendar.yml | 2 - .../datasets/test_unlinkLinkedShow.yml | 2 - .../datasets/test_weeklyToBiWeekly.yml | 2 - .../datasets/test_weeklyToNoRepeat.yml | 2 - .../application/testdata/ShowServiceData.php | 14 -- 44 files changed, 34 insertions(+), 419 deletions(-) diff --git a/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py b/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py index 3e2b04882f..ffed6af621 100644 --- a/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py +++ b/api/libretime_api/legacy/migrations/0046_add_override_intro_outro_playlists.py @@ -5,19 +5,15 @@ from ._migrations import legacy_migration_factory UP = """ -ALTER TABLE cc_show ADD COLUMN override_intro_playlist boolean default 'f' NOT NULL; ALTER TABLE cc_show ADD COLUMN intro_playlist_id integer DEFAULT NULL; ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_intro_playlist_fkey FOREIGN KEY (intro_playlist_id) REFERENCES cc_playlist (id) ON DELETE SET NULL; -ALTER TABLE cc_show ADD COLUMN override_outro_playlist boolean default 'f' NOT NULL; ALTER TABLE cc_show ADD COLUMN outro_playlist_id integer DEFAULT NULL; ALTER TABLE cc_show ADD CONSTRAINT cc_playlist_outro_playlist_fkey FOREIGN KEY (outro_playlist_id) REFERENCES cc_playlist (id) ON DELETE SET NULL; """ DOWN = """ -ALTER TABLE cc_show DROP COLUMN IF EXISTS override_intro_playlist; ALTER TABLE cc_show DROP COLUMN IF EXISTS intro_playlist_id; ALTER TABLE cc_show DROP CONSTRAINT IF EXISTS cc_playlist_intro_playlist_fkey; -ALTER TABLE cc_show DROP COLUMN IF EXISTS override_outro_playlist; ALTER TABLE cc_show DROP COLUMN IF EXISTS outro_playlist_id; ALTER TABLE cc_show DROP CONSTRAINT IF EXISTS cc_playlist_outro_playlist_fkey; """ diff --git a/api/libretime_api/legacy/migrations/sql/schema.sql b/api/libretime_api/legacy/migrations/sql/schema.sql index 47033018a2..dcb702579d 100644 --- a/api/libretime_api/legacy/migrations/sql/schema.sql +++ b/api/libretime_api/legacy/migrations/sql/schema.sql @@ -126,9 +126,7 @@ CREATE TABLE "cc_show" "has_autoplaylist" BOOLEAN DEFAULT 'f' NOT NULL, "autoplaylist_id" INTEGER, "autoplaylist_repeat" BOOLEAN DEFAULT 'f' NOT NULL, - "override_intro_playlist" BOOLEAN DEFAULT 'f' NOT NULL, "intro_playlist_id" INTEGER, - "override_outro_playlist" BOOLEAN DEFAULT 'f' NOT NULL, "outro_playlist_id" INTEGER, PRIMARY KEY ("id") ); diff --git a/api/libretime_api/schedule/models/show.py b/api/libretime_api/schedule/models/show.py index 0aac0e5326..2714346e30 100644 --- a/api/libretime_api/schedule/models/show.py +++ b/api/libretime_api/schedule/models/show.py @@ -78,8 +78,6 @@ def live_enabled(self) -> bool: related_name="intro_playlist", ) - override_intro_playlist = models.BooleanField(db_column="override_intro_playlist") - outro_playlist = models.ForeignKey( "schedule.Playlist", on_delete=models.DO_NOTHING, @@ -89,8 +87,6 @@ def live_enabled(self) -> bool: related_name="outro_playlist", ) - override_outro_playlist = models.BooleanField(db_column="override_outro_playlist") - hosts = models.ManyToManyField( # type: ignore[var-annotated] "core.User", through="ShowHost", diff --git a/api/libretime_api/schedule/serializers/show.py b/api/libretime_api/schedule/serializers/show.py index 1eefa64c61..9dce841d8a 100644 --- a/api/libretime_api/schedule/serializers/show.py +++ b/api/libretime_api/schedule/serializers/show.py @@ -22,9 +22,7 @@ class Meta: "auto_playlist_enabled", "auto_playlist_repeat", "intro_playlist", - "override_intro_playlist", "outro_playlist", - "override_outro_playlist", ] diff --git a/api/schema.yml b/api/schema.yml index 054d1d074b..714a7bb67a 100644 --- a/api/schema.yml +++ b/api/schema.yml @@ -6412,13 +6412,9 @@ components: intro_playlist: type: integer nullable: true - override_intro_playlist: - type: boolean outro_playlist: type: integer nullable: true - override_outro_playlist: - type: boolean PatchedShowDays: type: object properties: @@ -7254,13 +7250,9 @@ components: intro_playlist: type: integer nullable: true - override_intro_playlist: - type: boolean outro_playlist: type: integer nullable: true - override_outro_playlist: - type: boolean required: - auto_playlist_enabled - auto_playlist_repeat @@ -7269,8 +7261,6 @@ components: - linked - live_enabled - name - - override_intro_playlist - - override_outro_playlist ShowDays: type: object properties: diff --git a/legacy/application/assets.json b/legacy/application/assets.json index ac6db42fd3..dbd8041e6a 100644 --- a/legacy/application/assets.json +++ b/legacy/application/assets.json @@ -80,7 +80,7 @@ "js/airtime/preferences/musicdirs.js": "81eb5dbc292144fe8762ebcae47372a5", "js/airtime/preferences/preferences.js": "af842763a466c9ea5b9d697db424e08f", "js/airtime/preferences/streamsetting.js": "60bb2f4f750594afc330c1f8c2037b91", - "js/airtime/schedule/add-show.js": "7b3f5e248e958f7d23d728c3b2c9658e", + "js/airtime/schedule/add-show.js": "6d44396fd42dc3da7d64740564089f4c", "js/airtime/schedule/full-calendar-functions.js": "6854ef2c1863250c4f2494d5cfedf394", "js/airtime/schedule/schedule.js": "14e2073b1543cb404460317999850c17", "js/airtime/showbuilder/builder.js": "b5addaf98002c1673e4f1c93997b8dae", diff --git a/legacy/application/common/AutoPlaylistManager.php b/legacy/application/common/AutoPlaylistManager.php index 2354668aae..21356114e0 100644 --- a/legacy/application/common/AutoPlaylistManager.php +++ b/legacy/application/common/AutoPlaylistManager.php @@ -33,15 +33,11 @@ public static function buildAutoPlaylist() // call the addPlaylist to show function and don't check for user permission to avoid call to non-existant user object $sid = $si->getShowId(); $playlistrepeat = new Application_Model_Show($sid); - if ($playlistrepeat->getHasOverrideIntroPlaylist()) { - $introplaylistid = $playlistrepeat->getIntroPlaylistId(); - } else { + if (!$introplaylistid = $playlistrepeat->getIntroPlaylistId()) { $introplaylistid = Application_Model_Preference::GetIntroPlaylist(); } - if ($playlistrepeat->getHasOverrideOutroPlaylist()) { - $outroplaylistid = $playlistrepeat->getOutroPlaylistId(); - } else { + if (!$outroplaylistid = $playlistrepeat->getOutroPlaylistId()) { $outroplaylistid = Application_Model_Preference::GetOutroPlaylist(); } diff --git a/legacy/application/configs/airtime-conf.php b/legacy/application/configs/airtime-conf.php index b3aa0fe500..378ae414d8 100644 --- a/legacy/application/configs/airtime-conf.php +++ b/legacy/application/configs/airtime-conf.php @@ -1,7 +1,7 @@ [ 'airtime' => [ diff --git a/legacy/application/forms/AddShowAutoPlaylist.php b/legacy/application/forms/AddShowAutoPlaylist.php index a0bcdd62cf..a4596047a2 100644 --- a/legacy/application/forms/AddShowAutoPlaylist.php +++ b/legacy/application/forms/AddShowAutoPlaylist.php @@ -13,6 +13,8 @@ public function init() // and store to assoc array $maxLens = Application_Model_Show::getMaxLengths(); + $playlistNames = Application_Model_Library::getPlaylistNames(true); + // Add autoplaylist checkbox element $this->addElement('checkbox', 'add_show_has_autoplaylist', [ 'label' => _('Add Autoloading Playlist ?'), @@ -23,10 +25,11 @@ public function init() $autoPlaylistSelect = new Zend_Form_Element_Select('add_show_autoplaylist_id'); $autoPlaylistSelect->setLabel(_('Select Playlist')); - $autoPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames(true)); + $autoPlaylistSelect->setMultiOptions($playlistNames); $autoPlaylistSelect->setValue(null); $autoPlaylistSelect->setDecorators(['ViewHelper']); $this->addElement($autoPlaylistSelect); + // Add autoplaylist checkbox element $this->addElement('checkbox', 'add_show_autoplaylist_repeat', [ 'label' => _('Repeat Playlist Until Show is Full ?'), @@ -35,32 +38,16 @@ public function init() 'decorators' => ['ViewHelper'], ]); - // Add override intro playlist checkbox element - $this->addElement('checkbox', 'add_show_override_intro_playlist', [ - 'label' => _('Override Intro Playlist ?'), - 'required' => false, - 'class' => 'input_text', - 'decorators' => ['ViewHelper'], - ]); - $introPlaylistSelect = new Zend_Form_Element_Select('add_show_intro_playlist_id'); $introPlaylistSelect->setLabel(_('Select Intro Playlist')); - $introPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames(true)); + $introPlaylistSelect->setMultiOptions($playlistNames); $introPlaylistSelect->setValue(null); $introPlaylistSelect->setDecorators(['ViewHelper']); $this->addElement($introPlaylistSelect); - // Add override outro playlist checkbox element - $this->addElement('checkbox', 'add_show_override_outro_playlist', [ - 'label' => _('Override Outro Playlist ?'), - 'required' => false, - 'class' => 'input_text', - 'decorators' => ['ViewHelper'], - ]); - $outroPlaylistSelect = new Zend_Form_Element_Select('add_show_outro_playlist_id'); $outroPlaylistSelect->setLabel(_('Select Outro Playlist')); - $outroPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames(true)); + $outroPlaylistSelect->setMultiOptions($playlistNames); $outroPlaylistSelect->setValue(null); $outroPlaylistSelect->setDecorators(['ViewHelper']); $this->addElement($outroPlaylistSelect); diff --git a/legacy/application/models/Show.php b/legacy/application/models/Show.php index a934e72917..392cd2c4ac 100644 --- a/legacy/application/models/Show.php +++ b/legacy/application/models/Show.php @@ -169,19 +169,6 @@ public function setAutoPlaylistId($playlistid) $show->setDbAutoPlaylistId($playlistid); } - public function getHasOverrideIntroPlaylist() - { - $show = CcShowQuery::create()->findPK($this->_showId); - - return $show->getDbOverrideIntroPlaylist(); - } - - public function setHasOverrideIntroPlaylist($value) - { - $show = CcShowQuery::create()->findPK($this->_showId); - $show->setDbOverrideIntroPlaylist($value); - } - public function getIntroPlaylistId() { $show = CcShowQuery::create()->findPK($this->_showId); @@ -195,19 +182,6 @@ public function setIntroPlaylistId($playlistid) $show->setDbIntroPlaylistId($playlistid); } - public function getHasOverrideOutroPlaylist() - { - $show = CcShowQuery::create()->findPK($this->_showId); - - return $show->getDbOverrideOutroPlaylist(); - } - - public function setHasOverrideOutroPlaylist($value) - { - $show = CcShowQuery::create()->findPK($this->_showId); - $show->setDbOverrideOutroPlaylist($value); - } - public function getOutroPlaylistId() { $show = CcShowQuery::create()->findPK($this->_showId); diff --git a/legacy/application/models/airtime/CcShow.php b/legacy/application/models/airtime/CcShow.php index 134dd27fd6..31da872ab0 100644 --- a/legacy/application/models/airtime/CcShow.php +++ b/legacy/application/models/airtime/CcShow.php @@ -327,9 +327,7 @@ public function getShowInfo() $info['has_autoplaylist'] = $this->getDbHasAutoPlaylist(); $info['autoplaylist_id'] = $this->getDbAutoPlaylistId(); $info['autoplaylist_repeat'] = $this->getDbAutoPlaylistRepeat(); - $info['override_intro_playlist'] = $this->getDbOverrideIntroPlaylist(); $info['intro_playlist_id'] = $this->getDbIntroPlaylistId(); - $info['override_outro_playlist'] = $this->getDbOverrideOutroPlaylist(); $info['outro_playlist_id'] = $this->getDbOutroPlaylistId(); return $info; diff --git a/legacy/application/models/airtime/map/CcShowTableMap.php b/legacy/application/models/airtime/map/CcShowTableMap.php index ac766011e9..54de40be57 100644 --- a/legacy/application/models/airtime/map/CcShowTableMap.php +++ b/legacy/application/models/airtime/map/CcShowTableMap.php @@ -56,9 +56,7 @@ public function initialize() $this->addColumn('has_autoplaylist', 'DbHasAutoPlaylist', 'BOOLEAN', true, null, false); $this->addForeignKey('autoplaylist_id', 'DbAutoPlaylistId', 'INTEGER', 'cc_playlist', 'id', false, null, null); $this->addColumn('autoplaylist_repeat', 'DbAutoPlaylistRepeat', 'BOOLEAN', true, null, false); - $this->addColumn('override_intro_playlist', 'DbOverrideIntroPlaylist', 'BOOLEAN', true, null, false); $this->addForeignKey('intro_playlist_id', 'DbIntroPlaylistId', 'INTEGER', 'cc_playlist', 'id', false, null, null); - $this->addColumn('override_outro_playlist', 'DbOverrideOutroPlaylist', 'BOOLEAN', true, null, false); $this->addForeignKey('outro_playlist_id', 'DbOutroPlaylistId', 'INTEGER', 'cc_playlist', 'id', false, null, null); // validators } // initialize() diff --git a/legacy/application/models/airtime/om/BaseCcShow.php b/legacy/application/models/airtime/om/BaseCcShow.php index 512f474bac..1dc838b1f2 100644 --- a/legacy/application/models/airtime/om/BaseCcShow.php +++ b/legacy/application/models/airtime/om/BaseCcShow.php @@ -141,26 +141,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent */ protected $autoplaylist_repeat; - /** - * The value for the override_intro_playlist field. - * Note: this column has a database default value of: false - * @var boolean - */ - protected $override_intro_playlist; - /** * The value for the intro_playlist_id field. * @var int */ protected $intro_playlist_id; - /** - * The value for the override_outro_playlist field. - * Note: this column has a database default value of: false - * @var boolean - */ - protected $override_outro_playlist; - /** * The value for the outro_playlist_id field. * @var int @@ -268,8 +254,6 @@ public function applyDefaultValues() $this->image_path = ''; $this->has_autoplaylist = false; $this->autoplaylist_repeat = false; - $this->override_intro_playlist = false; - $this->override_outro_playlist = false; } /** @@ -469,17 +453,6 @@ public function getDbAutoPlaylistRepeat() return $this->autoplaylist_repeat; } - /** - * Get the [override_intro_playlist] column value. - * - * @return boolean - */ - public function getDbOverrideIntroPlaylist() - { - - return $this->override_intro_playlist; - } - /** * Get the [intro_playlist_id] column value. * @@ -491,17 +464,6 @@ public function getDbIntroPlaylistId() return $this->intro_playlist_id; } - /** - * Get the [override_outro_playlist] column value. - * - * @return boolean - */ - public function getDbOverrideOutroPlaylist() - { - - return $this->override_outro_playlist; - } - /** * Get the [outro_playlist_id] column value. * @@ -922,35 +884,6 @@ public function setDbAutoPlaylistRepeat($v) return $this; } // setDbAutoPlaylistRepeat() - /** - * Sets the value of the [override_intro_playlist] column. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * - * @param boolean|integer|string $v The new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbOverrideIntroPlaylist($v) - { - if ($v !== null) { - if (is_string($v)) { - $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } else { - $v = (boolean) $v; - } - } - - if ($this->override_intro_playlist !== $v) { - $this->override_intro_playlist = $v; - $this->modifiedColumns[] = CcShowPeer::OVERRIDE_INTRO_PLAYLIST; - } - - - return $this; - } // setDbOverrideIntroPlaylist() - /** * Set the value of [intro_playlist_id] column. * @@ -976,35 +909,6 @@ public function setDbIntroPlaylistId($v) return $this; } // setDbIntroPlaylistId() - /** - * Sets the value of the [override_outro_playlist] column. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * - * @param boolean|integer|string $v The new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbOverrideOutroPlaylist($v) - { - if ($v !== null) { - if (is_string($v)) { - $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } else { - $v = (boolean) $v; - } - } - - if ($this->override_outro_playlist !== $v) { - $this->override_outro_playlist = $v; - $this->modifiedColumns[] = CcShowPeer::OVERRIDE_OUTRO_PLAYLIST; - } - - - return $this; - } // setDbOverrideOutroPlaylist() - /** * Set the value of [outro_playlist_id] column. * @@ -1080,14 +984,6 @@ public function hasOnlyDefaultValues() return false; } - if ($this->override_intro_playlist !== false) { - return false; - } - - if ($this->override_outro_playlist !== false) { - return false; - } - // otherwise, everything was equal, so return true return true; } // hasOnlyDefaultValues() @@ -1127,10 +1023,8 @@ public function hydrate($row, $startcol = 0, $rehydrate = false) $this->has_autoplaylist = ($row[$startcol + 14] !== null) ? (boolean) $row[$startcol + 14] : null; $this->autoplaylist_id = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null; $this->autoplaylist_repeat = ($row[$startcol + 16] !== null) ? (boolean) $row[$startcol + 16] : null; - $this->override_intro_playlist = ($row[$startcol + 17] !== null) ? (boolean) $row[$startcol + 17] : null; - $this->intro_playlist_id = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null; - $this->override_outro_playlist = ($row[$startcol + 19] !== null) ? (boolean) $row[$startcol + 19] : null; - $this->outro_playlist_id = ($row[$startcol + 20] !== null) ? (int) $row[$startcol + 20] : null; + $this->intro_playlist_id = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null; + $this->outro_playlist_id = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null; $this->resetModified(); $this->setNew(false); @@ -1140,7 +1034,7 @@ public function hydrate($row, $startcol = 0, $rehydrate = false) } $this->postHydrate($row, $startcol, $rehydrate); - return $startcol + 21; // 21 = CcShowPeer::NUM_HYDRATE_COLUMNS. + return $startcol + 19; // 19 = CcShowPeer::NUM_HYDRATE_COLUMNS. } catch (Exception $e) { throw new PropelException("Error populating CcShow object", $e); @@ -1527,15 +1421,9 @@ protected function doInsert(PropelPDO $con) if ($this->isColumnModified(CcShowPeer::AUTOPLAYLIST_REPEAT)) { $modifiedColumns[':p' . $index++] = '"autoplaylist_repeat"'; } - if ($this->isColumnModified(CcShowPeer::OVERRIDE_INTRO_PLAYLIST)) { - $modifiedColumns[':p' . $index++] = '"override_intro_playlist"'; - } if ($this->isColumnModified(CcShowPeer::INTRO_PLAYLIST_ID)) { $modifiedColumns[':p' . $index++] = '"intro_playlist_id"'; } - if ($this->isColumnModified(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST)) { - $modifiedColumns[':p' . $index++] = '"override_outro_playlist"'; - } if ($this->isColumnModified(CcShowPeer::OUTRO_PLAYLIST_ID)) { $modifiedColumns[':p' . $index++] = '"outro_playlist_id"'; } @@ -1601,15 +1489,9 @@ protected function doInsert(PropelPDO $con) case '"autoplaylist_repeat"': $stmt->bindValue($identifier, $this->autoplaylist_repeat, PDO::PARAM_BOOL); break; - case '"override_intro_playlist"': - $stmt->bindValue($identifier, $this->override_intro_playlist, PDO::PARAM_BOOL); - break; case '"intro_playlist_id"': $stmt->bindValue($identifier, $this->intro_playlist_id, PDO::PARAM_INT); break; - case '"override_outro_playlist"': - $stmt->bindValue($identifier, $this->override_outro_playlist, PDO::PARAM_BOOL); - break; case '"outro_playlist_id"': $stmt->bindValue($identifier, $this->outro_playlist_id, PDO::PARAM_INT); break; @@ -1848,15 +1730,9 @@ public function getByPosition($pos) return $this->getDbAutoPlaylistRepeat(); break; case 17: - return $this->getDbOverrideIntroPlaylist(); - break; - case 18: return $this->getDbIntroPlaylistId(); break; - case 19: - return $this->getDbOverrideOutroPlaylist(); - break; - case 20: + case 18: return $this->getDbOutroPlaylistId(); break; default: @@ -1905,10 +1781,8 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColum $keys[14] => $this->getDbHasAutoPlaylist(), $keys[15] => $this->getDbAutoPlaylistId(), $keys[16] => $this->getDbAutoPlaylistRepeat(), - $keys[17] => $this->getDbOverrideIntroPlaylist(), - $keys[18] => $this->getDbIntroPlaylistId(), - $keys[19] => $this->getDbOverrideOutroPlaylist(), - $keys[20] => $this->getDbOutroPlaylistId(), + $keys[17] => $this->getDbIntroPlaylistId(), + $keys[18] => $this->getDbOutroPlaylistId(), ); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { @@ -2023,15 +1897,9 @@ public function setByPosition($pos, $value) $this->setDbAutoPlaylistRepeat($value); break; case 17: - $this->setDbOverrideIntroPlaylist($value); - break; - case 18: $this->setDbIntroPlaylistId($value); break; - case 19: - $this->setDbOverrideOutroPlaylist($value); - break; - case 20: + case 18: $this->setDbOutroPlaylistId($value); break; } // switch() @@ -2075,10 +1943,8 @@ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) if (array_key_exists($keys[14], $arr)) $this->setDbHasAutoPlaylist($arr[$keys[14]]); if (array_key_exists($keys[15], $arr)) $this->setDbAutoPlaylistId($arr[$keys[15]]); if (array_key_exists($keys[16], $arr)) $this->setDbAutoPlaylistRepeat($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setDbOverrideIntroPlaylist($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setDbIntroPlaylistId($arr[$keys[18]]); - if (array_key_exists($keys[19], $arr)) $this->setDbOverrideOutroPlaylist($arr[$keys[19]]); - if (array_key_exists($keys[20], $arr)) $this->setDbOutroPlaylistId($arr[$keys[20]]); + if (array_key_exists($keys[17], $arr)) $this->setDbIntroPlaylistId($arr[$keys[17]]); + if (array_key_exists($keys[18], $arr)) $this->setDbOutroPlaylistId($arr[$keys[18]]); } /** @@ -2107,9 +1973,7 @@ public function buildCriteria() if ($this->isColumnModified(CcShowPeer::HAS_AUTOPLAYLIST)) $criteria->add(CcShowPeer::HAS_AUTOPLAYLIST, $this->has_autoplaylist); if ($this->isColumnModified(CcShowPeer::AUTOPLAYLIST_ID)) $criteria->add(CcShowPeer::AUTOPLAYLIST_ID, $this->autoplaylist_id); if ($this->isColumnModified(CcShowPeer::AUTOPLAYLIST_REPEAT)) $criteria->add(CcShowPeer::AUTOPLAYLIST_REPEAT, $this->autoplaylist_repeat); - if ($this->isColumnModified(CcShowPeer::OVERRIDE_INTRO_PLAYLIST)) $criteria->add(CcShowPeer::OVERRIDE_INTRO_PLAYLIST, $this->override_intro_playlist); if ($this->isColumnModified(CcShowPeer::INTRO_PLAYLIST_ID)) $criteria->add(CcShowPeer::INTRO_PLAYLIST_ID, $this->intro_playlist_id); - if ($this->isColumnModified(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST)) $criteria->add(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST, $this->override_outro_playlist); if ($this->isColumnModified(CcShowPeer::OUTRO_PLAYLIST_ID)) $criteria->add(CcShowPeer::OUTRO_PLAYLIST_ID, $this->outro_playlist_id); return $criteria; @@ -2190,9 +2054,7 @@ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) $copyObj->setDbHasAutoPlaylist($this->getDbHasAutoPlaylist()); $copyObj->setDbAutoPlaylistId($this->getDbAutoPlaylistId()); $copyObj->setDbAutoPlaylistRepeat($this->getDbAutoPlaylistRepeat()); - $copyObj->setDbOverrideIntroPlaylist($this->getDbOverrideIntroPlaylist()); $copyObj->setDbIntroPlaylistId($this->getDbIntroPlaylistId()); - $copyObj->setDbOverrideOutroPlaylist($this->getDbOverrideOutroPlaylist()); $copyObj->setDbOutroPlaylistId($this->getDbOutroPlaylistId()); if ($deepCopy && !$this->startCopy) { @@ -3454,9 +3316,7 @@ public function clear() $this->has_autoplaylist = null; $this->autoplaylist_id = null; $this->autoplaylist_repeat = null; - $this->override_intro_playlist = null; $this->intro_playlist_id = null; - $this->override_outro_playlist = null; $this->outro_playlist_id = null; $this->alreadyInSave = false; $this->alreadyInValidation = false; diff --git a/legacy/application/models/airtime/om/BaseCcShowPeer.php b/legacy/application/models/airtime/om/BaseCcShowPeer.php index 1843f5b5bf..3f52708221 100644 --- a/legacy/application/models/airtime/om/BaseCcShowPeer.php +++ b/legacy/application/models/airtime/om/BaseCcShowPeer.php @@ -24,13 +24,13 @@ abstract class BaseCcShowPeer const TM_CLASS = 'CcShowTableMap'; /** The total number of columns. */ - const NUM_COLUMNS = 21; + const NUM_COLUMNS = 19; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; /** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */ - const NUM_HYDRATE_COLUMNS = 21; + const NUM_HYDRATE_COLUMNS = 19; /** the column name for the id field */ const ID = 'cc_show.id'; @@ -83,15 +83,9 @@ abstract class BaseCcShowPeer /** the column name for the autoplaylist_repeat field */ const AUTOPLAYLIST_REPEAT = 'cc_show.autoplaylist_repeat'; - /** the column name for the override_intro_playlist field */ - const OVERRIDE_INTRO_PLAYLIST = 'cc_show.override_intro_playlist'; - /** the column name for the intro_playlist_id field */ const INTRO_PLAYLIST_ID = 'cc_show.intro_playlist_id'; - /** the column name for the override_outro_playlist field */ - const OVERRIDE_OUTRO_PLAYLIST = 'cc_show.override_outro_playlist'; - /** the column name for the outro_playlist_id field */ const OUTRO_PLAYLIST_ID = 'cc_show.outro_playlist_id'; @@ -114,12 +108,12 @@ abstract class BaseCcShowPeer * e.g. CcShowPeer::$fieldNames[CcShowPeer::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', 'DbImagePath', 'DbHasAutoPlaylist', 'DbAutoPlaylistId', 'DbAutoPlaylistRepeat', 'DbOverrideIntroPlaylist', 'DbIntroPlaylistId', 'DbOverrideOutroPlaylist', 'DbOutroPlaylistId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', 'dbImagePath', 'dbHasAutoPlaylist', 'dbAutoPlaylistId', 'dbAutoPlaylistRepeat', 'dbOverrideIntroPlaylist', 'dbIntroPlaylistId', 'dbOverrideOutroPlaylist', 'dbOutroPlaylistId', ), - BasePeer::TYPE_COLNAME => array (CcShowPeer::ID, CcShowPeer::NAME, CcShowPeer::URL, CcShowPeer::GENRE, CcShowPeer::DESCRIPTION, CcShowPeer::COLOR, CcShowPeer::BACKGROUND_COLOR, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, CcShowPeer::LIVE_STREAM_USER, CcShowPeer::LIVE_STREAM_PASS, CcShowPeer::LINKED, CcShowPeer::IS_LINKABLE, CcShowPeer::IMAGE_PATH, CcShowPeer::HAS_AUTOPLAYLIST, CcShowPeer::AUTOPLAYLIST_ID, CcShowPeer::AUTOPLAYLIST_REPEAT, CcShowPeer::OVERRIDE_INTRO_PLAYLIST, CcShowPeer::INTRO_PLAYLIST_ID, CcShowPeer::OVERRIDE_OUTRO_PLAYLIST, CcShowPeer::OUTRO_PLAYLIST_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', 'IMAGE_PATH', 'HAS_AUTOPLAYLIST', 'AUTOPLAYLIST_ID', 'AUTOPLAYLIST_REPEAT', 'OVERRIDE_INTRO_PLAYLIST', 'INTRO_PLAYLIST_ID', 'OVERRIDE_OUTRO_PLAYLIST', 'OUTRO_PLAYLIST_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', 'image_path', 'has_autoplaylist', 'autoplaylist_id', 'autoplaylist_repeat', 'override_intro_playlist', 'intro_playlist_id', 'override_outro_playlist', 'outro_playlist_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', 'DbImagePath', 'DbHasAutoPlaylist', 'DbAutoPlaylistId', 'DbAutoPlaylistRepeat', 'DbIntroPlaylistId', 'DbOutroPlaylistId', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', 'dbImagePath', 'dbHasAutoPlaylist', 'dbAutoPlaylistId', 'dbAutoPlaylistRepeat', 'dbIntroPlaylistId', 'dbOutroPlaylistId', ), + BasePeer::TYPE_COLNAME => array (CcShowPeer::ID, CcShowPeer::NAME, CcShowPeer::URL, CcShowPeer::GENRE, CcShowPeer::DESCRIPTION, CcShowPeer::COLOR, CcShowPeer::BACKGROUND_COLOR, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, CcShowPeer::LIVE_STREAM_USER, CcShowPeer::LIVE_STREAM_PASS, CcShowPeer::LINKED, CcShowPeer::IS_LINKABLE, CcShowPeer::IMAGE_PATH, CcShowPeer::HAS_AUTOPLAYLIST, CcShowPeer::AUTOPLAYLIST_ID, CcShowPeer::AUTOPLAYLIST_REPEAT, CcShowPeer::INTRO_PLAYLIST_ID, CcShowPeer::OUTRO_PLAYLIST_ID, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', 'IMAGE_PATH', 'HAS_AUTOPLAYLIST', 'AUTOPLAYLIST_ID', 'AUTOPLAYLIST_REPEAT', 'INTRO_PLAYLIST_ID', 'OUTRO_PLAYLIST_ID', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', 'image_path', 'has_autoplaylist', 'autoplaylist_id', 'autoplaylist_repeat', 'intro_playlist_id', 'outro_playlist_id', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ) ); /** @@ -129,12 +123,12 @@ abstract class BaseCcShowPeer * e.g. CcShowPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, 'DbLinked' => 11, 'DbIsLinkable' => 12, 'DbImagePath' => 13, 'DbHasAutoPlaylist' => 14, 'DbAutoPlaylistId' => 15, 'DbAutoPlaylistRepeat' => 16, 'DbOverrideIntroPlaylist' => 17, 'DbIntroPlaylistId' => 18, 'DbOverrideOutroPlaylist' => 19, 'DbOutroPlaylistId' => 20, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, 'dbLinked' => 11, 'dbIsLinkable' => 12, 'dbImagePath' => 13, 'dbHasAutoPlaylist' => 14, 'dbAutoPlaylistId' => 15, 'dbAutoPlaylistRepeat' => 16, 'dbOverrideIntroPlaylist' => 17, 'dbIntroPlaylistId' => 18, 'dbOverrideOutroPlaylist' => 19, 'dbOutroPlaylistId' => 20, ), - BasePeer::TYPE_COLNAME => array (CcShowPeer::ID => 0, CcShowPeer::NAME => 1, CcShowPeer::URL => 2, CcShowPeer::GENRE => 3, CcShowPeer::DESCRIPTION => 4, CcShowPeer::COLOR => 5, CcShowPeer::BACKGROUND_COLOR => 6, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH => 7, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH => 8, CcShowPeer::LIVE_STREAM_USER => 9, CcShowPeer::LIVE_STREAM_PASS => 10, CcShowPeer::LINKED => 11, CcShowPeer::IS_LINKABLE => 12, CcShowPeer::IMAGE_PATH => 13, CcShowPeer::HAS_AUTOPLAYLIST => 14, CcShowPeer::AUTOPLAYLIST_ID => 15, CcShowPeer::AUTOPLAYLIST_REPEAT => 16, CcShowPeer::OVERRIDE_INTRO_PLAYLIST => 17, CcShowPeer::INTRO_PLAYLIST_ID => 18, CcShowPeer::OVERRIDE_OUTRO_PLAYLIST => 19, CcShowPeer::OUTRO_PLAYLIST_ID => 20, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, 'IMAGE_PATH' => 13, 'HAS_AUTOPLAYLIST' => 14, 'AUTOPLAYLIST_ID' => 15, 'AUTOPLAYLIST_REPEAT' => 16, 'OVERRIDE_INTRO_PLAYLIST' => 17, 'INTRO_PLAYLIST_ID' => 18, 'OVERRIDE_OUTRO_PLAYLIST' => 19, 'OUTRO_PLAYLIST_ID' => 20, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, 'image_path' => 13, 'has_autoplaylist' => 14, 'autoplaylist_id' => 15, 'autoplaylist_repeat' => 16, 'override_intro_playlist' => 17, 'intro_playlist_id' => 18, 'override_outro_playlist' => 19, 'outro_playlist_id' => 20, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) + BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, 'DbLinked' => 11, 'DbIsLinkable' => 12, 'DbImagePath' => 13, 'DbHasAutoPlaylist' => 14, 'DbAutoPlaylistId' => 15, 'DbAutoPlaylistRepeat' => 16, 'DbIntroPlaylistId' => 17, 'DbOutroPlaylistId' => 18, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, 'dbLinked' => 11, 'dbIsLinkable' => 12, 'dbImagePath' => 13, 'dbHasAutoPlaylist' => 14, 'dbAutoPlaylistId' => 15, 'dbAutoPlaylistRepeat' => 16, 'dbIntroPlaylistId' => 17, 'dbOutroPlaylistId' => 18, ), + BasePeer::TYPE_COLNAME => array (CcShowPeer::ID => 0, CcShowPeer::NAME => 1, CcShowPeer::URL => 2, CcShowPeer::GENRE => 3, CcShowPeer::DESCRIPTION => 4, CcShowPeer::COLOR => 5, CcShowPeer::BACKGROUND_COLOR => 6, CcShowPeer::LIVE_STREAM_USING_AIRTIME_AUTH => 7, CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH => 8, CcShowPeer::LIVE_STREAM_USER => 9, CcShowPeer::LIVE_STREAM_PASS => 10, CcShowPeer::LINKED => 11, CcShowPeer::IS_LINKABLE => 12, CcShowPeer::IMAGE_PATH => 13, CcShowPeer::HAS_AUTOPLAYLIST => 14, CcShowPeer::AUTOPLAYLIST_ID => 15, CcShowPeer::AUTOPLAYLIST_REPEAT => 16, CcShowPeer::INTRO_PLAYLIST_ID => 17, CcShowPeer::OUTRO_PLAYLIST_ID => 18, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, 'IMAGE_PATH' => 13, 'HAS_AUTOPLAYLIST' => 14, 'AUTOPLAYLIST_ID' => 15, 'AUTOPLAYLIST_REPEAT' => 16, 'INTRO_PLAYLIST_ID' => 17, 'OUTRO_PLAYLIST_ID' => 18, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, 'image_path' => 13, 'has_autoplaylist' => 14, 'autoplaylist_id' => 15, 'autoplaylist_repeat' => 16, 'intro_playlist_id' => 17, 'outro_playlist_id' => 18, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ) ); /** @@ -225,9 +219,7 @@ public static function addSelectColumns(Criteria $criteria, $alias = null) $criteria->addSelectColumn(CcShowPeer::HAS_AUTOPLAYLIST); $criteria->addSelectColumn(CcShowPeer::AUTOPLAYLIST_ID); $criteria->addSelectColumn(CcShowPeer::AUTOPLAYLIST_REPEAT); - $criteria->addSelectColumn(CcShowPeer::OVERRIDE_INTRO_PLAYLIST); $criteria->addSelectColumn(CcShowPeer::INTRO_PLAYLIST_ID); - $criteria->addSelectColumn(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST); $criteria->addSelectColumn(CcShowPeer::OUTRO_PLAYLIST_ID); } else { $criteria->addSelectColumn($alias . '.id'); @@ -247,9 +239,7 @@ public static function addSelectColumns(Criteria $criteria, $alias = null) $criteria->addSelectColumn($alias . '.has_autoplaylist'); $criteria->addSelectColumn($alias . '.autoplaylist_id'); $criteria->addSelectColumn($alias . '.autoplaylist_repeat'); - $criteria->addSelectColumn($alias . '.override_intro_playlist'); $criteria->addSelectColumn($alias . '.intro_playlist_id'); - $criteria->addSelectColumn($alias . '.override_outro_playlist'); $criteria->addSelectColumn($alias . '.outro_playlist_id'); } } diff --git a/legacy/application/models/airtime/om/BaseCcShowQuery.php b/legacy/application/models/airtime/om/BaseCcShowQuery.php index 0445c121e7..ded80c7460 100644 --- a/legacy/application/models/airtime/om/BaseCcShowQuery.php +++ b/legacy/application/models/airtime/om/BaseCcShowQuery.php @@ -23,9 +23,7 @@ * @method CcShowQuery orderByDbHasAutoPlaylist($order = Criteria::ASC) Order by the has_autoplaylist column * @method CcShowQuery orderByDbAutoPlaylistId($order = Criteria::ASC) Order by the autoplaylist_id column * @method CcShowQuery orderByDbAutoPlaylistRepeat($order = Criteria::ASC) Order by the autoplaylist_repeat column - * @method CcShowQuery orderByDbOverrideIntroPlaylist($order = Criteria::ASC) Order by the override_intro_playlist column * @method CcShowQuery orderByDbIntroPlaylistId($order = Criteria::ASC) Order by the intro_playlist_id column - * @method CcShowQuery orderByDbOverrideOutroPlaylist($order = Criteria::ASC) Order by the override_outro_playlist column * @method CcShowQuery orderByDbOutroPlaylistId($order = Criteria::ASC) Order by the outro_playlist_id column * * @method CcShowQuery groupByDbId() Group by the id column @@ -45,9 +43,7 @@ * @method CcShowQuery groupByDbHasAutoPlaylist() Group by the has_autoplaylist column * @method CcShowQuery groupByDbAutoPlaylistId() Group by the autoplaylist_id column * @method CcShowQuery groupByDbAutoPlaylistRepeat() Group by the autoplaylist_repeat column - * @method CcShowQuery groupByDbOverrideIntroPlaylist() Group by the override_intro_playlist column * @method CcShowQuery groupByDbIntroPlaylistId() Group by the intro_playlist_id column - * @method CcShowQuery groupByDbOverrideOutroPlaylist() Group by the override_outro_playlist column * @method CcShowQuery groupByDbOutroPlaylistId() Group by the outro_playlist_id column * * @method CcShowQuery leftJoin($relation) Adds a LEFT JOIN clause to the query @@ -101,9 +97,7 @@ * @method CcShow findOneByDbHasAutoPlaylist(boolean $has_autoplaylist) Return the first CcShow filtered by the has_autoplaylist column * @method CcShow findOneByDbAutoPlaylistId(int $autoplaylist_id) Return the first CcShow filtered by the autoplaylist_id column * @method CcShow findOneByDbAutoPlaylistRepeat(boolean $autoplaylist_repeat) Return the first CcShow filtered by the autoplaylist_repeat column - * @method CcShow findOneByDbOverrideIntroPlaylist(boolean $override_intro_playlist) Return the first CcShow filtered by the override_intro_playlist column * @method CcShow findOneByDbIntroPlaylistId(int $intro_playlist_id) Return the first CcShow filtered by the intro_playlist_id column - * @method CcShow findOneByDbOverrideOutroPlaylist(boolean $override_outro_playlist) Return the first CcShow filtered by the override_outro_playlist column * @method CcShow findOneByDbOutroPlaylistId(int $outro_playlist_id) Return the first CcShow filtered by the outro_playlist_id column * * @method array findByDbId(int $id) Return CcShow objects filtered by the id column @@ -123,9 +117,7 @@ * @method array findByDbHasAutoPlaylist(boolean $has_autoplaylist) Return CcShow objects filtered by the has_autoplaylist column * @method array findByDbAutoPlaylistId(int $autoplaylist_id) Return CcShow objects filtered by the autoplaylist_id column * @method array findByDbAutoPlaylistRepeat(boolean $autoplaylist_repeat) Return CcShow objects filtered by the autoplaylist_repeat column - * @method array findByDbOverrideIntroPlaylist(boolean $override_intro_playlist) Return CcShow objects filtered by the override_intro_playlist column * @method array findByDbIntroPlaylistId(int $intro_playlist_id) Return CcShow objects filtered by the intro_playlist_id column - * @method array findByDbOverrideOutroPlaylist(boolean $override_outro_playlist) Return CcShow objects filtered by the override_outro_playlist column * @method array findByDbOutroPlaylistId(int $outro_playlist_id) Return CcShow objects filtered by the outro_playlist_id column * * @package propel.generator.airtime.om @@ -234,7 +226,7 @@ public function findOneByDbId($key, $con = null) */ protected function findPkSimple($key, $con) { - $sql = 'SELECT "id", "name", "url", "genre", "description", "color", "background_color", "live_stream_using_airtime_auth", "live_stream_using_custom_auth", "live_stream_user", "live_stream_pass", "linked", "is_linkable", "image_path", "has_autoplaylist", "autoplaylist_id", "autoplaylist_repeat", "override_intro_playlist", "intro_playlist_id", "override_outro_playlist", "outro_playlist_id" FROM "cc_show" WHERE "id" = :p0'; + $sql = 'SELECT "id", "name", "url", "genre", "description", "color", "background_color", "live_stream_using_airtime_auth", "live_stream_using_custom_auth", "live_stream_user", "live_stream_pass", "linked", "is_linkable", "image_path", "has_autoplaylist", "autoplaylist_id", "autoplaylist_repeat", "intro_playlist_id", "outro_playlist_id" FROM "cc_show" WHERE "id" = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -832,33 +824,6 @@ public function filterByDbAutoPlaylistRepeat($dbAutoPlaylistRepeat = null, $comp return $this->addUsingAlias(CcShowPeer::AUTOPLAYLIST_REPEAT, $dbAutoPlaylistRepeat, $comparison); } - /** - * Filter the query on the override_intro_playlist column - * - * Example usage: - * - * $query->filterByDbOverrideIntroPlaylist(true); // WHERE override_intro_playlist = true - * $query->filterByDbOverrideIntroPlaylist('yes'); // WHERE override_intro_playlist = true - * - * - * @param boolean|string $dbOverrideIntroPlaylist The value to use as filter. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbOverrideIntroPlaylist($dbOverrideIntroPlaylist = null, $comparison = null) - { - if (is_string($dbOverrideIntroPlaylist)) { - $dbOverrideIntroPlaylist = in_array(strtolower($dbOverrideIntroPlaylist), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } - - return $this->addUsingAlias(CcShowPeer::OVERRIDE_INTRO_PLAYLIST, $dbOverrideIntroPlaylist, $comparison); - } - /** * Filter the query on the intro_playlist_id column * @@ -903,33 +868,6 @@ public function filterByDbIntroPlaylistId($dbIntroPlaylistId = null, $comparison return $this->addUsingAlias(CcShowPeer::INTRO_PLAYLIST_ID, $dbIntroPlaylistId, $comparison); } - /** - * Filter the query on the override_outro_playlist column - * - * Example usage: - * - * $query->filterByDbOverrideOutroPlaylist(true); // WHERE override_outro_playlist = true - * $query->filterByDbOverrideOutroPlaylist('yes'); // WHERE override_outro_playlist = true - * - * - * @param boolean|string $dbOverrideOutroPlaylist The value to use as filter. - * Non-boolean arguments are converted using the following rules: - * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true - * * 0, '0', 'false', 'off', and 'no' are converted to boolean false - * Check on string values is case insensitive (so 'FaLsE' is seen as 'false'). - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbOverrideOutroPlaylist($dbOverrideOutroPlaylist = null, $comparison = null) - { - if (is_string($dbOverrideOutroPlaylist)) { - $dbOverrideOutroPlaylist = in_array(strtolower($dbOverrideOutroPlaylist), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true; - } - - return $this->addUsingAlias(CcShowPeer::OVERRIDE_OUTRO_PLAYLIST, $dbOverrideOutroPlaylist, $comparison); - } - /** * Filter the query on the outro_playlist_id column * diff --git a/legacy/application/services/ShowFormService.php b/legacy/application/services/ShowFormService.php index 044e5114c8..a0509a5736 100644 --- a/legacy/application/services/ShowFormService.php +++ b/legacy/application/services/ShowFormService.php @@ -164,9 +164,7 @@ private function populateFormAutoPlaylist($form) 'add_show_has_autoplaylist' => $this->ccShow->getDbHasAutoPlaylist() ? 1 : 0, 'add_show_autoplaylist_id' => $this->ccShow->getDbAutoPlaylistId(), 'add_show_autoplaylist_repeat' => $this->ccShow->getDbAutoPlaylistRepeat(), - 'add_show_override_intro_playlist' => $this->ccShow->getDbOverrideIntroPlaylist() ? 1 : 0, 'add_show_intro_playlist_id' => $this->ccShow->getDbIntroPlaylistId(), - 'add_show_override_outro_playlist' => $this->ccShow->getDbOverrideOutroPlaylist() ? 1 : 0, 'add_show_outro_playlist_id' => $this->ccShow->getDbOutroPlaylistId(), ] ); diff --git a/legacy/application/services/ShowService.php b/legacy/application/services/ShowService.php index a0686fa5cc..62f9230b23 100644 --- a/legacy/application/services/ShowService.php +++ b/legacy/application/services/ShowService.php @@ -1667,8 +1667,6 @@ public function setCcShow($showData) if ($showData['add_show_autoplaylist_id'] != '') { $ccShow->setDbAutoPlaylistId($showData['add_show_autoplaylist_id']); } - $ccShow->setDbOverrideIntroPlaylist($showData['add_show_override_intro_playlist'] == 1); - $ccShow->setDbOverrideOutroPlaylist($showData['add_show_override_outro_playlist'] == 1); if ($showData['add_show_intro_playlist_id'] != '') { $ccShow->setDbIntroPlaylistId($showData['add_show_intro_playlist_id']); } diff --git a/legacy/application/views/scripts/form/add-show-autoplaylist.phtml b/legacy/application/views/scripts/form/add-show-autoplaylist.phtml index 5cf8efb1a1..dd57c852c0 100644 --- a/legacy/application/views/scripts/form/add-show-autoplaylist.phtml +++ b/legacy/application/views/scripts/form/add-show-autoplaylist.phtml @@ -32,14 +32,6 @@
-
- -
-
- element->getElement('add_show_override_intro_playlist') ?> -
-
- -
-
- element->getElement('add_show_override_outro_playlist') ?> -