CC-1665: Scheduled stream rebroadcasting and recording

-playlists load contents now correctly identify tracks vs streams
This commit is contained in:
Martin Konecny 2012-07-20 17:38:11 -04:00
parent cf2f96ecf1
commit 8b2facaa96
15 changed files with 283 additions and 105 deletions

View file

@ -157,6 +157,7 @@ class Application_Model_Playlist
Logging::log("Getting contents for playlist {$this->id}");
$files = array();
/*
$query = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id);
@ -166,15 +167,63 @@ class Application_Model_Playlist
->endUse();
}
$query->orderByDbPosition()
->filterByDbType(0)
->leftJoinWith('CcFiles');
$rows = $query->find($this->con);
*/
$sql = <<<"EOT"
((SELECT pc.file_id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout,
f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_playlistcontents AS pc
LEFT JOIN cc_files AS f ON pc.file_id=f.id WHERE pc.playlist_id = {$this->id} AND type = 0)
UNION ALL
(SELECT pc.file_id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout,
ws.name as title, ws.login as creator, NULL::boolean as exists, ws.url as path FROM cc_playlistcontents AS pc
LEFT JOIN cc_webstream AS ws on pc.file_id=ws.id WHERE pc.playlist_id = {$this->id} AND type = 1));
EOT;
Logging::debug($sql);
$con = Propel::getConnection();
$rows = $con->query($sql)->fetchAll();
Logging::debug($rows);
/*
#id
#cliplength
#cuein
#cueout
#fadeout
#fadein
gunid
#file_exists
filepath
#track_title
#artist_name
album_title
#length
*/
$offset = 0;
foreach ($rows as &$row) {
Logging::log($row);
$clipSec = Application_Model_Playlist::playlistTimeToSeconds($row['cliplength']);
$offset += $clipSec;
$offset_cliplength = Application_Model_Playlist::secondsToPlaylistTime($offset);
//format the length for UI.
$formatter = new LengthFormatter($row['cliplength']);
$row['cliplength'] = $formatter->format();
$formatter = new LengthFormatter($offset_cliplength);
$row['offset'] = $formatter->format();
}
/*
$i = 0;
$offset = 0;
foreach ($rows as $row) {
Logging::log($row);
$files[$i] = $row->toArray(BasePeer::TYPE_FIELDNAME, true, true);
$clipSec = Application_Common_DateHelper::playlistTimeToSeconds($files[$i]['cliplength']);
$offset += $clipSec;
$offset_cliplength = Application_Common_DateHelper::secondsToPlaylistTime($offset);
@ -188,8 +237,9 @@ class Application_Model_Playlist
$i++;
}
*/
return $files;
return $rows;
}
/**
@ -199,19 +249,21 @@ class Application_Model_Playlist
**/
public function normalizeFade($fade)
{
//First get rid of the first six characters 00:00: which will be added back later for db update
$fade = substr($fade, 6);
//First get rid of the first six characters 00:00: which will be added back later for db update
$fade = substr($fade, 6);
//Second add .000000 if the fade does't have milliseconds format already
$dbFadeStrPos = strpos( $fade, '.' );
if ($dbFadeStrPos === false) {
$fade .= '.000000';
} else {
while (strlen($fade) < 9) {
$fade .= '0';
}
}
//Second add .000000 if the fade does't have milliseconds format already
$dbFadeStrPos = strpos( $fade, '.' );
if ( $dbFadeStrPos === False )
$fade .= '.000000';
else
while( strlen( $fade ) < 9 )
$fade .= '0';
//done, just need to set back the formated values
return $fade;
//done, just need to set back the formated values
return $fade;
}
//aggregate column on playlistcontents cliplength column.
@ -220,7 +272,7 @@ class Application_Model_Playlist
return $this->pl->getDbLength();
}
private function insertPlaylistElement($info)
private function insertPlaylistElement($info, $type)
{
$row = new CcPlaylistcontents();
$row->setDbPlaylistId($this->id);
@ -231,6 +283,7 @@ class Application_Model_Playlist
$row->setDbCueout($info["cueout"]);
$row->setDbFadein($info["fadein"]);
$row->setDbFadeout($info["fadeout"]);
$row->setDbType($type);
$row->save($this->con);
// above save result update on cc_playlist table on length column.
// but $this->pl doesn't get updated automatically
@ -259,6 +312,23 @@ class Application_Model_Playlist
}
}
private function buildStreamEntry($p_item, $pos)
{
$stream = CcWebstreamQuery::create()->findPK($p_item, $this->con);
if (isset($stream)) {
$entry = $this->plItem;
$entry["id"] = $stream->getDbId();
$entry["pos"] = $pos;
$entry["cliplength"] = $stream->getDbLength();
$entry["cueout"] = $stream->getDbLength();
return $entry;
} else {
throw new Exception("trying to add a stream that does not exist.");
}
}
/*
* @param array $p_items
* an array of audioclips to add to the playlist
@ -267,7 +337,7 @@ class Application_Model_Playlist
* @param string (before|after) $addAfter
* whether to add the clips before or after the selected item.
*/
public function addAudioClips($p_items, $p_afterItem=NULL, $addType = 'after')
public function addAudioClips($p_items, $p_afterItem=null, $addType = 'after')
{
$this->con->beginTransaction();
$contentsToUpdate = array();
@ -288,8 +358,6 @@ class Application_Model_Playlist
->orderByDbPosition()
->find($this->con);
Logging::log("Adding to playlist");
Logging::log("at position {$pos}");
} else {
//add to the end of the playlist
@ -312,15 +380,27 @@ class Application_Model_Playlist
->orderByDbPosition()
->find($this->con);
Logging::log("Adding to playlist");
Logging::log("at position {$pos}");
}
Logging::log("Adding to playlist");
Logging::log("at position {$pos}");
foreach ($p_items as $ac) {
list($item, $type) = $ac;
if ($type == "audioclip") {
$res = $this->insertPlaylistElement($this->buildEntry($item, $pos), 0);
$pos = $pos + 1;
} else if ($type == "playlist") {
} else if ($type == "stream") {
$res = $this->insertPlaylistElement($this->buildStreamEntry($item, $pos), 1);
$pos = $pos + 1;
} else {
throw new Exception("Unknown file type");
}
Logging::log("Adding audio file {$ac}");
$res = $this->insertPlaylistElement($this->buildEntry($ac, $pos));
$pos = $pos + 1;
}
//reset the positions of the remaining items.

View file

@ -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', 'INTEGER', 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');

View file

@ -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;

View file

@ -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');

View file

@ -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
*