CC-3174 : showbuilder
changing playlist table to remove unused columns, adding foreign key to user, adding aggregate length column.
This commit is contained in:
parent
38f3d6bfb0
commit
e8f2506474
18 changed files with 416 additions and 459 deletions
|
@ -95,7 +95,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
|
|
||||||
$pl = new Application_Model_Playlist();
|
$pl = new Application_Model_Playlist();
|
||||||
$pl->setName("Untitled Playlist");
|
$pl->setName("Untitled Playlist");
|
||||||
$pl->setPLMetaData('dc:creator', $userInfo->login);
|
$pl->setPLMetaData('dc:creator', $userInfo->id);
|
||||||
|
|
||||||
$this->changePlaylist($pl->getId());
|
$this->changePlaylist($pl->getId());
|
||||||
$this->createFullResponse($pl);
|
$this->createFullResponse($pl);
|
||||||
|
|
|
@ -23,11 +23,6 @@ class Application_Model_Playlist {
|
||||||
*/
|
*/
|
||||||
private $pl;
|
private $pl;
|
||||||
|
|
||||||
/**
|
|
||||||
* MetaData
|
|
||||||
*/
|
|
||||||
public $md;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* info needed to insert a new playlist element.
|
* info needed to insert a new playlist element.
|
||||||
*/
|
*/
|
||||||
|
@ -44,9 +39,9 @@ class Application_Model_Playlist {
|
||||||
//using propel's phpNames.
|
//using propel's phpNames.
|
||||||
private $categories = array(
|
private $categories = array(
|
||||||
"dc:title" => "DbName",
|
"dc:title" => "DbName",
|
||||||
"dc:creator" => "DbCreator",
|
"dc:creator" => "DbCreatorId",
|
||||||
"dc:description" => "DbDescription",
|
"dc:description" => "DbDescription",
|
||||||
"dcterms:extent" => "length"
|
"dcterms:extent" => "getDbLength"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,8 +56,7 @@ class Application_Model_Playlist {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->pl = new CcPlaylist();
|
$this->pl = new CcPlaylist();
|
||||||
$this->pl->setDbState('ready');
|
$this->pl->setDbUTime("now", new DateTimeZone("UTC"));
|
||||||
$this->pl->setDbUtime(new DateTime("now"), new DateTimeZone("UTC"));
|
|
||||||
$this->pl->save();
|
$this->pl->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,19 +152,9 @@ class Application_Model_Playlist {
|
||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO make another aggregate column for playlist length.
|
//aggregate column on playlistcontents cliplength column.
|
||||||
public function getLength() {
|
public function getLength() {
|
||||||
/*
|
$this->pl->getDbLength();
|
||||||
$res = CcPlaylistQuery::create()
|
|
||||||
->findPK($this->id)
|
|
||||||
->computeLength();
|
|
||||||
|
|
||||||
if (is_null($res)) {
|
|
||||||
$res = '00:00:00';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return '00:00:00';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,7 +223,25 @@ class Application_Model_Playlist {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$pos = ($addType == 'after') ? $this->getSize() : 0;
|
//add to the end of the playlist
|
||||||
|
if ($addType == 'after') {
|
||||||
|
$pos = $this->getSize();
|
||||||
|
}
|
||||||
|
//add to the beginning of the playlist.
|
||||||
|
else {
|
||||||
|
$pos = 0;
|
||||||
|
|
||||||
|
$contentsToUpdate = CcPlaylistcontentsQuery::create()
|
||||||
|
->filterByDbPlaylistId($this->id)
|
||||||
|
->orderByDbPosition()
|
||||||
|
->find($this->con);
|
||||||
|
}
|
||||||
|
|
||||||
|
$contentsToUpdate = CcPlaylistcontentsQuery::create()
|
||||||
|
->filterByDbPlaylistId($this->id)
|
||||||
|
->filterByDbPosition($pos, Criteria::GREATER_EQUAL)
|
||||||
|
->orderByDbPosition()
|
||||||
|
->find($this->con);
|
||||||
|
|
||||||
Logging::log("Adding to playlist");
|
Logging::log("Adding to playlist");
|
||||||
Logging::log("at position {$pos}");
|
Logging::log("at position {$pos}");
|
||||||
|
@ -596,11 +598,6 @@ class Application_Model_Playlist {
|
||||||
$md = array();
|
$md = array();
|
||||||
|
|
||||||
foreach($categories as $key => $val) {
|
foreach($categories as $key => $val) {
|
||||||
if($val === 'length') {
|
|
||||||
$md[$key] = $this->getLength();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$method = 'get' . $val;
|
$method = 'get' . $val;
|
||||||
$md[$key] = $this->pl->$method();
|
$md[$key] = $this->pl->$method();
|
||||||
}
|
}
|
||||||
|
@ -611,11 +608,6 @@ class Application_Model_Playlist {
|
||||||
public function getPLMetaData($category)
|
public function getPLMetaData($category)
|
||||||
{
|
{
|
||||||
$cat = $this->categories[$category];
|
$cat = $this->categories[$category];
|
||||||
|
|
||||||
if($cat === 'length') {
|
|
||||||
return $this->getLength();
|
|
||||||
}
|
|
||||||
|
|
||||||
$method = 'get' . $cat;
|
$method = 'get' . $cat;
|
||||||
return $this->pl->$method();
|
return $this->pl->$method();
|
||||||
}
|
}
|
||||||
|
|
|
@ -687,11 +687,11 @@ class Application_Model_StoredFile {
|
||||||
$plSelect .= "'playlist' AS ".$key.", ";
|
$plSelect .= "'playlist' AS ".$key.", ";
|
||||||
$fileSelect .= $key.", ";
|
$fileSelect .= $key.", ";
|
||||||
} else if ($key === "artist_name") {
|
} else if ($key === "artist_name") {
|
||||||
$plSelect .= "creator AS ".$key.", ";
|
$plSelect .= "login AS ".$key.", ";
|
||||||
$fileSelect .= $key.", ";
|
$fileSelect .= $key.", ";
|
||||||
} else if ($key === "length") {
|
} else if ($key === "length") {
|
||||||
$plSelect .= $key.", ";
|
$plSelect .= $key.", ";
|
||||||
$fileSelect .= $key.", ";
|
$fileSelect .= $key."::interval, ";
|
||||||
} else if ($key === "year") {
|
} else if ($key === "year") {
|
||||||
$plSelect .= "CAST(utime AS varchar) AS ".$key.", ";
|
$plSelect .= "CAST(utime AS varchar) AS ".$key.", ";
|
||||||
$fileSelect .= $key.", ";
|
$fileSelect .= $key.", ";
|
||||||
|
@ -708,8 +708,7 @@ class Application_Model_StoredFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
$fromTable = " ((".$plSelect."PL.id
|
$fromTable = " ((".$plSelect."PL.id
|
||||||
FROM ".$CC_CONFIG["playListTable"]." AS PL
|
FROM cc_playlist AS PL LEFT JOIN cc_subjs AS sub ON (sub.id = PL.creator_id))
|
||||||
LEFT JOIN ".$CC_CONFIG['playListTimeView']." AS PLT USING(id))
|
|
||||||
UNION
|
UNION
|
||||||
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES WHERE file_exists = 'TRUE')) AS RESULTS";
|
(".$fileSelect."id FROM ".$CC_CONFIG["filesTable"]." AS FILES WHERE file_exists = 'TRUE')) AS RESULTS";
|
||||||
|
|
||||||
|
@ -825,7 +824,7 @@ class Application_Model_StoredFile {
|
||||||
$sql = $selectorRows." FROM ".$fromTable." ORDER BY ".$orderby." OFFSET ".$data["iDisplayStart"]." LIMIT ".$data["iDisplayLength"];
|
$sql = $selectorRows." FROM ".$fromTable." ORDER BY ".$orderby." OFFSET ".$data["iDisplayStart"]." LIMIT ".$data["iDisplayLength"];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Logging::log($sql);
|
Logging::log($sql);
|
||||||
|
|
||||||
$results = $CC_DBC->getAll($sql);
|
$results = $CC_DBC->getAll($sql);
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,12 @@ class CcPlaylistTableMap extends TableMap {
|
||||||
// columns
|
// columns
|
||||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||||
$this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty');
|
|
||||||
$this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
|
|
||||||
$this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
|
||||||
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||||
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
|
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
|
||||||
$this->addColumn('LPTIME', 'DbLPtime', 'TIMESTAMP', false, 6, null);
|
$this->addColumn('LPTIME', 'DbLPtime', 'TIMESTAMP', false, 6, null);
|
||||||
$this->addColumn('CREATOR', 'DbCreator', 'VARCHAR', false, 32, null);
|
$this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00');
|
||||||
// validators
|
// validators
|
||||||
} // initialize()
|
} // initialize()
|
||||||
|
|
||||||
|
@ -56,8 +54,21 @@ class CcPlaylistTableMap extends TableMap {
|
||||||
*/
|
*/
|
||||||
public function buildRelations()
|
public function buildRelations()
|
||||||
{
|
{
|
||||||
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null);
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), null, null);
|
||||||
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null);
|
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null);
|
||||||
} // buildRelations()
|
} // buildRelations()
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Gets the list of behaviors registered for this table
|
||||||
|
*
|
||||||
|
* @return array Associative array (name => parameters) of behaviors
|
||||||
|
*/
|
||||||
|
public function getBehaviors()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'aggregate_column' => array('name' => 'length', 'expression' => 'SUM(cliplength)', 'foreign_table' => 'cc_playlistcontents', ),
|
||||||
|
);
|
||||||
|
} // getBehaviors()
|
||||||
|
|
||||||
} // CcPlaylistTableMap
|
} // CcPlaylistTableMap
|
||||||
|
|
|
@ -59,4 +59,17 @@ class CcPlaylistcontentsTableMap extends TableMap {
|
||||||
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null);
|
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null);
|
||||||
} // buildRelations()
|
} // buildRelations()
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Gets the list of behaviors registered for this table
|
||||||
|
*
|
||||||
|
* @return array Associative array (name => parameters) of behaviors
|
||||||
|
*/
|
||||||
|
public function getBehaviors()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'aggregate_column_relation' => array('foreign_table' => 'cc_playlist', 'update_method' => 'updateDbLength', ),
|
||||||
|
);
|
||||||
|
} // getBehaviors()
|
||||||
|
|
||||||
} // CcPlaylistcontentsTableMap
|
} // CcPlaylistcontentsTableMap
|
||||||
|
|
|
@ -62,7 +62,7 @@ class CcSubjsTableMap extends TableMap {
|
||||||
$this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null);
|
$this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null);
|
||||||
$this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null);
|
$this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null);
|
||||||
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
|
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
|
||||||
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null);
|
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), null, null);
|
||||||
$this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null);
|
$this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null);
|
||||||
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null);
|
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null);
|
||||||
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null);
|
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null);
|
||||||
|
|
|
@ -37,26 +37,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the state field.
|
|
||||||
* Note: this column has a database default value of: 'empty'
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $state;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the currentlyaccessing field.
|
|
||||||
* Note: this column has a database default value of: 0
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $currentlyaccessing;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value for the editedby field.
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
protected $editedby;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the mtime field.
|
* The value for the mtime field.
|
||||||
* @var string
|
* @var string
|
||||||
|
@ -76,10 +56,10 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
protected $lptime;
|
protected $lptime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the creator field.
|
* The value for the creator_id field.
|
||||||
* @var string
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $creator;
|
protected $creator_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the description field.
|
* The value for the description field.
|
||||||
|
@ -87,6 +67,13 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
protected $description;
|
protected $description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the length field.
|
||||||
|
* Note: this column has a database default value of: '00:00:00'
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $length;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var CcSubjs
|
* @var CcSubjs
|
||||||
*/
|
*/
|
||||||
|
@ -120,8 +107,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
public function applyDefaultValues()
|
public function applyDefaultValues()
|
||||||
{
|
{
|
||||||
$this->name = '';
|
$this->name = '';
|
||||||
$this->state = 'empty';
|
$this->length = '00:00:00';
|
||||||
$this->currentlyaccessing = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,36 +140,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [state] column value.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getDbState()
|
|
||||||
{
|
|
||||||
return $this->state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [currentlyaccessing] column value.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getDbCurrentlyaccessing()
|
|
||||||
{
|
|
||||||
return $this->currentlyaccessing;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the [editedby] column value.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getDbEditedby()
|
|
||||||
{
|
|
||||||
return $this->editedby;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [optionally formatted] temporal [mtime] column value.
|
* Get the [optionally formatted] temporal [mtime] column value.
|
||||||
*
|
*
|
||||||
|
@ -284,13 +240,13 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [creator] column value.
|
* Get the [creator_id] column value.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getDbCreator()
|
public function getDbCreatorId()
|
||||||
{
|
{
|
||||||
return $this->creator;
|
return $this->creator_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -303,6 +259,16 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [length] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbLength()
|
||||||
|
{
|
||||||
|
return $this->length;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [id] column.
|
* Set the value of [id] column.
|
||||||
*
|
*
|
||||||
|
@ -343,70 +309,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbName()
|
} // setDbName()
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [state] column.
|
|
||||||
*
|
|
||||||
* @param string $v new value
|
|
||||||
* @return CcPlaylist The current object (for fluent API support)
|
|
||||||
*/
|
|
||||||
public function setDbState($v)
|
|
||||||
{
|
|
||||||
if ($v !== null) {
|
|
||||||
$v = (string) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->state !== $v || $this->isNew()) {
|
|
||||||
$this->state = $v;
|
|
||||||
$this->modifiedColumns[] = CcPlaylistPeer::STATE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
} // setDbState()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [currentlyaccessing] column.
|
|
||||||
*
|
|
||||||
* @param int $v new value
|
|
||||||
* @return CcPlaylist The current object (for fluent API support)
|
|
||||||
*/
|
|
||||||
public function setDbCurrentlyaccessing($v)
|
|
||||||
{
|
|
||||||
if ($v !== null) {
|
|
||||||
$v = (int) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->currentlyaccessing !== $v || $this->isNew()) {
|
|
||||||
$this->currentlyaccessing = $v;
|
|
||||||
$this->modifiedColumns[] = CcPlaylistPeer::CURRENTLYACCESSING;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
} // setDbCurrentlyaccessing()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of [editedby] column.
|
|
||||||
*
|
|
||||||
* @param int $v new value
|
|
||||||
* @return CcPlaylist The current object (for fluent API support)
|
|
||||||
*/
|
|
||||||
public function setDbEditedby($v)
|
|
||||||
{
|
|
||||||
if ($v !== null) {
|
|
||||||
$v = (int) $v;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->editedby !== $v) {
|
|
||||||
$this->editedby = $v;
|
|
||||||
$this->modifiedColumns[] = CcPlaylistPeer::EDITEDBY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
|
|
||||||
$this->aCcSubjs = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
} // setDbEditedby()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of [mtime] column to a normalized version of the date/time value specified.
|
* Sets the value of [mtime] column to a normalized version of the date/time value specified.
|
||||||
*
|
*
|
||||||
|
@ -555,24 +457,28 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
} // setDbLPtime()
|
} // setDbLPtime()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [creator] column.
|
* Set the value of [creator_id] column.
|
||||||
*
|
*
|
||||||
* @param string $v new value
|
* @param int $v new value
|
||||||
* @return CcPlaylist The current object (for fluent API support)
|
* @return CcPlaylist The current object (for fluent API support)
|
||||||
*/
|
*/
|
||||||
public function setDbCreator($v)
|
public function setDbCreatorId($v)
|
||||||
{
|
{
|
||||||
if ($v !== null) {
|
if ($v !== null) {
|
||||||
$v = (string) $v;
|
$v = (int) $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->creator !== $v) {
|
if ($this->creator_id !== $v) {
|
||||||
$this->creator = $v;
|
$this->creator_id = $v;
|
||||||
$this->modifiedColumns[] = CcPlaylistPeer::CREATOR;
|
$this->modifiedColumns[] = CcPlaylistPeer::CREATOR_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
|
||||||
|
$this->aCcSubjs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbCreator()
|
} // setDbCreatorId()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [description] column.
|
* Set the value of [description] column.
|
||||||
|
@ -594,6 +500,26 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
return $this;
|
return $this;
|
||||||
} // setDbDescription()
|
} // setDbDescription()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [length] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcPlaylist The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbLength($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->length !== $v || $this->isNew()) {
|
||||||
|
$this->length = $v;
|
||||||
|
$this->modifiedColumns[] = CcPlaylistPeer::LENGTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbLength()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the columns in this object are only set to default values.
|
* Indicates whether the columns in this object are only set to default values.
|
||||||
*
|
*
|
||||||
|
@ -608,11 +534,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->state !== 'empty') {
|
if ($this->length !== '00:00:00') {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->currentlyaccessing !== 0) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,14 +562,12 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
|
|
||||||
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
|
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
|
||||||
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
||||||
$this->state = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
|
$this->mtime = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
|
||||||
$this->currentlyaccessing = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
|
$this->utime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
|
||||||
$this->editedby = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
|
$this->lptime = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
|
||||||
$this->mtime = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
$this->creator_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
|
||||||
$this->utime = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
$this->description = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||||
$this->lptime = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
$this->length = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||||
$this->creator = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
|
||||||
$this->description = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
|
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
@ -656,7 +576,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
$this->ensureConsistency();
|
$this->ensureConsistency();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $startcol + 10; // 10 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 8; // 8 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating CcPlaylist object", $e);
|
throw new PropelException("Error populating CcPlaylist object", $e);
|
||||||
|
@ -679,7 +599,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
public function ensureConsistency()
|
public function ensureConsistency()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) {
|
if ($this->aCcSubjs !== null && $this->creator_id !== $this->aCcSubjs->getDbId()) {
|
||||||
$this->aCcSubjs = null;
|
$this->aCcSubjs = null;
|
||||||
}
|
}
|
||||||
} // ensureConsistency
|
} // ensureConsistency
|
||||||
|
@ -1008,29 +928,23 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
return $this->getDbName();
|
return $this->getDbName();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return $this->getDbState();
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
return $this->getDbCurrentlyaccessing();
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
return $this->getDbEditedby();
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
return $this->getDbMtime();
|
return $this->getDbMtime();
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 3:
|
||||||
return $this->getDbUtime();
|
return $this->getDbUtime();
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 4:
|
||||||
return $this->getDbLPtime();
|
return $this->getDbLPtime();
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 5:
|
||||||
return $this->getDbCreator();
|
return $this->getDbCreatorId();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 6:
|
||||||
return $this->getDbDescription();
|
return $this->getDbDescription();
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
return $this->getDbLength();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
break;
|
break;
|
||||||
|
@ -1057,14 +971,12 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
$result = array(
|
$result = array(
|
||||||
$keys[0] => $this->getDbId(),
|
$keys[0] => $this->getDbId(),
|
||||||
$keys[1] => $this->getDbName(),
|
$keys[1] => $this->getDbName(),
|
||||||
$keys[2] => $this->getDbState(),
|
$keys[2] => $this->getDbMtime(),
|
||||||
$keys[3] => $this->getDbCurrentlyaccessing(),
|
$keys[3] => $this->getDbUtime(),
|
||||||
$keys[4] => $this->getDbEditedby(),
|
$keys[4] => $this->getDbLPtime(),
|
||||||
$keys[5] => $this->getDbMtime(),
|
$keys[5] => $this->getDbCreatorId(),
|
||||||
$keys[6] => $this->getDbUtime(),
|
$keys[6] => $this->getDbDescription(),
|
||||||
$keys[7] => $this->getDbLPtime(),
|
$keys[7] => $this->getDbLength(),
|
||||||
$keys[8] => $this->getDbCreator(),
|
|
||||||
$keys[9] => $this->getDbDescription(),
|
|
||||||
);
|
);
|
||||||
if ($includeForeignObjects) {
|
if ($includeForeignObjects) {
|
||||||
if (null !== $this->aCcSubjs) {
|
if (null !== $this->aCcSubjs) {
|
||||||
|
@ -1108,29 +1020,23 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
$this->setDbName($value);
|
$this->setDbName($value);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$this->setDbState($value);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$this->setDbCurrentlyaccessing($value);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$this->setDbEditedby($value);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$this->setDbMtime($value);
|
$this->setDbMtime($value);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 3:
|
||||||
$this->setDbUtime($value);
|
$this->setDbUtime($value);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 4:
|
||||||
$this->setDbLPtime($value);
|
$this->setDbLPtime($value);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 5:
|
||||||
$this->setDbCreator($value);
|
$this->setDbCreatorId($value);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 6:
|
||||||
$this->setDbDescription($value);
|
$this->setDbDescription($value);
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
$this->setDbLength($value);
|
||||||
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1157,14 +1063,12 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
|
|
||||||
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
|
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
|
||||||
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
|
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
|
||||||
if (array_key_exists($keys[2], $arr)) $this->setDbState($arr[$keys[2]]);
|
if (array_key_exists($keys[2], $arr)) $this->setDbMtime($arr[$keys[2]]);
|
||||||
if (array_key_exists($keys[3], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[3]]);
|
if (array_key_exists($keys[3], $arr)) $this->setDbUtime($arr[$keys[3]]);
|
||||||
if (array_key_exists($keys[4], $arr)) $this->setDbEditedby($arr[$keys[4]]);
|
if (array_key_exists($keys[4], $arr)) $this->setDbLPtime($arr[$keys[4]]);
|
||||||
if (array_key_exists($keys[5], $arr)) $this->setDbMtime($arr[$keys[5]]);
|
if (array_key_exists($keys[5], $arr)) $this->setDbCreatorId($arr[$keys[5]]);
|
||||||
if (array_key_exists($keys[6], $arr)) $this->setDbUtime($arr[$keys[6]]);
|
if (array_key_exists($keys[6], $arr)) $this->setDbDescription($arr[$keys[6]]);
|
||||||
if (array_key_exists($keys[7], $arr)) $this->setDbLPtime($arr[$keys[7]]);
|
if (array_key_exists($keys[7], $arr)) $this->setDbLength($arr[$keys[7]]);
|
||||||
if (array_key_exists($keys[8], $arr)) $this->setDbCreator($arr[$keys[8]]);
|
|
||||||
if (array_key_exists($keys[9], $arr)) $this->setDbDescription($arr[$keys[9]]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1178,14 +1082,12 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
|
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::ID)) $criteria->add(CcPlaylistPeer::ID, $this->id);
|
if ($this->isColumnModified(CcPlaylistPeer::ID)) $criteria->add(CcPlaylistPeer::ID, $this->id);
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::NAME)) $criteria->add(CcPlaylistPeer::NAME, $this->name);
|
if ($this->isColumnModified(CcPlaylistPeer::NAME)) $criteria->add(CcPlaylistPeer::NAME, $this->name);
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::STATE)) $criteria->add(CcPlaylistPeer::STATE, $this->state);
|
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::CURRENTLYACCESSING)) $criteria->add(CcPlaylistPeer::CURRENTLYACCESSING, $this->currentlyaccessing);
|
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::EDITEDBY)) $criteria->add(CcPlaylistPeer::EDITEDBY, $this->editedby);
|
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::MTIME)) $criteria->add(CcPlaylistPeer::MTIME, $this->mtime);
|
if ($this->isColumnModified(CcPlaylistPeer::MTIME)) $criteria->add(CcPlaylistPeer::MTIME, $this->mtime);
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::UTIME)) $criteria->add(CcPlaylistPeer::UTIME, $this->utime);
|
if ($this->isColumnModified(CcPlaylistPeer::UTIME)) $criteria->add(CcPlaylistPeer::UTIME, $this->utime);
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::LPTIME)) $criteria->add(CcPlaylistPeer::LPTIME, $this->lptime);
|
if ($this->isColumnModified(CcPlaylistPeer::LPTIME)) $criteria->add(CcPlaylistPeer::LPTIME, $this->lptime);
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::CREATOR)) $criteria->add(CcPlaylistPeer::CREATOR, $this->creator);
|
if ($this->isColumnModified(CcPlaylistPeer::CREATOR_ID)) $criteria->add(CcPlaylistPeer::CREATOR_ID, $this->creator_id);
|
||||||
if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description);
|
if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description);
|
||||||
|
if ($this->isColumnModified(CcPlaylistPeer::LENGTH)) $criteria->add(CcPlaylistPeer::LENGTH, $this->length);
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
|
@ -1248,14 +1150,12 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
public function copyInto($copyObj, $deepCopy = false)
|
public function copyInto($copyObj, $deepCopy = false)
|
||||||
{
|
{
|
||||||
$copyObj->setDbName($this->name);
|
$copyObj->setDbName($this->name);
|
||||||
$copyObj->setDbState($this->state);
|
|
||||||
$copyObj->setDbCurrentlyaccessing($this->currentlyaccessing);
|
|
||||||
$copyObj->setDbEditedby($this->editedby);
|
|
||||||
$copyObj->setDbMtime($this->mtime);
|
$copyObj->setDbMtime($this->mtime);
|
||||||
$copyObj->setDbUtime($this->utime);
|
$copyObj->setDbUtime($this->utime);
|
||||||
$copyObj->setDbLPtime($this->lptime);
|
$copyObj->setDbLPtime($this->lptime);
|
||||||
$copyObj->setDbCreator($this->creator);
|
$copyObj->setDbCreatorId($this->creator_id);
|
||||||
$copyObj->setDbDescription($this->description);
|
$copyObj->setDbDescription($this->description);
|
||||||
|
$copyObj->setDbLength($this->length);
|
||||||
|
|
||||||
if ($deepCopy) {
|
if ($deepCopy) {
|
||||||
// important: temporarily setNew(false) because this affects the behavior of
|
// important: temporarily setNew(false) because this affects the behavior of
|
||||||
|
@ -1323,9 +1223,9 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
public function setCcSubjs(CcSubjs $v = null)
|
public function setCcSubjs(CcSubjs $v = null)
|
||||||
{
|
{
|
||||||
if ($v === null) {
|
if ($v === null) {
|
||||||
$this->setDbEditedby(NULL);
|
$this->setDbCreatorId(NULL);
|
||||||
} else {
|
} else {
|
||||||
$this->setDbEditedby($v->getDbId());
|
$this->setDbCreatorId($v->getDbId());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->aCcSubjs = $v;
|
$this->aCcSubjs = $v;
|
||||||
|
@ -1349,8 +1249,8 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
public function getCcSubjs(PropelPDO $con = null)
|
public function getCcSubjs(PropelPDO $con = null)
|
||||||
{
|
{
|
||||||
if ($this->aCcSubjs === null && ($this->editedby !== null)) {
|
if ($this->aCcSubjs === null && ($this->creator_id !== null)) {
|
||||||
$this->aCcSubjs = CcSubjsQuery::create()->findPk($this->editedby, $con);
|
$this->aCcSubjs = CcSubjsQuery::create()->findPk($this->creator_id, $con);
|
||||||
/* The following can be used additionally to
|
/* The following can be used additionally to
|
||||||
guarantee the related object contains a reference
|
guarantee the related object contains a reference
|
||||||
to this object. This level of coupling may, however, be
|
to this object. This level of coupling may, however, be
|
||||||
|
@ -1503,14 +1403,12 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
{
|
{
|
||||||
$this->id = null;
|
$this->id = null;
|
||||||
$this->name = null;
|
$this->name = null;
|
||||||
$this->state = null;
|
|
||||||
$this->currentlyaccessing = null;
|
|
||||||
$this->editedby = null;
|
|
||||||
$this->mtime = null;
|
$this->mtime = null;
|
||||||
$this->utime = null;
|
$this->utime = null;
|
||||||
$this->lptime = null;
|
$this->lptime = null;
|
||||||
$this->creator = null;
|
$this->creator_id = null;
|
||||||
$this->description = null;
|
$this->description = null;
|
||||||
|
$this->length = null;
|
||||||
$this->alreadyInSave = false;
|
$this->alreadyInSave = false;
|
||||||
$this->alreadyInValidation = false;
|
$this->alreadyInValidation = false;
|
||||||
$this->clearAllReferences();
|
$this->clearAllReferences();
|
||||||
|
@ -1543,6 +1441,34 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
||||||
$this->aCcSubjs = null;
|
$this->aCcSubjs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// aggregate_column behavior
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Computes the value of the aggregate column length
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con A connection object
|
||||||
|
*
|
||||||
|
* @return mixed The scalar result from the aggregate query
|
||||||
|
*/
|
||||||
|
public function computeDbLength(PropelPDO $con)
|
||||||
|
{
|
||||||
|
$stmt = $con->prepare('SELECT SUM(cliplength) FROM "cc_playlistcontents" WHERE cc_playlistcontents.PLAYLIST_ID = :p1');
|
||||||
|
$stmt->bindValue(':p1', $this->getDbId());
|
||||||
|
$stmt->execute();
|
||||||
|
return $stmt->fetchColumn();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the aggregate column length
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con A connection object
|
||||||
|
*/
|
||||||
|
public function updateDbLength(PropelPDO $con)
|
||||||
|
{
|
||||||
|
$this->setDbLength($this->computeDbLength($con));
|
||||||
|
$this->save($con);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Catches calls to virtual methods
|
* Catches calls to virtual methods
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcPlaylistPeer {
|
||||||
const TM_CLASS = 'CcPlaylistTableMap';
|
const TM_CLASS = 'CcPlaylistTableMap';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 10;
|
const NUM_COLUMNS = 8;
|
||||||
|
|
||||||
/** The number of lazy-loaded columns. */
|
/** The number of lazy-loaded columns. */
|
||||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
@ -37,15 +37,6 @@ abstract class BaseCcPlaylistPeer {
|
||||||
/** the column name for the NAME field */
|
/** the column name for the NAME field */
|
||||||
const NAME = 'cc_playlist.NAME';
|
const NAME = 'cc_playlist.NAME';
|
||||||
|
|
||||||
/** the column name for the STATE field */
|
|
||||||
const STATE = 'cc_playlist.STATE';
|
|
||||||
|
|
||||||
/** the column name for the CURRENTLYACCESSING field */
|
|
||||||
const CURRENTLYACCESSING = 'cc_playlist.CURRENTLYACCESSING';
|
|
||||||
|
|
||||||
/** the column name for the EDITEDBY field */
|
|
||||||
const EDITEDBY = 'cc_playlist.EDITEDBY';
|
|
||||||
|
|
||||||
/** the column name for the MTIME field */
|
/** the column name for the MTIME field */
|
||||||
const MTIME = 'cc_playlist.MTIME';
|
const MTIME = 'cc_playlist.MTIME';
|
||||||
|
|
||||||
|
@ -55,12 +46,15 @@ abstract class BaseCcPlaylistPeer {
|
||||||
/** the column name for the LPTIME field */
|
/** the column name for the LPTIME field */
|
||||||
const LPTIME = 'cc_playlist.LPTIME';
|
const LPTIME = 'cc_playlist.LPTIME';
|
||||||
|
|
||||||
/** the column name for the CREATOR field */
|
/** the column name for the CREATOR_ID field */
|
||||||
const CREATOR = 'cc_playlist.CREATOR';
|
const CREATOR_ID = 'cc_playlist.CREATOR_ID';
|
||||||
|
|
||||||
/** the column name for the DESCRIPTION field */
|
/** the column name for the DESCRIPTION field */
|
||||||
const DESCRIPTION = 'cc_playlist.DESCRIPTION';
|
const DESCRIPTION = 'cc_playlist.DESCRIPTION';
|
||||||
|
|
||||||
|
/** the column name for the LENGTH field */
|
||||||
|
const LENGTH = 'cc_playlist.LENGTH';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An identiy map to hold any loaded instances of CcPlaylist objects.
|
* An identiy map to hold any loaded instances of CcPlaylist objects.
|
||||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||||
|
@ -77,12 +71,12 @@ abstract class BaseCcPlaylistPeer {
|
||||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||||
*/
|
*/
|
||||||
private static $fieldNames = array (
|
private static $fieldNames = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbCreator', 'DbDescription', ),
|
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbCreatorId', 'DbDescription', 'DbLength', ),
|
||||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbCreator', 'dbDescription', ),
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbCreatorId', 'dbDescription', 'dbLength', ),
|
||||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::CREATOR, self::DESCRIPTION, ),
|
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MTIME, self::UTIME, self::LPTIME, self::CREATOR_ID, self::DESCRIPTION, self::LENGTH, ),
|
||||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'CREATOR', 'DESCRIPTION', ),
|
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MTIME', 'UTIME', 'LPTIME', 'CREATOR_ID', 'DESCRIPTION', 'LENGTH', ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'creator', 'description', ),
|
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mtime', 'utime', 'lptime', 'creator_id', 'description', 'length', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,12 +86,12 @@ abstract class BaseCcPlaylistPeer {
|
||||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||||
*/
|
*/
|
||||||
private static $fieldKeys = array (
|
private static $fieldKeys = array (
|
||||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbState' => 2, 'DbCurrentlyaccessing' => 3, 'DbEditedby' => 4, 'DbMtime' => 5, 'DbUtime' => 6, 'DbLPtime' => 7, 'DbCreator' => 8, 'DbDescription' => 9, ),
|
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMtime' => 2, 'DbUtime' => 3, 'DbLPtime' => 4, 'DbCreatorId' => 5, 'DbDescription' => 6, 'DbLength' => 7, ),
|
||||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbState' => 2, 'dbCurrentlyaccessing' => 3, 'dbEditedby' => 4, 'dbMtime' => 5, 'dbUtime' => 6, 'dbLPtime' => 7, 'dbCreator' => 8, 'dbDescription' => 9, ),
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMtime' => 2, 'dbUtime' => 3, 'dbLPtime' => 4, 'dbCreatorId' => 5, 'dbDescription' => 6, 'dbLength' => 7, ),
|
||||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::STATE => 2, self::CURRENTLYACCESSING => 3, self::EDITEDBY => 4, self::MTIME => 5, self::UTIME => 6, self::LPTIME => 7, self::CREATOR => 8, self::DESCRIPTION => 9, ),
|
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MTIME => 2, self::UTIME => 3, self::LPTIME => 4, self::CREATOR_ID => 5, self::DESCRIPTION => 6, self::LENGTH => 7, ),
|
||||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'STATE' => 2, 'CURRENTLYACCESSING' => 3, 'EDITEDBY' => 4, 'MTIME' => 5, 'UTIME' => 6, 'LPTIME' => 7, 'CREATOR' => 8, 'DESCRIPTION' => 9, ),
|
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MTIME' => 2, 'UTIME' => 3, 'LPTIME' => 4, 'CREATOR_ID' => 5, 'DESCRIPTION' => 6, 'LENGTH' => 7, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'state' => 2, 'currentlyaccessing' => 3, 'editedby' => 4, 'mtime' => 5, 'utime' => 6, 'lptime' => 7, 'creator' => 8, 'description' => 9, ),
|
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mtime' => 2, 'utime' => 3, 'lptime' => 4, 'creator_id' => 5, 'description' => 6, 'length' => 7, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,25 +165,21 @@ abstract class BaseCcPlaylistPeer {
|
||||||
if (null === $alias) {
|
if (null === $alias) {
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::ID);
|
$criteria->addSelectColumn(CcPlaylistPeer::ID);
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::NAME);
|
$criteria->addSelectColumn(CcPlaylistPeer::NAME);
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::STATE);
|
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::CURRENTLYACCESSING);
|
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::EDITEDBY);
|
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::MTIME);
|
$criteria->addSelectColumn(CcPlaylistPeer::MTIME);
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::UTIME);
|
$criteria->addSelectColumn(CcPlaylistPeer::UTIME);
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::LPTIME);
|
$criteria->addSelectColumn(CcPlaylistPeer::LPTIME);
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::CREATOR);
|
$criteria->addSelectColumn(CcPlaylistPeer::CREATOR_ID);
|
||||||
$criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION);
|
$criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION);
|
||||||
|
$criteria->addSelectColumn(CcPlaylistPeer::LENGTH);
|
||||||
} else {
|
} else {
|
||||||
$criteria->addSelectColumn($alias . '.ID');
|
$criteria->addSelectColumn($alias . '.ID');
|
||||||
$criteria->addSelectColumn($alias . '.NAME');
|
$criteria->addSelectColumn($alias . '.NAME');
|
||||||
$criteria->addSelectColumn($alias . '.STATE');
|
|
||||||
$criteria->addSelectColumn($alias . '.CURRENTLYACCESSING');
|
|
||||||
$criteria->addSelectColumn($alias . '.EDITEDBY');
|
|
||||||
$criteria->addSelectColumn($alias . '.MTIME');
|
$criteria->addSelectColumn($alias . '.MTIME');
|
||||||
$criteria->addSelectColumn($alias . '.UTIME');
|
$criteria->addSelectColumn($alias . '.UTIME');
|
||||||
$criteria->addSelectColumn($alias . '.LPTIME');
|
$criteria->addSelectColumn($alias . '.LPTIME');
|
||||||
$criteria->addSelectColumn($alias . '.CREATOR');
|
$criteria->addSelectColumn($alias . '.CREATOR_ID');
|
||||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||||
|
$criteria->addSelectColumn($alias . '.LENGTH');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,7 +504,7 @@ abstract class BaseCcPlaylistPeer {
|
||||||
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
$criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
|
$criteria->addJoin(CcPlaylistPeer::CREATOR_ID, CcSubjsPeer::ID, $join_behavior);
|
||||||
|
|
||||||
$stmt = BasePeer::doCount($criteria, $con);
|
$stmt = BasePeer::doCount($criteria, $con);
|
||||||
|
|
||||||
|
@ -550,7 +540,7 @@ abstract class BaseCcPlaylistPeer {
|
||||||
$startcol = (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
$startcol = (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||||
CcSubjsPeer::addSelectColumns($criteria);
|
CcSubjsPeer::addSelectColumns($criteria);
|
||||||
|
|
||||||
$criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
|
$criteria->addJoin(CcPlaylistPeer::CREATOR_ID, CcSubjsPeer::ID, $join_behavior);
|
||||||
|
|
||||||
$stmt = BasePeer::doSelect($criteria, $con);
|
$stmt = BasePeer::doSelect($criteria, $con);
|
||||||
$results = array();
|
$results = array();
|
||||||
|
@ -630,7 +620,7 @@ abstract class BaseCcPlaylistPeer {
|
||||||
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
$criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
|
$criteria->addJoin(CcPlaylistPeer::CREATOR_ID, CcSubjsPeer::ID, $join_behavior);
|
||||||
|
|
||||||
$stmt = BasePeer::doCount($criteria, $con);
|
$stmt = BasePeer::doCount($criteria, $con);
|
||||||
|
|
||||||
|
@ -668,7 +658,7 @@ abstract class BaseCcPlaylistPeer {
|
||||||
CcSubjsPeer::addSelectColumns($criteria);
|
CcSubjsPeer::addSelectColumns($criteria);
|
||||||
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
|
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||||
|
|
||||||
$criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
|
$criteria->addJoin(CcPlaylistPeer::CREATOR_ID, CcSubjsPeer::ID, $join_behavior);
|
||||||
|
|
||||||
$stmt = BasePeer::doSelect($criteria, $con);
|
$stmt = BasePeer::doSelect($criteria, $con);
|
||||||
$results = array();
|
$results = array();
|
||||||
|
|
|
@ -8,25 +8,21 @@
|
||||||
*
|
*
|
||||||
* @method CcPlaylistQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
* @method CcPlaylistQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||||
* @method CcPlaylistQuery orderByDbName($order = Criteria::ASC) Order by the name column
|
* @method CcPlaylistQuery orderByDbName($order = Criteria::ASC) Order by the name column
|
||||||
* @method CcPlaylistQuery orderByDbState($order = Criteria::ASC) Order by the state column
|
|
||||||
* @method CcPlaylistQuery orderByDbCurrentlyaccessing($order = Criteria::ASC) Order by the currentlyaccessing column
|
|
||||||
* @method CcPlaylistQuery orderByDbEditedby($order = Criteria::ASC) Order by the editedby column
|
|
||||||
* @method CcPlaylistQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
|
* @method CcPlaylistQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
|
||||||
* @method CcPlaylistQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
|
* @method CcPlaylistQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
|
||||||
* @method CcPlaylistQuery orderByDbLPtime($order = Criteria::ASC) Order by the lptime column
|
* @method CcPlaylistQuery orderByDbLPtime($order = Criteria::ASC) Order by the lptime column
|
||||||
* @method CcPlaylistQuery orderByDbCreator($order = Criteria::ASC) Order by the creator column
|
* @method CcPlaylistQuery orderByDbCreatorId($order = Criteria::ASC) Order by the creator_id column
|
||||||
* @method CcPlaylistQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
|
* @method CcPlaylistQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
|
||||||
|
* @method CcPlaylistQuery orderByDbLength($order = Criteria::ASC) Order by the length column
|
||||||
*
|
*
|
||||||
* @method CcPlaylistQuery groupByDbId() Group by the id column
|
* @method CcPlaylistQuery groupByDbId() Group by the id column
|
||||||
* @method CcPlaylistQuery groupByDbName() Group by the name column
|
* @method CcPlaylistQuery groupByDbName() Group by the name column
|
||||||
* @method CcPlaylistQuery groupByDbState() Group by the state column
|
|
||||||
* @method CcPlaylistQuery groupByDbCurrentlyaccessing() Group by the currentlyaccessing column
|
|
||||||
* @method CcPlaylistQuery groupByDbEditedby() Group by the editedby column
|
|
||||||
* @method CcPlaylistQuery groupByDbMtime() Group by the mtime column
|
* @method CcPlaylistQuery groupByDbMtime() Group by the mtime column
|
||||||
* @method CcPlaylistQuery groupByDbUtime() Group by the utime column
|
* @method CcPlaylistQuery groupByDbUtime() Group by the utime column
|
||||||
* @method CcPlaylistQuery groupByDbLPtime() Group by the lptime column
|
* @method CcPlaylistQuery groupByDbLPtime() Group by the lptime column
|
||||||
* @method CcPlaylistQuery groupByDbCreator() Group by the creator column
|
* @method CcPlaylistQuery groupByDbCreatorId() Group by the creator_id column
|
||||||
* @method CcPlaylistQuery groupByDbDescription() Group by the description column
|
* @method CcPlaylistQuery groupByDbDescription() Group by the description column
|
||||||
|
* @method CcPlaylistQuery groupByDbLength() Group by the length column
|
||||||
*
|
*
|
||||||
* @method CcPlaylistQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
* @method CcPlaylistQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
* @method CcPlaylistQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
* @method CcPlaylistQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
@ -45,25 +41,21 @@
|
||||||
*
|
*
|
||||||
* @method CcPlaylist findOneByDbId(int $id) Return the first CcPlaylist filtered by the id column
|
* @method CcPlaylist findOneByDbId(int $id) Return the first CcPlaylist filtered by the id column
|
||||||
* @method CcPlaylist findOneByDbName(string $name) Return the first CcPlaylist filtered by the name column
|
* @method CcPlaylist findOneByDbName(string $name) Return the first CcPlaylist filtered by the name column
|
||||||
* @method CcPlaylist findOneByDbState(string $state) Return the first CcPlaylist filtered by the state column
|
|
||||||
* @method CcPlaylist findOneByDbCurrentlyaccessing(int $currentlyaccessing) Return the first CcPlaylist filtered by the currentlyaccessing column
|
|
||||||
* @method CcPlaylist findOneByDbEditedby(int $editedby) Return the first CcPlaylist filtered by the editedby column
|
|
||||||
* @method CcPlaylist findOneByDbMtime(string $mtime) Return the first CcPlaylist filtered by the mtime column
|
* @method CcPlaylist findOneByDbMtime(string $mtime) Return the first CcPlaylist filtered by the mtime column
|
||||||
* @method CcPlaylist findOneByDbUtime(string $utime) Return the first CcPlaylist filtered by the utime column
|
* @method CcPlaylist findOneByDbUtime(string $utime) Return the first CcPlaylist filtered by the utime column
|
||||||
* @method CcPlaylist findOneByDbLPtime(string $lptime) Return the first CcPlaylist filtered by the lptime column
|
* @method CcPlaylist findOneByDbLPtime(string $lptime) Return the first CcPlaylist filtered by the lptime column
|
||||||
* @method CcPlaylist findOneByDbCreator(string $creator) Return the first CcPlaylist filtered by the creator column
|
* @method CcPlaylist findOneByDbCreatorId(int $creator_id) Return the first CcPlaylist filtered by the creator_id column
|
||||||
* @method CcPlaylist findOneByDbDescription(string $description) Return the first CcPlaylist filtered by the description column
|
* @method CcPlaylist findOneByDbDescription(string $description) Return the first CcPlaylist filtered by the description column
|
||||||
|
* @method CcPlaylist findOneByDbLength(string $length) Return the first CcPlaylist filtered by the length column
|
||||||
*
|
*
|
||||||
* @method array findByDbId(int $id) Return CcPlaylist objects filtered by the id column
|
* @method array findByDbId(int $id) Return CcPlaylist objects filtered by the id column
|
||||||
* @method array findByDbName(string $name) Return CcPlaylist objects filtered by the name column
|
* @method array findByDbName(string $name) Return CcPlaylist objects filtered by the name column
|
||||||
* @method array findByDbState(string $state) Return CcPlaylist objects filtered by the state column
|
|
||||||
* @method array findByDbCurrentlyaccessing(int $currentlyaccessing) Return CcPlaylist objects filtered by the currentlyaccessing column
|
|
||||||
* @method array findByDbEditedby(int $editedby) Return CcPlaylist objects filtered by the editedby column
|
|
||||||
* @method array findByDbMtime(string $mtime) Return CcPlaylist objects filtered by the mtime column
|
* @method array findByDbMtime(string $mtime) Return CcPlaylist objects filtered by the mtime column
|
||||||
* @method array findByDbUtime(string $utime) Return CcPlaylist objects filtered by the utime column
|
* @method array findByDbUtime(string $utime) Return CcPlaylist objects filtered by the utime column
|
||||||
* @method array findByDbLPtime(string $lptime) Return CcPlaylist objects filtered by the lptime column
|
* @method array findByDbLPtime(string $lptime) Return CcPlaylist objects filtered by the lptime column
|
||||||
* @method array findByDbCreator(string $creator) Return CcPlaylist objects filtered by the creator column
|
* @method array findByDbCreatorId(int $creator_id) Return CcPlaylist objects filtered by the creator_id column
|
||||||
* @method array findByDbDescription(string $description) Return CcPlaylist objects filtered by the description column
|
* @method array findByDbDescription(string $description) Return CcPlaylist objects filtered by the description column
|
||||||
|
* @method array findByDbLength(string $length) Return CcPlaylist objects filtered by the length column
|
||||||
*
|
*
|
||||||
* @package propel.generator.airtime.om
|
* @package propel.generator.airtime.om
|
||||||
*/
|
*/
|
||||||
|
@ -212,90 +204,6 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
|
||||||
return $this->addUsingAlias(CcPlaylistPeer::NAME, $dbName, $comparison);
|
return $this->addUsingAlias(CcPlaylistPeer::NAME, $dbName, $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter the query on the state column
|
|
||||||
*
|
|
||||||
* @param string $dbState The value to use as filter.
|
|
||||||
* Accepts wildcards (* and % trigger a LIKE)
|
|
||||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
|
||||||
*
|
|
||||||
* @return CcPlaylistQuery The current query, for fluid interface
|
|
||||||
*/
|
|
||||||
public function filterByDbState($dbState = null, $comparison = null)
|
|
||||||
{
|
|
||||||
if (null === $comparison) {
|
|
||||||
if (is_array($dbState)) {
|
|
||||||
$comparison = Criteria::IN;
|
|
||||||
} elseif (preg_match('/[\%\*]/', $dbState)) {
|
|
||||||
$dbState = str_replace('*', '%', $dbState);
|
|
||||||
$comparison = Criteria::LIKE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->addUsingAlias(CcPlaylistPeer::STATE, $dbState, $comparison);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter the query on the currentlyaccessing column
|
|
||||||
*
|
|
||||||
* @param int|array $dbCurrentlyaccessing 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 CcPlaylistQuery The current query, for fluid interface
|
|
||||||
*/
|
|
||||||
public function filterByDbCurrentlyaccessing($dbCurrentlyaccessing = null, $comparison = null)
|
|
||||||
{
|
|
||||||
if (is_array($dbCurrentlyaccessing)) {
|
|
||||||
$useMinMax = false;
|
|
||||||
if (isset($dbCurrentlyaccessing['min'])) {
|
|
||||||
$this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['min'], Criteria::GREATER_EQUAL);
|
|
||||||
$useMinMax = true;
|
|
||||||
}
|
|
||||||
if (isset($dbCurrentlyaccessing['max'])) {
|
|
||||||
$this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['max'], Criteria::LESS_EQUAL);
|
|
||||||
$useMinMax = true;
|
|
||||||
}
|
|
||||||
if ($useMinMax) {
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
if (null === $comparison) {
|
|
||||||
$comparison = Criteria::IN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing, $comparison);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter the query on the editedby column
|
|
||||||
*
|
|
||||||
* @param int|array $dbEditedby 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 CcPlaylistQuery The current query, for fluid interface
|
|
||||||
*/
|
|
||||||
public function filterByDbEditedby($dbEditedby = null, $comparison = null)
|
|
||||||
{
|
|
||||||
if (is_array($dbEditedby)) {
|
|
||||||
$useMinMax = false;
|
|
||||||
if (isset($dbEditedby['min'])) {
|
|
||||||
$this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby['min'], Criteria::GREATER_EQUAL);
|
|
||||||
$useMinMax = true;
|
|
||||||
}
|
|
||||||
if (isset($dbEditedby['max'])) {
|
|
||||||
$this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby['max'], Criteria::LESS_EQUAL);
|
|
||||||
$useMinMax = true;
|
|
||||||
}
|
|
||||||
if ($useMinMax) {
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
if (null === $comparison) {
|
|
||||||
$comparison = Criteria::IN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby, $comparison);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the query on the mtime column
|
* Filter the query on the mtime column
|
||||||
*
|
*
|
||||||
|
@ -390,25 +298,34 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the query on the creator column
|
* Filter the query on the creator_id column
|
||||||
*
|
*
|
||||||
* @param string $dbCreator The value to use as filter.
|
* @param int|array $dbCreatorId The value to use as filter.
|
||||||
* Accepts wildcards (* and % trigger a LIKE)
|
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
*
|
*
|
||||||
* @return CcPlaylistQuery The current query, for fluid interface
|
* @return CcPlaylistQuery The current query, for fluid interface
|
||||||
*/
|
*/
|
||||||
public function filterByDbCreator($dbCreator = null, $comparison = null)
|
public function filterByDbCreatorId($dbCreatorId = null, $comparison = null)
|
||||||
{
|
{
|
||||||
if (null === $comparison) {
|
if (is_array($dbCreatorId)) {
|
||||||
if (is_array($dbCreator)) {
|
$useMinMax = false;
|
||||||
|
if (isset($dbCreatorId['min'])) {
|
||||||
|
$this->addUsingAlias(CcPlaylistPeer::CREATOR_ID, $dbCreatorId['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($dbCreatorId['max'])) {
|
||||||
|
$this->addUsingAlias(CcPlaylistPeer::CREATOR_ID, $dbCreatorId['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
$comparison = Criteria::IN;
|
$comparison = Criteria::IN;
|
||||||
} elseif (preg_match('/[\%\*]/', $dbCreator)) {
|
|
||||||
$dbCreator = str_replace('*', '%', $dbCreator);
|
|
||||||
$comparison = Criteria::LIKE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->addUsingAlias(CcPlaylistPeer::CREATOR, $dbCreator, $comparison);
|
return $this->addUsingAlias(CcPlaylistPeer::CREATOR_ID, $dbCreatorId, $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -433,6 +350,28 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
|
||||||
return $this->addUsingAlias(CcPlaylistPeer::DESCRIPTION, $dbDescription, $comparison);
|
return $this->addUsingAlias(CcPlaylistPeer::DESCRIPTION, $dbDescription, $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the length column
|
||||||
|
*
|
||||||
|
* @param string $dbLength The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcPlaylistQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbLength($dbLength = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbLength)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbLength)) {
|
||||||
|
$dbLength = str_replace('*', '%', $dbLength);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcPlaylistPeer::LENGTH, $dbLength, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the query by a related CcSubjs object
|
* Filter the query by a related CcSubjs object
|
||||||
*
|
*
|
||||||
|
@ -444,7 +383,7 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
|
||||||
public function filterByCcSubjs($ccSubjs, $comparison = null)
|
public function filterByCcSubjs($ccSubjs, $comparison = null)
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->addUsingAlias(CcPlaylistPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison);
|
->addUsingAlias(CcPlaylistPeer::CREATOR_ID, $ccSubjs->getDbId(), $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -107,6 +107,9 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
protected $alreadyInValidation = false;
|
protected $alreadyInValidation = false;
|
||||||
|
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
protected $oldCcPlaylist;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies default values to this object.
|
* Applies default values to this object.
|
||||||
* This method should be called from the object's constructor (or
|
* This method should be called from the object's constructor (or
|
||||||
|
@ -895,6 +898,8 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
||||||
$this->postUpdate($con);
|
$this->postUpdate($con);
|
||||||
}
|
}
|
||||||
$this->postSave($con);
|
$this->postSave($con);
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
$this->updateRelatedCcPlaylist($con);
|
||||||
CcPlaylistcontentsPeer::addInstanceToPool($this);
|
CcPlaylistcontentsPeer::addInstanceToPool($this);
|
||||||
} else {
|
} else {
|
||||||
$affectedRows = 0;
|
$affectedRows = 0;
|
||||||
|
@ -1437,6 +1442,10 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
||||||
*/
|
*/
|
||||||
public function setCcPlaylist(CcPlaylist $v = null)
|
public function setCcPlaylist(CcPlaylist $v = null)
|
||||||
{
|
{
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
if (null !== $this->aCcPlaylist && $v !== $this->aCcPlaylist) {
|
||||||
|
$this->oldCcPlaylist = $this->aCcPlaylist;
|
||||||
|
}
|
||||||
if ($v === null) {
|
if ($v === null) {
|
||||||
$this->setDbPlaylistId(NULL);
|
$this->setDbPlaylistId(NULL);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1518,6 +1527,24 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
||||||
$this->aCcPlaylist = null;
|
$this->aCcPlaylist = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the aggregate column in the related CcPlaylist object
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con A connection object
|
||||||
|
*/
|
||||||
|
protected function updateRelatedCcPlaylist(PropelPDO $con)
|
||||||
|
{
|
||||||
|
if ($ccPlaylist = $this->getCcPlaylist()) {
|
||||||
|
$ccPlaylist->updateDbLength($con);
|
||||||
|
}
|
||||||
|
if ($this->oldCcPlaylist) {
|
||||||
|
$this->oldCcPlaylist->updateDbLength($con);
|
||||||
|
$this->oldCcPlaylist = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Catches calls to virtual methods
|
* Catches calls to virtual methods
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -578,4 +578,90 @@ abstract class BaseCcPlaylistcontentsQuery extends ModelCriteria
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code to execute before every DELETE statement
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con The connection object used by the query
|
||||||
|
*/
|
||||||
|
protected function basePreDelete(PropelPDO $con)
|
||||||
|
{
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
$this->findRelatedCcPlaylists($con);
|
||||||
|
|
||||||
|
return $this->preDelete($con);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code to execute after every DELETE statement
|
||||||
|
*
|
||||||
|
* @param int $affectedRows the number of deleted rows
|
||||||
|
* @param PropelPDO $con The connection object used by the query
|
||||||
|
*/
|
||||||
|
protected function basePostDelete($affectedRows, PropelPDO $con)
|
||||||
|
{
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
$this->updateRelatedCcPlaylists($con);
|
||||||
|
|
||||||
|
return $this->postDelete($affectedRows, $con);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code to execute before every UPDATE statement
|
||||||
|
*
|
||||||
|
* @param array $values The associatiove array of columns and values for the update
|
||||||
|
* @param PropelPDO $con The connection object used by the query
|
||||||
|
* @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), ortherwise it is a series of save() calls on all the found objects
|
||||||
|
*/
|
||||||
|
protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false)
|
||||||
|
{
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
$this->findRelatedCcPlaylists($con);
|
||||||
|
|
||||||
|
return $this->preUpdate($values, $con, $forceIndividualSaves);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Code to execute after every UPDATE statement
|
||||||
|
*
|
||||||
|
* @param int $affectedRows the number of udated rows
|
||||||
|
* @param PropelPDO $con The connection object used by the query
|
||||||
|
*/
|
||||||
|
protected function basePostUpdate($affectedRows, PropelPDO $con)
|
||||||
|
{
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
$this->updateRelatedCcPlaylists($con);
|
||||||
|
|
||||||
|
return $this->postUpdate($affectedRows, $con);
|
||||||
|
}
|
||||||
|
|
||||||
|
// aggregate_column_relation behavior
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the related CcPlaylist objects and keep them for later
|
||||||
|
*
|
||||||
|
* @param PropelPDO $con A connection object
|
||||||
|
*/
|
||||||
|
protected function findRelatedCcPlaylists($con)
|
||||||
|
{
|
||||||
|
$criteria = clone $this;
|
||||||
|
if ($this->useAliasInSQL) {
|
||||||
|
$alias = $this->getModelAlias();
|
||||||
|
$criteria->removeAlias($alias);
|
||||||
|
} else {
|
||||||
|
$alias = '';
|
||||||
|
}
|
||||||
|
$this->ccPlaylists = CcPlaylistQuery::create()
|
||||||
|
->joinCcPlaylistcontents($alias)
|
||||||
|
->mergeWith($criteria)
|
||||||
|
->find($con);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function updateRelatedCcPlaylists($con)
|
||||||
|
{
|
||||||
|
foreach ($this->ccPlaylists as $ccPlaylist) {
|
||||||
|
$ccPlaylist->updateDbLength($con);
|
||||||
|
}
|
||||||
|
$this->ccPlaylists = array();
|
||||||
|
}
|
||||||
|
|
||||||
} // BaseCcPlaylistcontentsQuery
|
} // BaseCcPlaylistcontentsQuery
|
||||||
|
|
|
@ -758,7 +758,7 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
|
||||||
public function filterByCcPlaylist($ccPlaylist, $comparison = null)
|
public function filterByCcPlaylist($ccPlaylist, $comparison = null)
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->addUsingAlias(CcSubjsPeer::ID, $ccPlaylist->getDbEditedby(), $comparison);
|
->addUsingAlias(CcSubjsPeer::ID, $ccPlaylist->getDbCreatorId(), $comparison);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Note: project.home is automatically generated by the propel-install script.
|
#Note: project.home is automatically generated by the propel-install script.
|
||||||
#Any manual changes to this value will be overwritten.
|
#Any manual changes to this value will be overwritten.
|
||||||
project.home = /home/james/src/airtime/airtime_mvc
|
project.home = /home/naomiaro/airtime/airtime_mvc
|
||||||
project.build = ${project.home}/build
|
project.build = ${project.home}/build
|
||||||
|
|
||||||
#Database driver
|
#Database driver
|
||||||
|
|
|
@ -216,16 +216,19 @@
|
||||||
<table name="cc_playlist" phpName="CcPlaylist">
|
<table name="cc_playlist" phpName="CcPlaylist">
|
||||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||||
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
||||||
<column name="state" phpName="DbState" type="VARCHAR" size="128" required="true" defaultValue="empty"/>
|
|
||||||
<column name="currentlyaccessing" phpName="DbCurrentlyaccessing" type="INTEGER" required="true" defaultValue="0"/>
|
|
||||||
<column name="editedby" phpName="DbEditedby" type="INTEGER" required="false"/>
|
|
||||||
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="false"/>
|
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="false"/>
|
||||||
<column name="utime" phpName="DbUtime" type="TIMESTAMP" size="6" required="false"/>
|
<column name="utime" phpName="DbUtime" type="TIMESTAMP" size="6" required="false"/>
|
||||||
<column name="lptime" phpName="DbLPtime" type="TIMESTAMP" size="6" required="false"/>
|
<column name="lptime" phpName="DbLPtime" type="TIMESTAMP" size="6" required="false"/>
|
||||||
<column name="creator" phpName="DbCreator" type="VARCHAR" size="32" required="false"/>
|
<column name="creator_id" phpName="DbCreatorId" type="INTEGER" required="false"/>
|
||||||
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
|
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
|
||||||
<foreign-key foreignTable="cc_subjs" name="cc_playlist_editedby_fkey">
|
<column name="length" phpName="DbLength" type="VARCHAR" sqlType="interval" defaultValue="00:00:00"/>
|
||||||
<reference local="editedby" foreign="id"/>
|
<behavior name="aggregate_column">
|
||||||
|
<parameter name="name" value="length" />
|
||||||
|
<parameter name="foreign_table" value="cc_playlistcontents" />
|
||||||
|
<parameter name="expression" value="SUM(cliplength)" />
|
||||||
|
</behavior>
|
||||||
|
<foreign-key foreignTable="cc_subjs" name="cc_playlist_createdby_fkey">
|
||||||
|
<reference local="creator_id" foreign="id"/>
|
||||||
</foreign-key>
|
</foreign-key>
|
||||||
</table>
|
</table>
|
||||||
<table name="cc_playlistcontents" phpName="CcPlaylistcontents">
|
<table name="cc_playlistcontents" phpName="CcPlaylistcontents">
|
||||||
|
|
|
@ -288,14 +288,12 @@ CREATE TABLE "cc_playlist"
|
||||||
(
|
(
|
||||||
"id" serial NOT NULL,
|
"id" serial NOT NULL,
|
||||||
"name" VARCHAR(255) default '' NOT NULL,
|
"name" VARCHAR(255) default '' NOT NULL,
|
||||||
"state" VARCHAR(128) default 'empty' NOT NULL,
|
|
||||||
"currentlyaccessing" INTEGER default 0 NOT NULL,
|
|
||||||
"editedby" INTEGER,
|
|
||||||
"mtime" TIMESTAMP(6),
|
"mtime" TIMESTAMP(6),
|
||||||
"utime" TIMESTAMP(6),
|
"utime" TIMESTAMP(6),
|
||||||
"lptime" TIMESTAMP(6),
|
"lptime" TIMESTAMP(6),
|
||||||
"creator" VARCHAR(32),
|
"creator_id" INTEGER,
|
||||||
"description" VARCHAR(512),
|
"description" VARCHAR(512),
|
||||||
|
"length" interval default '00:00:00',
|
||||||
PRIMARY KEY ("id")
|
PRIMARY KEY ("id")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -575,7 +573,7 @@ ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_show_fkey" FOREIGN KEY ("sho
|
||||||
|
|
||||||
ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_host_fkey" FOREIGN KEY ("subjs_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_host_fkey" FOREIGN KEY ("subjs_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
||||||
|
|
||||||
ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");
|
ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_createdby_fkey" FOREIGN KEY ("creator_id") REFERENCES "cc_subjs" ("id");
|
||||||
|
|
||||||
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;
|
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;
|
||||||
|
|
||||||
|
|
|
@ -3,26 +3,5 @@
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
DROP FUNCTION calculate_position() CASCADE;
|
DROP FUNCTION calculate_position() CASCADE;
|
||||||
|
|
||||||
/* remove this trigger for group adds/delete */
|
--remove this trigger for group adds/delete
|
||||||
|
|
||||||
/*
|
|
||||||
CREATE FUNCTION calculate_position() RETURNS trigger AS
|
|
||||||
'
|
|
||||||
BEGIN
|
|
||||||
IF(TG_OP=''INSERT'') THEN
|
|
||||||
UPDATE cc_playlistcontents SET position = (position + 1)
|
|
||||||
WHERE (playlist_id = new.playlist_id AND position >= new.position AND id != new.id);
|
|
||||||
END IF;
|
|
||||||
IF(TG_OP=''DELETE'') THEN
|
|
||||||
UPDATE cc_playlistcontents SET position = (position - 1)
|
|
||||||
WHERE (playlist_id = old.playlist_id AND position > old.position);
|
|
||||||
END IF;
|
|
||||||
RETURN NULL;
|
|
||||||
END;
|
|
||||||
'
|
|
||||||
LANGUAGE 'plpgsql';
|
|
||||||
|
|
||||||
CREATE TRIGGER calculate_position AFTER INSERT OR DELETE ON cc_playlistcontents
|
|
||||||
FOR EACH ROW EXECUTE PROCEDURE calculate_position();
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,4 @@
|
||||||
---cc_playlisttimes
|
---cc_playlisttimes
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
CREATE VIEW cc_playlisttimes AS
|
DROP VIEW cc_playlisttimes;
|
||||||
SELECT pl.id, COALESCE(t.length, '00:00:00'::time without time zone) AS length
|
|
||||||
FROM cc_playlist pl
|
|
||||||
LEFT JOIN ( SELECT cc_playlistcontents.playlist_id AS id,
|
|
||||||
sum(cc_playlistcontents.cliplength::interval)::time without time zone AS length
|
|
||||||
FROM cc_playlistcontents
|
|
||||||
GROUP BY cc_playlistcontents.playlist_id) t ON pl.id = t.id;
|
|
||||||
|
|
|
@ -282,16 +282,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
.empty()
|
.empty()
|
||||||
.append(json.html);
|
.append(json.html);
|
||||||
|
|
||||||
mod.setUpPlaylist();
|
setUpPlaylist();
|
||||||
}
|
|
||||||
|
|
||||||
function setPlaylistButtonEvents(el) {
|
|
||||||
|
|
||||||
$(el).delegate("#spl_new",
|
|
||||||
{"click": AIRTIME.playlist.fnNew});
|
|
||||||
|
|
||||||
$(el).delegate("#spl_delete",
|
|
||||||
{"click": AIRTIME.playlist.fnDelete});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sets events dynamically for playlist entries (each row in the playlist)
|
//sets events dynamically for playlist entries (each row in the playlist)
|
||||||
|
@ -336,7 +327,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
"keydown": submitOnEnter});
|
"keydown": submitOnEnter});
|
||||||
}
|
}
|
||||||
|
|
||||||
mod.setUpPlaylist = function() {
|
function setUpPlaylist(playlist) {
|
||||||
|
|
||||||
var playlist = $("#side_playlist"),
|
var playlist = $("#side_playlist"),
|
||||||
sortableConf;
|
sortableConf;
|
||||||
|
@ -478,11 +469,6 @@ var AIRTIME = (function(AIRTIME){
|
||||||
playlist.find("#spl_crossfade").removeClass("ui-state-active");
|
playlist.find("#spl_crossfade").removeClass("ui-state-active");
|
||||||
playlist.find("#crossfade_main").hide();
|
playlist.find("#crossfade_main").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
setPlaylistButtonEvents(playlist);
|
|
||||||
setPlaylistEntryEvents(playlist);
|
|
||||||
setCueEvents(playlist);
|
|
||||||
setFadeEvents(playlist);
|
|
||||||
|
|
||||||
sortableConf = (function(){
|
sortableConf = (function(){
|
||||||
var origRow,
|
var origRow,
|
||||||
|
@ -530,8 +516,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
start: function(event, ui) {
|
start: function(event, ui) {
|
||||||
ui.placeholder.html("PLACE HOLDER")
|
ui.placeholder.html("PLACE HOLDER")
|
||||||
.width("99.5%")
|
.width("99.5%")
|
||||||
.height(56)
|
.height(56);
|
||||||
.append('<div style="clear:both;"/>');
|
|
||||||
},
|
},
|
||||||
receive: fnReceive,
|
receive: fnReceive,
|
||||||
update: fnUpdate
|
update: fnUpdate
|
||||||
|
@ -600,12 +585,27 @@ var AIRTIME = (function(AIRTIME){
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mod.init = function() {
|
||||||
|
var playlist = $("#side_playlist");
|
||||||
|
|
||||||
|
$(playlist).delegate("#spl_new",
|
||||||
|
{"click": AIRTIME.playlist.fnNew});
|
||||||
|
|
||||||
|
$(playlist).delegate("#spl_delete",
|
||||||
|
{"click": AIRTIME.playlist.fnDelete});
|
||||||
|
|
||||||
|
setPlaylistEntryEvents(playlist);
|
||||||
|
setCueEvents(playlist);
|
||||||
|
setFadeEvents(playlist);
|
||||||
|
|
||||||
|
setUpPlaylist(playlist);
|
||||||
|
}
|
||||||
|
|
||||||
return AIRTIME;
|
return AIRTIME;
|
||||||
|
|
||||||
}(AIRTIME || {}));
|
}(AIRTIME || {}));
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
AIRTIME.playlist.init();
|
||||||
AIRTIME.playlist.setUpPlaylist();
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue