From a51b04e422d0412207a2783087ed9f1669c737c6 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 26 Jul 2012 14:49:42 -0400 Subject: [PATCH] CC-84: Smart Playlists - db schema change for type column on playlistcontents --- .../map/CcPlaylistcontentsTableMap.php | 1 + .../airtime/om/BaseCcPlaylistcontents.php | 112 +++++++++++++----- .../airtime/om/BaseCcPlaylistcontentsPeer.php | 31 +++-- .../om/BaseCcPlaylistcontentsQuery.php | 35 ++++++ airtime_mvc/build/schema.xml | 6 + airtime_mvc/build/sql/schema.sql | 1 + 6 files changed, 144 insertions(+), 42 deletions(-) diff --git a/airtime_mvc/application/models/airtime/map/CcPlaylistcontentsTableMap.php b/airtime_mvc/application/models/airtime/map/CcPlaylistcontentsTableMap.php index 936475187..a60939e85 100644 --- a/airtime_mvc/application/models/airtime/map/CcPlaylistcontentsTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcPlaylistcontentsTableMap.php @@ -42,6 +42,7 @@ class CcPlaylistcontentsTableMap extends TableMap { $this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null); $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); $this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null); + $this->addColumn('TYPE', 'DbType', 'SMALLINT', true, null, 0); $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); $this->addColumn('CLIPLENGTH', 'DbCliplength', 'VARCHAR', false, null, '00:00:00'); $this->addColumn('CUEIN', 'DbCuein', 'VARCHAR', false, null, '00:00:00'); diff --git a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontents.php b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontents.php index 572bc9849..a0e3fe679 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontents.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontents.php @@ -48,6 +48,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent */ protected $block_id; + /** + * The value for the type field. + * Note: this column has a database default value of: 0 + * @var int + */ + protected $type; + /** * The value for the position field. * @var int @@ -129,6 +136,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent */ public function applyDefaultValues() { + $this->type = 0; $this->cliplength = '00:00:00'; $this->cuein = '00:00:00'; $this->cueout = '00:00:00'; @@ -186,6 +194,16 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent return $this->block_id; } + /** + * Get the [type] column value. + * + * @return int + */ + public function getDbType() + { + return $this->type; + } + /** * Get the [position] column value. * @@ -384,6 +402,26 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent return $this; } // setDbBlockId() + /** + * Set the value of [type] column. + * + * @param int $v new value + * @return CcPlaylistcontents The current object (for fluent API support) + */ + public function setDbType($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->type !== $v || $this->isNew()) { + $this->type = $v; + $this->modifiedColumns[] = CcPlaylistcontentsPeer::TYPE; + } + + return $this; + } // setDbType() + /** * Set the value of [position] column. * @@ -574,6 +612,10 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent */ public function hasOnlyDefaultValues() { + if ($this->type !== 0) { + return false; + } + if ($this->cliplength !== '00:00:00') { return false; } @@ -620,12 +662,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent $this->playlist_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; $this->file_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; $this->block_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->position = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->cliplength = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->cuein = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->cueout = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->fadein = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->fadeout = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; + $this->type = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; + $this->position = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; + $this->cliplength = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; + $this->cuein = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; + $this->cueout = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; + $this->fadein = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; + $this->fadeout = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; $this->resetModified(); $this->setNew(false); @@ -634,7 +677,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent $this->ensureConsistency(); } - return $startcol + 10; // 10 = CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 11; // 11 = CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating CcPlaylistcontents object", $e); @@ -1010,21 +1053,24 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent return $this->getDbBlockId(); break; case 4: - return $this->getDbPosition(); + return $this->getDbType(); break; case 5: - return $this->getDbCliplength(); + return $this->getDbPosition(); break; case 6: - return $this->getDbCuein(); + return $this->getDbCliplength(); break; case 7: - return $this->getDbCueout(); + return $this->getDbCuein(); break; case 8: - return $this->getDbFadein(); + return $this->getDbCueout(); break; case 9: + return $this->getDbFadein(); + break; + case 10: return $this->getDbFadeout(); break; default: @@ -1055,12 +1101,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent $keys[1] => $this->getDbPlaylistId(), $keys[2] => $this->getDbFileId(), $keys[3] => $this->getDbBlockId(), - $keys[4] => $this->getDbPosition(), - $keys[5] => $this->getDbCliplength(), - $keys[6] => $this->getDbCuein(), - $keys[7] => $this->getDbCueout(), - $keys[8] => $this->getDbFadein(), - $keys[9] => $this->getDbFadeout(), + $keys[4] => $this->getDbType(), + $keys[5] => $this->getDbPosition(), + $keys[6] => $this->getDbCliplength(), + $keys[7] => $this->getDbCuein(), + $keys[8] => $this->getDbCueout(), + $keys[9] => $this->getDbFadein(), + $keys[10] => $this->getDbFadeout(), ); if ($includeForeignObjects) { if (null !== $this->aCcFiles) { @@ -1116,21 +1163,24 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent $this->setDbBlockId($value); break; case 4: - $this->setDbPosition($value); + $this->setDbType($value); break; case 5: - $this->setDbCliplength($value); + $this->setDbPosition($value); break; case 6: - $this->setDbCuein($value); + $this->setDbCliplength($value); break; case 7: - $this->setDbCueout($value); + $this->setDbCuein($value); break; case 8: - $this->setDbFadein($value); + $this->setDbCueout($value); break; case 9: + $this->setDbFadein($value); + break; + case 10: $this->setDbFadeout($value); break; } // switch() @@ -1161,12 +1211,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent if (array_key_exists($keys[1], $arr)) $this->setDbPlaylistId($arr[$keys[1]]); if (array_key_exists($keys[2], $arr)) $this->setDbFileId($arr[$keys[2]]); if (array_key_exists($keys[3], $arr)) $this->setDbBlockId($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbPosition($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbCliplength($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbCuein($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbCueout($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbFadein($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbFadeout($arr[$keys[9]]); + if (array_key_exists($keys[4], $arr)) $this->setDbType($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setDbPosition($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setDbCliplength($arr[$keys[6]]); + if (array_key_exists($keys[7], $arr)) $this->setDbCuein($arr[$keys[7]]); + if (array_key_exists($keys[8], $arr)) $this->setDbCueout($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setDbFadein($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setDbFadeout($arr[$keys[10]]); } /** @@ -1182,6 +1233,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent if ($this->isColumnModified(CcPlaylistcontentsPeer::PLAYLIST_ID)) $criteria->add(CcPlaylistcontentsPeer::PLAYLIST_ID, $this->playlist_id); if ($this->isColumnModified(CcPlaylistcontentsPeer::FILE_ID)) $criteria->add(CcPlaylistcontentsPeer::FILE_ID, $this->file_id); if ($this->isColumnModified(CcPlaylistcontentsPeer::BLOCK_ID)) $criteria->add(CcPlaylistcontentsPeer::BLOCK_ID, $this->block_id); + if ($this->isColumnModified(CcPlaylistcontentsPeer::TYPE)) $criteria->add(CcPlaylistcontentsPeer::TYPE, $this->type); if ($this->isColumnModified(CcPlaylistcontentsPeer::POSITION)) $criteria->add(CcPlaylistcontentsPeer::POSITION, $this->position); if ($this->isColumnModified(CcPlaylistcontentsPeer::CLIPLENGTH)) $criteria->add(CcPlaylistcontentsPeer::CLIPLENGTH, $this->cliplength); if ($this->isColumnModified(CcPlaylistcontentsPeer::CUEIN)) $criteria->add(CcPlaylistcontentsPeer::CUEIN, $this->cuein); @@ -1252,6 +1304,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent $copyObj->setDbPlaylistId($this->playlist_id); $copyObj->setDbFileId($this->file_id); $copyObj->setDbBlockId($this->block_id); + $copyObj->setDbType($this->type); $copyObj->setDbPosition($this->position); $copyObj->setDbCliplength($this->cliplength); $copyObj->setDbCuein($this->cuein); @@ -1461,6 +1514,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent $this->playlist_id = null; $this->file_id = null; $this->block_id = null; + $this->type = null; $this->position = null; $this->cliplength = null; $this->cuein = null; diff --git a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsPeer.php index de309bde6..a498b6c04 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsPeer.php @@ -26,7 +26,7 @@ abstract class BaseCcPlaylistcontentsPeer { const TM_CLASS = 'CcPlaylistcontentsTableMap'; /** The total number of columns. */ - const NUM_COLUMNS = 10; + const NUM_COLUMNS = 11; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -43,6 +43,9 @@ abstract class BaseCcPlaylistcontentsPeer { /** the column name for the BLOCK_ID field */ const BLOCK_ID = 'cc_playlistcontents.BLOCK_ID'; + /** the column name for the TYPE field */ + const TYPE = 'cc_playlistcontents.TYPE'; + /** the column name for the POSITION field */ const POSITION = 'cc_playlistcontents.POSITION'; @@ -77,12 +80,12 @@ abstract class BaseCcPlaylistcontentsPeer { * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPlaylistId', 'DbFileId', 'DbBlockId', 'DbPosition', 'DbCliplength', 'DbCuein', 'DbCueout', 'DbFadein', 'DbFadeout', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbFileId', 'dbBlockId', 'dbPosition', 'dbCliplength', 'dbCuein', 'dbCueout', 'dbFadein', 'dbFadeout', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::FILE_ID, self::BLOCK_ID, self::POSITION, self::CLIPLENGTH, self::CUEIN, self::CUEOUT, self::FADEIN, self::FADEOUT, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'FILE_ID', 'BLOCK_ID', 'POSITION', 'CLIPLENGTH', 'CUEIN', 'CUEOUT', 'FADEIN', 'FADEOUT', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'file_id', 'block_id', 'position', 'cliplength', 'cuein', 'cueout', 'fadein', 'fadeout', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPlaylistId', 'DbFileId', 'DbBlockId', 'DbType', 'DbPosition', 'DbCliplength', 'DbCuein', 'DbCueout', 'DbFadein', 'DbFadeout', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbFileId', 'dbBlockId', 'dbType', 'dbPosition', 'dbCliplength', 'dbCuein', 'dbCueout', 'dbFadein', 'dbFadeout', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::FILE_ID, self::BLOCK_ID, self::TYPE, self::POSITION, self::CLIPLENGTH, self::CUEIN, self::CUEOUT, self::FADEIN, self::FADEOUT, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'FILE_ID', 'BLOCK_ID', 'TYPE', 'POSITION', 'CLIPLENGTH', 'CUEIN', 'CUEOUT', 'FADEIN', 'FADEOUT', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'file_id', 'block_id', 'type', 'position', 'cliplength', 'cuein', 'cueout', 'fadein', 'fadeout', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) ); /** @@ -92,12 +95,12 @@ abstract class BaseCcPlaylistcontentsPeer { * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPlaylistId' => 1, 'DbFileId' => 2, 'DbBlockId' => 3, 'DbPosition' => 4, 'DbCliplength' => 5, 'DbCuein' => 6, 'DbCueout' => 7, 'DbFadein' => 8, 'DbFadeout' => 9, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbFileId' => 2, 'dbBlockId' => 3, 'dbPosition' => 4, 'dbCliplength' => 5, 'dbCuein' => 6, 'dbCueout' => 7, 'dbFadein' => 8, 'dbFadeout' => 9, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::FILE_ID => 2, self::BLOCK_ID => 3, self::POSITION => 4, self::CLIPLENGTH => 5, self::CUEIN => 6, self::CUEOUT => 7, self::FADEIN => 8, self::FADEOUT => 9, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'FILE_ID' => 2, 'BLOCK_ID' => 3, 'POSITION' => 4, 'CLIPLENGTH' => 5, 'CUEIN' => 6, 'CUEOUT' => 7, 'FADEIN' => 8, 'FADEOUT' => 9, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'file_id' => 2, 'block_id' => 3, 'position' => 4, 'cliplength' => 5, 'cuein' => 6, 'cueout' => 7, 'fadein' => 8, 'fadeout' => 9, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) + BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPlaylistId' => 1, 'DbFileId' => 2, 'DbBlockId' => 3, 'DbType' => 4, 'DbPosition' => 5, 'DbCliplength' => 6, 'DbCuein' => 7, 'DbCueout' => 8, 'DbFadein' => 9, 'DbFadeout' => 10, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbFileId' => 2, 'dbBlockId' => 3, 'dbType' => 4, 'dbPosition' => 5, 'dbCliplength' => 6, 'dbCuein' => 7, 'dbCueout' => 8, 'dbFadein' => 9, 'dbFadeout' => 10, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::FILE_ID => 2, self::BLOCK_ID => 3, self::TYPE => 4, self::POSITION => 5, self::CLIPLENGTH => 6, self::CUEIN => 7, self::CUEOUT => 8, self::FADEIN => 9, self::FADEOUT => 10, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'FILE_ID' => 2, 'BLOCK_ID' => 3, 'TYPE' => 4, 'POSITION' => 5, 'CLIPLENGTH' => 6, 'CUEIN' => 7, 'CUEOUT' => 8, 'FADEIN' => 9, 'FADEOUT' => 10, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'file_id' => 2, 'block_id' => 3, 'type' => 4, 'position' => 5, 'cliplength' => 6, 'cuein' => 7, 'cueout' => 8, 'fadein' => 9, 'fadeout' => 10, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) ); /** @@ -173,6 +176,7 @@ abstract class BaseCcPlaylistcontentsPeer { $criteria->addSelectColumn(CcPlaylistcontentsPeer::PLAYLIST_ID); $criteria->addSelectColumn(CcPlaylistcontentsPeer::FILE_ID); $criteria->addSelectColumn(CcPlaylistcontentsPeer::BLOCK_ID); + $criteria->addSelectColumn(CcPlaylistcontentsPeer::TYPE); $criteria->addSelectColumn(CcPlaylistcontentsPeer::POSITION); $criteria->addSelectColumn(CcPlaylistcontentsPeer::CLIPLENGTH); $criteria->addSelectColumn(CcPlaylistcontentsPeer::CUEIN); @@ -184,6 +188,7 @@ abstract class BaseCcPlaylistcontentsPeer { $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); $criteria->addSelectColumn($alias . '.FILE_ID'); $criteria->addSelectColumn($alias . '.BLOCK_ID'); + $criteria->addSelectColumn($alias . '.TYPE'); $criteria->addSelectColumn($alias . '.POSITION'); $criteria->addSelectColumn($alias . '.CLIPLENGTH'); $criteria->addSelectColumn($alias . '.CUEIN'); diff --git a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsQuery.php index c9c0b42b5..9a8c4e4a1 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistcontentsQuery.php @@ -10,6 +10,7 @@ * @method CcPlaylistcontentsQuery orderByDbPlaylistId($order = Criteria::ASC) Order by the playlist_id column * @method CcPlaylistcontentsQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column * @method CcPlaylistcontentsQuery orderByDbBlockId($order = Criteria::ASC) Order by the block_id column + * @method CcPlaylistcontentsQuery orderByDbType($order = Criteria::ASC) Order by the type column * @method CcPlaylistcontentsQuery orderByDbPosition($order = Criteria::ASC) Order by the position column * @method CcPlaylistcontentsQuery orderByDbCliplength($order = Criteria::ASC) Order by the cliplength column * @method CcPlaylistcontentsQuery orderByDbCuein($order = Criteria::ASC) Order by the cuein column @@ -21,6 +22,7 @@ * @method CcPlaylistcontentsQuery groupByDbPlaylistId() Group by the playlist_id column * @method CcPlaylistcontentsQuery groupByDbFileId() Group by the file_id column * @method CcPlaylistcontentsQuery groupByDbBlockId() Group by the block_id column + * @method CcPlaylistcontentsQuery groupByDbType() Group by the type column * @method CcPlaylistcontentsQuery groupByDbPosition() Group by the position column * @method CcPlaylistcontentsQuery groupByDbCliplength() Group by the cliplength column * @method CcPlaylistcontentsQuery groupByDbCuein() Group by the cuein column @@ -51,6 +53,7 @@ * @method CcPlaylistcontents findOneByDbPlaylistId(int $playlist_id) Return the first CcPlaylistcontents filtered by the playlist_id column * @method CcPlaylistcontents findOneByDbFileId(int $file_id) Return the first CcPlaylistcontents filtered by the file_id column * @method CcPlaylistcontents findOneByDbBlockId(int $block_id) Return the first CcPlaylistcontents filtered by the block_id column + * @method CcPlaylistcontents findOneByDbType(int $type) Return the first CcPlaylistcontents filtered by the type column * @method CcPlaylistcontents findOneByDbPosition(int $position) Return the first CcPlaylistcontents filtered by the position column * @method CcPlaylistcontents findOneByDbCliplength(string $cliplength) Return the first CcPlaylistcontents filtered by the cliplength column * @method CcPlaylistcontents findOneByDbCuein(string $cuein) Return the first CcPlaylistcontents filtered by the cuein column @@ -62,6 +65,7 @@ * @method array findByDbPlaylistId(int $playlist_id) Return CcPlaylistcontents objects filtered by the playlist_id column * @method array findByDbFileId(int $file_id) Return CcPlaylistcontents objects filtered by the file_id column * @method array findByDbBlockId(int $block_id) Return CcPlaylistcontents objects filtered by the block_id column + * @method array findByDbType(int $type) Return CcPlaylistcontents objects filtered by the type column * @method array findByDbPosition(int $position) Return CcPlaylistcontents objects filtered by the position column * @method array findByDbCliplength(string $cliplength) Return CcPlaylistcontents objects filtered by the cliplength column * @method array findByDbCuein(string $cuein) Return CcPlaylistcontents objects filtered by the cuein column @@ -287,6 +291,37 @@ abstract class BaseCcPlaylistcontentsQuery extends ModelCriteria return $this->addUsingAlias(CcPlaylistcontentsPeer::BLOCK_ID, $dbBlockId, $comparison); } + /** + * Filter the query on the type column + * + * @param int|array $dbType The value to use as filter. + * Accepts an associative array('min' => $minValue, 'max' => $maxValue) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcPlaylistcontentsQuery The current query, for fluid interface + */ + public function filterByDbType($dbType = null, $comparison = null) + { + if (is_array($dbType)) { + $useMinMax = false; + if (isset($dbType['min'])) { + $this->addUsingAlias(CcPlaylistcontentsPeer::TYPE, $dbType['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbType['max'])) { + $this->addUsingAlias(CcPlaylistcontentsPeer::TYPE, $dbType['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcPlaylistcontentsPeer::TYPE, $dbType, $comparison); + } + /** * Filter the query on the position column * diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 7a18b6703..921a77b02 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -239,6 +239,12 @@ + + diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index 47010c168..da4dd70ad 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -322,6 +322,7 @@ CREATE TABLE "cc_playlistcontents" "playlist_id" INTEGER, "file_id" INTEGER, "block_id" INTEGER, + "type" INT2 default 0 NOT NULL, "position" INTEGER, "cliplength" interval default '00:00:00', "cuein" interval default '00:00:00',