Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
Conflicts: airtime_mvc/application/models/airtime/map/CcPlaylistcontentsTableMap.php airtime_mvc/build/schema.xml airtime_mvc/build/sql/schema.sql
This commit is contained in:
commit
8f2339f109
|
@ -10,31 +10,33 @@ $ccAcl->addRole(new Zend_Acl_Role('G'))
|
|||
->addRole(new Zend_Acl_Role('A'), 'P');
|
||||
|
||||
$ccAcl->add(new Zend_Acl_Resource('library'))
|
||||
->add(new Zend_Acl_Resource('index'))
|
||||
->add(new Zend_Acl_Resource('user'))
|
||||
->add(new Zend_Acl_Resource('error'))
|
||||
->add(new Zend_Acl_Resource('index'))
|
||||
->add(new Zend_Acl_Resource('user'))
|
||||
->add(new Zend_Acl_Resource('error'))
|
||||
->add(new Zend_Acl_Resource('login'))
|
||||
->add(new Zend_Acl_Resource('playlist'))
|
||||
->add(new Zend_Acl_Resource('plupload'))
|
||||
->add(new Zend_Acl_Resource('schedule'))
|
||||
->add(new Zend_Acl_Resource('api'))
|
||||
->add(new Zend_Acl_Resource('systemstatus'))
|
||||
->add(new Zend_Acl_Resource('playlist'))
|
||||
->add(new Zend_Acl_Resource('plupload'))
|
||||
->add(new Zend_Acl_Resource('schedule'))
|
||||
->add(new Zend_Acl_Resource('api'))
|
||||
->add(new Zend_Acl_Resource('systemstatus'))
|
||||
->add(new Zend_Acl_Resource('dashboard'))
|
||||
->add(new Zend_Acl_Resource('preference'))
|
||||
->add(new Zend_Acl_Resource('showbuilder'))
|
||||
->add(new Zend_Acl_Resource('playouthistory'))
|
||||
->add(new Zend_Acl_Resource('usersettings'))
|
||||
->add(new Zend_Acl_Resource('audiopreview'));
|
||||
->add(new Zend_Acl_Resource('audiopreview'))
|
||||
->add(new Zend_Acl_Resource('webstream'));
|
||||
|
||||
/** Creating permissions */
|
||||
$ccAcl->allow('G', 'index')
|
||||
->allow('G', 'login')
|
||||
->allow('G', 'error')
|
||||
->allow('G', 'showbuilder')
|
||||
->allow('G', 'api')
|
||||
->allow('G', 'login')
|
||||
->allow('G', 'error')
|
||||
->allow('G', 'showbuilder')
|
||||
->allow('G', 'api')
|
||||
->allow('G', 'schedule')
|
||||
->allow('G', 'dashboard')
|
||||
->allow('G', 'audiopreview')
|
||||
->allow('G', 'webstream')
|
||||
->allow('H', 'preference', 'is-import-in-progress')
|
||||
->allow('H', 'usersettings')
|
||||
->allow('H', 'plupload')
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
<?php
|
||||
// This file generated by Propel 1.5.2 convert-conf target
|
||||
return array (
|
||||
'CcAccessTableMap' => 'airtime/map/CcAccessTableMap.php',
|
||||
'CcAccessPeer' => 'airtime/CcAccessPeer.php',
|
||||
'CcAccess' => 'airtime/CcAccess.php',
|
||||
'CcAccessQuery' => 'airtime/CcAccessQuery.php',
|
||||
'BaseCcAccessPeer' => 'airtime/om/BaseCcAccessPeer.php',
|
||||
'BaseCcAccess' => 'airtime/om/BaseCcAccess.php',
|
||||
'BaseCcAccessQuery' => 'airtime/om/BaseCcAccessQuery.php',
|
||||
'CcMusicDirsTableMap' => 'airtime/map/CcMusicDirsTableMap.php',
|
||||
'CcMusicDirsPeer' => 'airtime/CcMusicDirsPeer.php',
|
||||
'CcMusicDirs' => 'airtime/CcMusicDirs.php',
|
||||
|
@ -176,4 +169,11 @@ return array (
|
|||
'BaseCcLiveLogPeer' => 'airtime/om/BaseCcLiveLogPeer.php',
|
||||
'BaseCcLiveLog' => 'airtime/om/BaseCcLiveLog.php',
|
||||
'BaseCcLiveLogQuery' => 'airtime/om/BaseCcLiveLogQuery.php',
|
||||
'CcWebstreamTableMap' => 'airtime/map/CcWebstreamTableMap.php',
|
||||
'CcWebstreamPeer' => 'airtime/CcWebstreamPeer.php',
|
||||
'CcWebstream' => 'airtime/CcWebstream.php',
|
||||
'CcWebstreamQuery' => 'airtime/CcWebstreamQuery.php',
|
||||
'BaseCcWebstreamPeer' => 'airtime/om/BaseCcWebstreamPeer.php',
|
||||
'BaseCcWebstream' => 'airtime/om/BaseCcWebstream.php',
|
||||
'BaseCcWebstreamQuery' => 'airtime/om/BaseCcWebstreamQuery.php',
|
||||
);
|
|
@ -113,54 +113,51 @@ class ApiController extends Zend_Controller_Action
|
|||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$fileID = $this->_getParam("file");
|
||||
$file_id = substr($fileID, 0, strpos($fileID, "."));
|
||||
$fileId = $this->_getParam("file");
|
||||
|
||||
if (ctype_alnum($file_id) && strlen($file_id) == 32) {
|
||||
$media = Application_Model_StoredFile::RecallByGunid($file_id);
|
||||
if ($media != null) {
|
||||
$media = Application_Model_StoredFile::Recall($fileId);
|
||||
if ($media != null) {
|
||||
|
||||
$filepath = $media->getFilePath();
|
||||
if (is_file($filepath)) {
|
||||
$full_path = $media->getPropelOrm()->getDbFilepath();
|
||||
$filepath = $media->getFilePath();
|
||||
if (is_file($filepath)) {
|
||||
$full_path = $media->getPropelOrm()->getDbFilepath();
|
||||
|
||||
$file_base_name = strrchr($full_path, '/');
|
||||
/* If $full_path does not contain a '/', strrchr will return false,
|
||||
* in which case we can use $full_path as the base name.
|
||||
*/
|
||||
if (!$file_base_name) {
|
||||
$file_base_name = $full_path;
|
||||
} else {
|
||||
$file_base_name = substr($file_base_name, 1);
|
||||
}
|
||||
|
||||
// possibly use fileinfo module here in the future.
|
||||
// http://www.php.net/manual/en/book.fileinfo.php
|
||||
$ext = pathinfo($fileID, PATHINFO_EXTENSION);
|
||||
//Download user left clicks a track and selects Download.
|
||||
if ("true" == $this->_getParam('download')) {
|
||||
//path_info breaks up a file path into seperate pieces of informaiton.
|
||||
//We just want the basename which is the file name with the path
|
||||
//information stripped away. We are using Content-Disposition to specify
|
||||
//to the browser what name the file should be saved as.
|
||||
//
|
||||
// By james.moon:
|
||||
// I'm removing pathinfo() since it strips away UTF-8 characters.
|
||||
// Using manualy parsing
|
||||
header('Content-Disposition: attachment; filename="'.$file_base_name.'"');
|
||||
} else {
|
||||
//user clicks play button for track and downloads it.
|
||||
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
|
||||
}
|
||||
if (strtolower($ext) === 'mp3') {
|
||||
$this->smartReadFile($filepath, 'audio/mpeg');
|
||||
} else {
|
||||
$this->smartReadFile($filepath, 'audio/'.$ext);
|
||||
}
|
||||
exit;
|
||||
$file_base_name = strrchr($full_path, '/');
|
||||
/* If $full_path does not contain a '/', strrchr will return false,
|
||||
* in which case we can use $full_path as the base name.
|
||||
*/
|
||||
if (!$file_base_name) {
|
||||
$file_base_name = $full_path;
|
||||
} else {
|
||||
header ("HTTP/1.1 404 Not Found");
|
||||
$file_base_name = substr($file_base_name, 1);
|
||||
}
|
||||
|
||||
// possibly use fileinfo module here in the future.
|
||||
// http://www.php.net/manual/en/book.fileinfo.php
|
||||
$ext = pathinfo($file_base_name, PATHINFO_EXTENSION);
|
||||
//Download user left clicks a track and selects Download.
|
||||
if ("true" == $this->_getParam('download')) {
|
||||
//path_info breaks up a file path into seperate pieces of informaiton.
|
||||
//We just want the basename which is the file name with the path
|
||||
//information stripped away. We are using Content-Disposition to specify
|
||||
//to the browser what name the file should be saved as.
|
||||
//
|
||||
// By james.moon:
|
||||
// I'm removing pathinfo() since it strips away UTF-8 characters.
|
||||
// Using manualy parsing
|
||||
header('Content-Disposition: attachment; filename="'.$file_base_name.'"');
|
||||
} else {
|
||||
//user clicks play button for track and downloads it.
|
||||
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
|
||||
}
|
||||
if (strtolower($ext) === 'mp3') {
|
||||
$this->smartReadFile($filepath, 'audio/mpeg');
|
||||
} else {
|
||||
$this->smartReadFile($filepath, 'audio/'.$ext);
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
header ("HTTP/1.1 404 Not Found");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,18 +99,18 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$pl = new Application_Model_Playlist($playlistID);
|
||||
$result = Array();
|
||||
|
||||
foreach ( $pl->getContents(true) as $track ) {
|
||||
foreach ($pl->getContents(true) as $track) {
|
||||
|
||||
$elementMap = array( 'element_title' => isset($track['CcFiles']['track_title'])?$track['CcFiles']['track_title']:"",
|
||||
'element_artist' => isset($track['CcFiles']['artist_name'])?$track['CcFiles']['artist_name']:"",
|
||||
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
||||
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
||||
'element_id' => isset($track['id'])?$track['id']:"",
|
||||
'element_position' => isset($track['position'])?$track['position']:"",
|
||||
);
|
||||
$fileExtension = pathinfo($track['CcFiles']['filepath'], PATHINFO_EXTENSION);
|
||||
$fileExtension = pathinfo($track['path'], PATHINFO_EXTENSION);
|
||||
if (strtolower($fileExtension) === 'mp3') {
|
||||
$elementMap['element_mp3'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
|
||||
} elseif (strtolower($fileExtension) === 'ogg') {
|
||||
$elementMap['element_oga'] = $track['CcFiles']['gunid'].'.'.$fileExtension;
|
||||
$elementMap['element_mp3'] = $track['item_id'];
|
||||
} else if (strtolower($fileExtension) === 'ogg') {
|
||||
$elementMap['element_oga'] = $track['item_id'];
|
||||
} else {
|
||||
//the media was neither mp3 or ogg
|
||||
}
|
||||
|
@ -183,9 +183,9 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
$fileExtension = pathinfo($track['filepath'], PATHINFO_EXTENSION);
|
||||
if (strtolower($fileExtension) === 'mp3') {
|
||||
$elementMap['element_mp3'] = $track['gunid'].'.'.$fileExtension;
|
||||
$elementMap['element_mp3'] = $track['item_id'];
|
||||
} elseif (strtolower($fileExtension) === 'ogg') {
|
||||
$elementMap['element_oga'] = $track['gunid'].'.'.$fileExtension;
|
||||
$elementMap['element_oga'] = $track['item_id'];
|
||||
} else {
|
||||
//the media was neither mp3 or ogg
|
||||
}
|
||||
|
|
|
@ -57,7 +57,11 @@ class LibraryController extends Zend_Controller_Action
|
|||
$obj = new Application_Model_Block($this->obj_sess->id);
|
||||
}
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
$menu["pl_add"] = array("name"=> "Add to ".ucfirst($this->obj_sess->type), "icon" => "add-playlist", "icon" => "copy");
|
||||
if ($this->obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
} else {
|
||||
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($isAdminOrPM) {
|
||||
|
@ -72,6 +76,13 @@ class LibraryController extends Zend_Controller_Action
|
|||
$obj = new Application_Model_Playlist($id);
|
||||
} else {
|
||||
$obj = new Application_Model_Block($id);
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($this->obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
} else {
|
||||
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->obj_sess->id !== $id && $screen == "playlist") {
|
||||
|
|
|
@ -219,7 +219,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
$name = 'Untitled Playlist';
|
||||
if ($type == 'block') {
|
||||
$name = 'Untitled Smart Block';
|
||||
$name = 'Untitled Smart Playlist';
|
||||
}
|
||||
|
||||
$obj = new $objInfo['className']();
|
||||
|
@ -293,7 +293,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function addItemsAction()
|
||||
{
|
||||
$ids = $this->_getParam('ids', array());
|
||||
$ids = $this->_getParam('aItems', array());
|
||||
$ids = (!is_array($ids)) ? array($ids) : $ids;
|
||||
$afterItem = $this->_getParam('afterItem', null);
|
||||
$addType = $this->_getParam('type', 'after');
|
||||
|
@ -307,17 +307,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
} else {
|
||||
throw new PlaylistDyanmicException;
|
||||
}
|
||||
}
|
||||
catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($e);
|
||||
}
|
||||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound($obj_type);
|
||||
}
|
||||
catch (PlaylistDyanmicException $e) {
|
||||
$this->playlistDynamic($obj);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($pl, $e);
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound();
|
||||
} catch (PlaylistDyanmicException $e) {
|
||||
$this->playlistDynamic($pl);
|
||||
} catch (Exception $e) {
|
||||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,17 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable);
|
||||
$this->view->events = $events;
|
||||
}
|
||||
|
||||
public function getCurrentShowAction()
|
||||
{
|
||||
$currentShow = Application_Model_Show::GetCurrentShow();
|
||||
if (!empty($currentShow)) {
|
||||
$this->view->si_id = $currentShow[0]["instance_id"];
|
||||
$this->view->current_show = true;
|
||||
} else {
|
||||
$this->view->current_show = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function moveShowAction()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
class WebstreamController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('new', 'json')
|
||||
->addActionContext('save', 'json')
|
||||
->initContext();
|
||||
//TODO
|
||||
//$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
|
||||
}
|
||||
|
||||
public function newAction()
|
||||
{
|
||||
$this->view->ws = new Application_Model_Webstream();
|
||||
$this->view->html = $this->view->render('webstream/webstream.phtml');
|
||||
/*
|
||||
$pl_sess = $this->pl_sess;
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$pl = new Application_Model_Playlist();
|
||||
$pl->setName("Untitled Playlist");
|
||||
$pl->setPLMetaData('dc:creator', $userInfo->id);
|
||||
|
||||
$this->changePlaylist($pl->getId());
|
||||
$this->createFullResponse($pl);
|
||||
*/
|
||||
}
|
||||
|
||||
public function saveAction(){
|
||||
$request = $this->getRequest();
|
||||
|
||||
Application_Model_Webstream::save($request);
|
||||
|
||||
|
||||
$this->view->x = "hi";
|
||||
|
||||
|
||||
//http://localhost/Library/contents-feed
|
||||
// 1) Create Propel object and save these parameters
|
||||
// 2) Make these appear in the library
|
||||
// 3) Make Web streams + playlists draggable.
|
||||
// 4)
|
||||
}
|
||||
}
|
|
@ -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,46 @@ class Application_Model_Playlist
|
|||
->endUse();
|
||||
}
|
||||
$query->orderByDbPosition()
|
||||
->filterByDbType(0)
|
||||
->leftJoinWith('CcFiles');
|
||||
$rows = $query->find($this->con);
|
||||
*/
|
||||
$sql = <<<"EOT"
|
||||
((SELECT pc.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout,
|
||||
f.id as item_id, 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.id as id, pc.type, pc.position, pc.cliplength as length, pc.cuein, pc.cueout, pc.fadein, pc.fadeout,
|
||||
ws.id as item_id, (ws.name || ': ' || ws.url) as title, ws.login as creator, 't'::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();
|
||||
|
||||
$offset = 0;
|
||||
foreach ($rows as &$row) {
|
||||
Logging::log($row);
|
||||
|
||||
$clipSec = Application_Common_DateHelper::playlistTimeToSeconds($row['length']);
|
||||
$offset += $clipSec;
|
||||
$offset_cliplength = Application_Common_DateHelper::secondsToPlaylistTime($offset);
|
||||
|
||||
//format the length for UI.
|
||||
$formatter = new LengthFormatter($row['length']);
|
||||
$row['length'] = $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 +220,9 @@ class Application_Model_Playlist
|
|||
|
||||
$i++;
|
||||
}
|
||||
*/
|
||||
|
||||
return $files;
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -199,19 +232,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 +255,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 +266,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 +295,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 +320,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 +341,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 +363,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.
|
||||
|
|
|
@ -251,7 +251,7 @@ class Application_Model_Schedule
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = "SELECT DISTINCT
|
||||
$templateSql = "SELECT DISTINCT
|
||||
|
||||
showt.name AS show_name, showt.color AS show_color,
|
||||
showt.background_color AS show_background_color, showt.id AS show_id,
|
||||
|
@ -265,12 +265,17 @@ class Application_Model_Schedule
|
|||
sched.fade_in AS fade_in, sched.fade_out AS fade_out,
|
||||
sched.playout_status AS playout_status,
|
||||
|
||||
ft.track_title AS file_track_title, ft.artist_name AS file_artist_name,
|
||||
ft.album_title AS file_album_title, ft.length AS file_length, ft.file_exists AS file_exists
|
||||
--ft.track_title AS file_track_title, ft.artist_name AS file_artist_name,
|
||||
--ft.album_title AS file_album_title, ft.length AS file_length, ft.file_exists AS file_exists
|
||||
%%columns%%
|
||||
|
||||
FROM
|
||||
((cc_schedule AS sched JOIN cc_files AS ft ON (sched.file_id = ft.id)
|
||||
RIGHT OUTER JOIN cc_show_instances AS si ON (si.id = sched.instance_id))
|
||||
((
|
||||
--cc_schedule AS sched JOIN cc_files AS ft ON (sched.file_id = ft.id)
|
||||
%%join%%
|
||||
|
||||
--JOIN cc_webstream AS ws ON (sched.stream_id = ws.id)
|
||||
RIGHT JOIN cc_show_instances AS si ON (si.id = sched.instance_id))
|
||||
JOIN cc_show AS showt ON (showt.id = si.show_id)
|
||||
)
|
||||
|
||||
|
@ -281,15 +286,30 @@ class Application_Model_Schedule
|
|||
OR (si.starts <= '{$p_start}' AND si.ends >= '{$p_end}'))";
|
||||
|
||||
if (count($p_shows) > 0) {
|
||||
$sql .= " AND show_id IN (".implode(",", $p_shows).")";
|
||||
$templateSql .= " AND show_id IN (".implode(",", $p_shows).")";
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY si.starts, sched.starts;";
|
||||
$templateSql .= " ORDER BY si.starts, sched.starts";
|
||||
|
||||
Logging::debug($sql);
|
||||
$filesSql = str_replace("%%columns%%",
|
||||
"ft.track_title AS file_track_title, ft.artist_name AS file_artist_name,
|
||||
ft.album_title AS file_album_title, ft.length AS file_length, ft.file_exists AS file_exists",
|
||||
$templateSql);
|
||||
$filesSql= str_replace("%%join%%",
|
||||
"cc_schedule AS sched JOIN cc_files AS ft ON (sched.file_id = ft.id)",
|
||||
$filesSql);
|
||||
|
||||
$rows = $con->query($sql)->fetchAll();
|
||||
$streamSql = str_replace("%%columns%%",
|
||||
"ws.name AS file_track_title, ws.login AS file_artist_name,
|
||||
ws.description AS file_album_title, ws.length AS file_length, 't'::BOOL AS file_exists",
|
||||
$templateSql);
|
||||
$streamSql = str_replace("%%join%%",
|
||||
"cc_schedule AS sched JOIN cc_webstream AS ws ON (sched.stream_id = ws.id)",
|
||||
$streamSql);
|
||||
|
||||
$sql = "($filesSql) UNION ($streamSql)";
|
||||
|
||||
$rows = $con->query($sql)->fetchAll(PDO::FETCH_ASSOC);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
@ -470,14 +490,20 @@ class Application_Model_Schedule
|
|||
." st.cue_out AS cue_out,"
|
||||
." st.fade_in AS fade_in,"
|
||||
." st.fade_out AS fade_out,"
|
||||
//." st.type AS type,"
|
||||
." si.starts AS show_start,"
|
||||
." si.ends AS show_end,"
|
||||
." f.replay_gain AS replay_gain"
|
||||
." f.id AS file_id,"
|
||||
." f.replay_gain AS replay_gain,"
|
||||
." ws.id as stream_id,"
|
||||
." ws.url as url"
|
||||
." FROM $CC_CONFIG[scheduleTable] AS st"
|
||||
." LEFT JOIN $CC_CONFIG[showInstances] AS si"
|
||||
." ON st.instance_id = si.id"
|
||||
." LEFT JOIN $CC_CONFIG[filesTable] AS f"
|
||||
." ON st.file_id = f.id";
|
||||
." ON st.file_id = f.id"
|
||||
." LEFT JOIN cc_webstream AS ws"
|
||||
." ON st.stream_id = ws.id";
|
||||
|
||||
$predicates = " WHERE st.ends > '$p_startTime'"
|
||||
." AND st.starts < '$p_endTime'"
|
||||
|
@ -565,13 +591,14 @@ class Application_Model_Schedule
|
|||
$data["media"][$kick_start]['end'] = $kick_start;
|
||||
$data["media"][$kick_start]['event_type'] = "kick_out";
|
||||
$data["media"][$kick_start]['type'] = "event";
|
||||
$data["media"][$kick_start]['independent_event'] = true;
|
||||
|
||||
if ($kick_time !== $switch_off_time) {
|
||||
$switch_start = Application_Model_Schedule::AirtimeTimeToPypoTime($switch_off_time);
|
||||
$data["media"][$switch_start]['start'] = $switch_start;
|
||||
$data["media"][$switch_start]['end'] = $switch_start;
|
||||
$data["media"][$switch_start]['event_type'] = "switch_off";
|
||||
$data["media"][$switch_start]['type'] = "event";
|
||||
$data["media"][$switch_start]['independent_event'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -599,13 +626,27 @@ class Application_Model_Schedule
|
|||
$item["end"] = $showEndDateTime->format("Y-m-d H:i:s");
|
||||
}
|
||||
|
||||
$storedFile = Application_Model_StoredFile::Recall($item["file_id"]);
|
||||
$uri = $storedFile->getFilePath();
|
||||
if (!is_null($item['file_id'])) {
|
||||
//row is from "file"
|
||||
$media_id = $item['file_id'];
|
||||
$storedFile = Application_Model_StoredFile::Recall($media_id);
|
||||
$uri = $storedFile->getFilePath();
|
||||
$type = "file";
|
||||
$independent_event = false;
|
||||
} else if (!is_null($item['stream_id'])) {
|
||||
//row is type "webstream"
|
||||
$media_id = $item['stream_id'];
|
||||
$uri = $item['url'];
|
||||
$type = "stream";
|
||||
$independent_event = true;
|
||||
}
|
||||
|
||||
$start = Application_Model_Schedule::AirtimeTimeToPypoTime($item["start"]);
|
||||
$end = Application_Model_Schedule::AirtimeTimeToPypoTime($item["end"]);
|
||||
|
||||
$data["media"][$start] = array(
|
||||
'id' => $storedFile->getGunid(),
|
||||
'type' => "file",
|
||||
'id' => $media_id,
|
||||
'type' => $type,
|
||||
'row_id' => $item["id"],
|
||||
'uri' => $uri,
|
||||
'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_in"]),
|
||||
|
@ -613,10 +654,27 @@ class Application_Model_Schedule
|
|||
'cue_in' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_in"]),
|
||||
'cue_out' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_out"]),
|
||||
'start' => $start,
|
||||
'end' => Application_Model_Schedule::AirtimeTimeToPypoTime($item["end"]),
|
||||
'end' => $end,
|
||||
'show_name' => $showName,
|
||||
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"]
|
||||
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"],
|
||||
'independent_event' => $independent_event
|
||||
);
|
||||
|
||||
if ($type == "stream") {
|
||||
//since a stream never ends we have to insert an additional "kick stream" event. The "start"
|
||||
//time of this event is the "end" time of the stream minus 1 second.
|
||||
$dt = new DateTime($item["end"], new DateTimeZone('UTC'));
|
||||
$dt->sub(new DateInterval("PT1S"));
|
||||
$stream_end = Application_Model_Schedule::AirtimeTimeToPypoTime($dt->format("Y-m-d H:i:s"));
|
||||
|
||||
$data["media"][$stream_end] = array(
|
||||
'start' => $stream_end,
|
||||
'end' => $stream_end,
|
||||
'uri' => $uri,
|
||||
'type' => 'stream_end',
|
||||
'independent_event' => true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
|
|
@ -11,6 +11,7 @@ class Application_Model_Scheduler
|
|||
"fadein" => "00:00:00",
|
||||
"fadeout" => "00:00:00",
|
||||
"sched_id" => null,
|
||||
"type" => 0 //default type of '0' to represent files. type '1' represents a webstream
|
||||
);
|
||||
|
||||
private $epochNow;
|
||||
|
@ -145,8 +146,7 @@ class Application_Model_Scheduler
|
|||
|
||||
$files[] = $data;
|
||||
}
|
||||
}
|
||||
else if ($type === "playlist") {
|
||||
} else if ($type === "playlist") {
|
||||
|
||||
// find if the playslit is static or dynamic
|
||||
$c = new Criteria();
|
||||
|
@ -188,6 +188,28 @@ class Application_Model_Scheduler
|
|||
$data["cliplength"] = $file->getDbLength();
|
||||
}
|
||||
}
|
||||
$files[] = $data;
|
||||
}
|
||||
} else if ($type == "stream") {
|
||||
//need to return
|
||||
$stream = CcWebstreamQuery::create()->findPK($id, $this->con);
|
||||
|
||||
if (is_null($stream) /* || !$file->getDbFileExists() */) {
|
||||
throw new Exception("A selected File does not exist!");
|
||||
} else {
|
||||
$data = $this->fileInfo;
|
||||
$data["id"] = $id;
|
||||
$data["cliplength"] = $stream->getDbLength();
|
||||
$data["cueout"] = $stream->getDbLength();
|
||||
$data["type"] = 1;
|
||||
|
||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||
if (isset($defaultFade)) {
|
||||
//fade is in format SS.uuuuuu
|
||||
$data["fadein"] = $defaultFade;
|
||||
$data["fadeout"] = $defaultFade;
|
||||
}
|
||||
|
||||
$files[] = $data;
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +227,7 @@ class Application_Model_Scheduler
|
|||
private function findEndTime($p_startDT, $p_duration)
|
||||
{
|
||||
$startEpoch = $p_startDT->format("U.u");
|
||||
$durationSeconds = Application_Model_Playlist::playlistTimeToSeconds($p_duration);
|
||||
$durationSeconds = Application_Common_DateHelper::playlistTimeToSeconds($p_duration);
|
||||
|
||||
//add two float numbers to 6 subsecond precision
|
||||
//DateTime::createFromFormat("U.u") will have a problem if there is no decimal in the resulting number.
|
||||
|
@ -356,17 +378,27 @@ class Application_Model_Scheduler
|
|||
} else {
|
||||
$sched = new CcSchedule();
|
||||
}
|
||||
Logging::log(print_r($file,true));
|
||||
Logging::log($file);
|
||||
$sched->setDbStarts($nextStartDT)
|
||||
->setDbEnds($endTimeDT)
|
||||
->setDbFileId($file['id'])
|
||||
->setDbCueIn($file['cuein'])
|
||||
->setDbCueOut($file['cueout'])
|
||||
->setDbFadeIn($file['fadein'])
|
||||
->setDbFadeOut($file['fadeout'])
|
||||
->setDbClipLength($file['cliplength'])
|
||||
->setDbInstanceId($instance->getDbId())
|
||||
->save($this->con);
|
||||
->setDbInstanceId($instance->getDbId());
|
||||
|
||||
switch ($file["type"]){
|
||||
case 0:
|
||||
$sched->setDbFileId($file['id']);
|
||||
break;
|
||||
case 1:
|
||||
$sched->setDbStreamId($file['id']);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
$sched->save($this->con);
|
||||
|
||||
$nextStartDT = $endTimeDT;
|
||||
}
|
||||
|
@ -576,7 +608,7 @@ class Application_Model_Scheduler
|
|||
$length = bcsub($nEpoch , $sEpoch , 6);
|
||||
$cliplength = Application_Common_DateHelper::secondsToPlaylistTime($length);
|
||||
|
||||
$cueinSec = Application_Model_Playlist::playlistTimeToSeconds($removedItem->getDbCueIn());
|
||||
$cueinSec = Application_Common_DateHelper::playlistTimeToSeconds($removedItem->getDbCueIn());
|
||||
$cueOutSec = bcadd($cueinSec , $length, 6);
|
||||
$cueout = Application_Common_DateHelper::secondsToPlaylistTime($cueOutSec);
|
||||
|
||||
|
|
|
@ -603,7 +603,7 @@ class Application_Model_ShowInstance
|
|||
{
|
||||
$time_filled = $this->getTimeScheduled();
|
||||
|
||||
return Application_Model_Playlist::playlistTimeToSeconds($time_filled);
|
||||
return Application_Common_DateHelper::playlistTimeToSeconds($time_filled);
|
||||
}
|
||||
|
||||
public function getDurationSecs()
|
||||
|
|
|
@ -60,11 +60,6 @@ class Application_Model_StoredFile
|
|||
return $this->_file->getDbId();
|
||||
}
|
||||
|
||||
public function getGunId()
|
||||
{
|
||||
return $this->_file->getDbGunid();
|
||||
}
|
||||
|
||||
public function getFormat()
|
||||
{
|
||||
return $this->_file->getDbFtype();
|
||||
|
@ -280,31 +275,6 @@ class Application_Model_StoredFile
|
|||
return $md;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set state of virtual file
|
||||
*
|
||||
* @param string $p_state
|
||||
* 'empty'|'incomplete'|'ready'|'edited'
|
||||
* @param int $p_editedby
|
||||
* user id | 'NULL' for clear editedBy field
|
||||
* @return TRUE
|
||||
*/
|
||||
public function setState($p_state, $p_editedby=NULL)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$escapedState = pg_escape_string($p_state);
|
||||
$eb = (!is_null($p_editedby) ? ", editedBy=$p_editedby" : '');
|
||||
$sql = "UPDATE ".$CC_CONFIG['filesTable']
|
||||
." SET state='$escapedState'$eb, mtime=now()"
|
||||
." WHERE gunid='{$this->gunid}'";
|
||||
$res = $con->exec($sql);
|
||||
$this->state = $p_state;
|
||||
$this->editedby = $p_editedby;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of playlist objects that this file is a part of.
|
||||
* @return array
|
||||
|
@ -466,9 +436,7 @@ class Application_Model_StoredFile
|
|||
|
||||
private function constructGetFileUrl($p_serverName, $p_serverPort)
|
||||
{
|
||||
Logging::log("getting media! - 2");
|
||||
|
||||
return "http://$p_serverName:$p_serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
|
||||
return "http://$p_serverName:$p_serverPort/api/get-media/file/".$this->getId().".".$this->getFileExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -479,13 +447,12 @@ Logging::log("getting media! - 2");
|
|||
{
|
||||
Logging::log("getting media!");
|
||||
|
||||
return $baseUrl."/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
|
||||
return $baseUrl."/api/get-media/file/".$this->getId().".".$this->getFileExtension();
|
||||
}
|
||||
|
||||
public static function Insert($md=null)
|
||||
{
|
||||
$file = new CcFiles();
|
||||
$file->setDbGunid(md5(uniqid("", true)));
|
||||
$file->setDbUtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||
$file->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||
|
||||
|
@ -517,7 +484,7 @@ Logging::log("getting media! - 2");
|
|||
*
|
||||
* @param int $p_id
|
||||
* local id
|
||||
* @param string $p_gunid
|
||||
* @param string $p_gunid - TODO: Remove this!
|
||||
* global unique id of file
|
||||
* @param string $p_md5sum
|
||||
* MD5 sum of the file
|
||||
|
@ -530,10 +497,6 @@ Logging::log("getting media! - 2");
|
|||
{
|
||||
if (isset($p_id)) {
|
||||
$file = CcFilesQuery::create()->findPK(intval($p_id));
|
||||
} elseif (isset($p_gunid)) {
|
||||
$file = CcFilesQuery::create()
|
||||
->filterByDbGunid($p_gunid)
|
||||
->findOne();
|
||||
} elseif (isset($p_md5sum)) {
|
||||
if ($exist) {
|
||||
$file = CcFilesQuery::create()
|
||||
|
@ -578,20 +541,6 @@ Logging::log("getting media! - 2");
|
|||
return $info['filename'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create instance of StoreFile object and recall existing file
|
||||
* by gunid.
|
||||
*
|
||||
* @param string $p_gunid
|
||||
* global unique id of file
|
||||
* @return Application_Model_StoredFile|NULL
|
||||
*/
|
||||
public static function RecallByGunid($p_gunid)
|
||||
{
|
||||
return Application_Model_StoredFile::Recall(null, $p_gunid);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch the Application_Model_StoredFile by looking up the MD5 value.
|
||||
*
|
||||
|
@ -644,64 +593,75 @@ Logging::log("getting media! - 2");
|
|||
$displayColumns = array("id", "track_title", "artist_name", "album_title", "genre", "length",
|
||||
"year", "utime", "mtime", "ftype", "track_number", "mood", "bpm", "composer", "info_url",
|
||||
"bit_rate", "sample_rate", "isrc_number", "encoded_by", "label", "copyright", "mime",
|
||||
"language", "gunid", "filepath"
|
||||
"language", "filepath"
|
||||
);
|
||||
|
||||
$plSelect = array();
|
||||
$blSelect = array();
|
||||
$fileSelect = array();
|
||||
$streamSelect = array();
|
||||
foreach ($displayColumns as $key) {
|
||||
|
||||
if ($key === "id") {
|
||||
$plSelect[] = "PL.id AS ".$key;
|
||||
$blSelect[] = "BL.id AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = $key;
|
||||
} elseif ($key === "track_title") {
|
||||
$plSelect[] = "name AS ".$key;
|
||||
$blSelect[] = "name AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "name AS ".$key;
|
||||
} elseif ($key === "ftype") {
|
||||
$plSelect[] = "'playlist'::varchar AS ".$key;
|
||||
$blSelect[] = "'block'::varchar AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "'stream'::varchar AS ".$key;
|
||||
} elseif ($key === "artist_name") {
|
||||
$plSelect[] = "login AS ".$key;
|
||||
$blSelect[] = "login AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$plSelect[] = "login AS ".$key;
|
||||
$streamSelect[] = "login AS ".$key;
|
||||
}
|
||||
//same columns in each table.
|
||||
else if (in_array($key, array("length", "utime", "mtime"))) {
|
||||
$plSelect[] = $key;
|
||||
$blSelect[] = $key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = $key;
|
||||
} elseif ($key === "year") {
|
||||
|
||||
$plSelect[] = "EXTRACT(YEAR FROM utime)::varchar AS ".$key;
|
||||
$blSelect[] = "EXTRACT(YEAR FROM utime)::varchar AS ".$key;
|
||||
$fileSelect[] = "year AS ".$key;
|
||||
$streamSelect[] = "EXTRACT(YEAR FROM utime)::varchar AS ".$key;
|
||||
}
|
||||
//need to cast certain data as ints for the union to search on.
|
||||
else if (in_array($key, array("track_number", "bit_rate", "sample_rate"))) {
|
||||
$plSelect[] = "NULL::int AS ".$key;
|
||||
$blSelect[] = "NULL::int AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "NULL::int AS ".$key;
|
||||
} else {
|
||||
$plSelect[] = "NULL::text AS ".$key;
|
||||
$blSelect[] = "NULL::text AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "NULL::text AS ".$key;
|
||||
}
|
||||
}
|
||||
|
||||
$plSelect = "SELECT ". join(",", $plSelect);
|
||||
$blSelect = "SELECT ". join(",", $blSelect);
|
||||
$fileSelect = "SELECT ". join(",", $fileSelect);
|
||||
$streamSelect = "SELECT ". join(",", $streamSelect);
|
||||
|
||||
$type = intval($datatables["type"]);
|
||||
|
||||
$plTable = "({$plSelect} FROM cc_playlist AS PL LEFT JOIN cc_subjs AS sub ON (sub.id = PL.creator_id))";
|
||||
$blTable = "({$blSelect} FROM cc_block AS BL LEFT JOIN cc_subjs AS sub ON (sub.id = BL.creator_id))";
|
||||
$fileTable = "({$fileSelect} FROM cc_files AS FILES WHERE file_exists = 'TRUE')";
|
||||
$unionTable = "({$plTable} UNION {$blTable} UNION {$fileTable} ) AS RESULTS";
|
||||
$streamTable = "({$streamSelect} FROM cc_webstream AS WEBSTREAM)";
|
||||
$unionTable = "({$plTable} UNION {$blTable} UNION {$fileTable} UNION {$streamTable}) AS RESULTS";
|
||||
|
||||
//choose which table we need to select data from.
|
||||
switch ($type) {
|
||||
|
@ -757,8 +717,10 @@ Logging::log("getting media! - 2");
|
|||
//datatable stuff really needs to be pulled out and generalized within the project
|
||||
//access to zend view methods to access url helpers is needed.
|
||||
|
||||
if ($type == "au") {//&& isset( $audioResults )) {
|
||||
$row['audioFile'] = $row['gunid'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
if ($type == "au") {
|
||||
//TODO:
|
||||
Logging::log("row id: ".$row['id']);
|
||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
$row['image'] = '<img title="Track preview" src="/css/images/icon_audioclip.png">';
|
||||
} else {
|
||||
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
class Application_Model_Webstream{
|
||||
|
||||
public static function getName()
|
||||
{
|
||||
return "Default";
|
||||
}
|
||||
|
||||
public static function getId()
|
||||
{
|
||||
return "id";
|
||||
}
|
||||
|
||||
public static function getLastModified($p_type)
|
||||
{
|
||||
return "modified";
|
||||
}
|
||||
|
||||
public static function getDefaultLength()
|
||||
{
|
||||
return "length";
|
||||
}
|
||||
|
||||
public static function getDescription()
|
||||
{
|
||||
return "desc";
|
||||
}
|
||||
|
||||
public static function save($request)
|
||||
{
|
||||
Logging::log($request->getParams());
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
Logging::log($userInfo);
|
||||
|
||||
$length = trim($request->getParam("length"));
|
||||
preg_match("/^([0-9]{1,2})h ([0-5][0-9])m$/", $length, $matches);
|
||||
$hours = $matches[1];
|
||||
$minutes = $matches[2];
|
||||
$di = new DateInterval("PT{$hours}H{$minutes}M");
|
||||
$dblength = $di->format("%H:%I");
|
||||
|
||||
#TODO: These should be validated by a Zend Form.
|
||||
$webstream = new CcWebstream();
|
||||
$webstream->setDbName($request->getParam("name"));
|
||||
$webstream->setDbDescription($request->getParam("description"));
|
||||
$webstream->setDbUrl($request->getParam("url"));
|
||||
|
||||
$webstream->setDbLength($dblength);
|
||||
$webstream->setDbLogin($userInfo->id);
|
||||
$webstream->setDbUtime(new DateTime($timezone = new DateTimeZone('UTC')));
|
||||
$webstream->setDbMtime(new DateTime($timezone = new DateTimeZone('UTC')));
|
||||
$webstream->save();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_webstream' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcWebstream extends BaseCcWebstream {
|
||||
|
||||
} // CcWebstream
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_webstream' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcWebstreamPeer extends BaseCcWebstreamPeer {
|
||||
|
||||
} // CcWebstreamPeer
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_webstream' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcWebstreamQuery extends BaseCcWebstreamQuery {
|
||||
|
||||
} // CcWebstreamQuery
|
|
@ -39,7 +39,6 @@ class CcFilesTableMap extends TableMap {
|
|||
$this->setPrimaryKeyMethodInfo('cc_files_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('GUNID', 'DbGunid', 'CHAR', true, 32, null);
|
||||
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||
$this->addColumn('MIME', 'DbMime', 'VARCHAR', true, 255, '');
|
||||
$this->addColumn('FTYPE', 'DbFtype', 'VARCHAR', true, 128, '');
|
||||
|
|
|
@ -42,6 +42,7 @@ class CcScheduleTableMap extends TableMap {
|
|||
$this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null);
|
||||
$this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null);
|
||||
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||
$this->addForeignKey('STREAM_ID', 'DbStreamId', 'INTEGER', 'cc_webstream', 'ID', false, null, null);
|
||||
$this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('FADE_IN', 'DbFadeIn', 'TIME', false, null, '00:00:00');
|
||||
$this->addColumn('FADE_OUT', 'DbFadeOut', 'TIME', false, null, '00:00:00');
|
||||
|
@ -61,6 +62,7 @@ class CcScheduleTableMap extends TableMap {
|
|||
{
|
||||
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcWebstream', 'CcWebstream', RelationMap::MANY_TO_ONE, array('stream_id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
} // CcScheduleTableMap
|
||||
|
|
|
@ -59,7 +59,6 @@ class CcSubjsTableMap extends TableMap {
|
|||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcAccess', 'CcAccess', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), 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('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_webstream' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcWebstreamTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcWebstreamTableMap';
|
||||
|
||||
/**
|
||||
* Initialize the table attributes, columns and validators
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('cc_webstream');
|
||||
$this->setPhpName('CcWebstream');
|
||||
$this->setClassname('CcWebstream');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_webstream_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('URL', 'DbUrl', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('LENGTH', 'DbLength', 'VARCHAR', true, null, '00:00:00');
|
||||
$this->addColumn('LOGIN', 'DbLogin', 'VARCHAR', true, 255, null);
|
||||
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', true, 6, null);
|
||||
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', true, 6, null);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'stream_id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
} // CcWebstreamTableMap
|
File diff suppressed because it is too large
Load Diff
|
@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
|
|||
const TM_CLASS = 'CcFilesTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 64;
|
||||
const NUM_COLUMNS = 63;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -34,9 +34,6 @@ abstract class BaseCcFilesPeer {
|
|||
/** the column name for the ID field */
|
||||
const ID = 'cc_files.ID';
|
||||
|
||||
/** the column name for the GUNID field */
|
||||
const GUNID = 'cc_files.GUNID';
|
||||
|
||||
/** the column name for the NAME field */
|
||||
const NAME = 'cc_files.NAME';
|
||||
|
||||
|
@ -239,12 +236,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -254,12 +251,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbUtime' => 11, 'DbLPtime' => 12, 'DbMd5' => 13, 'DbTrackTitle' => 14, 'DbArtistName' => 15, 'DbBitRate' => 16, 'DbSampleRate' => 17, 'DbFormat' => 18, 'DbLength' => 19, 'DbAlbumTitle' => 20, 'DbGenre' => 21, 'DbComments' => 22, 'DbYear' => 23, 'DbTrackNumber' => 24, 'DbChannels' => 25, 'DbUrl' => 26, 'DbBpm' => 27, 'DbRating' => 28, 'DbEncodedBy' => 29, 'DbDiscNumber' => 30, 'DbMood' => 31, 'DbLabel' => 32, 'DbComposer' => 33, 'DbEncoder' => 34, 'DbChecksum' => 35, 'DbLyrics' => 36, 'DbOrchestra' => 37, 'DbConductor' => 38, 'DbLyricist' => 39, 'DbOriginalLyricist' => 40, 'DbRadioStationName' => 41, 'DbInfoUrl' => 42, 'DbArtistUrl' => 43, 'DbAudioSourceUrl' => 44, 'DbRadioStationUrl' => 45, 'DbBuyThisUrl' => 46, 'DbIsrcNumber' => 47, 'DbCatalogNumber' => 48, 'DbOriginalArtist' => 49, 'DbCopyright' => 50, 'DbReportDatetime' => 51, 'DbReportLocation' => 52, 'DbReportOrganization' => 53, 'DbSubject' => 54, 'DbContributor' => 55, 'DbLanguage' => 56, 'DbFileExists' => 57, 'DbSoundcloudId' => 58, 'DbSoundcloudErrorCode' => 59, 'DbSoundcloudErrorMsg' => 60, 'DbSoundcloudLinkToFile' => 61, 'DbSoundCloundUploadTime' => 62, 'DbReplayGain' => 63, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbUtime' => 11, 'dbLPtime' => 12, 'dbMd5' => 13, 'dbTrackTitle' => 14, 'dbArtistName' => 15, 'dbBitRate' => 16, 'dbSampleRate' => 17, 'dbFormat' => 18, 'dbLength' => 19, 'dbAlbumTitle' => 20, 'dbGenre' => 21, 'dbComments' => 22, 'dbYear' => 23, 'dbTrackNumber' => 24, 'dbChannels' => 25, 'dbUrl' => 26, 'dbBpm' => 27, 'dbRating' => 28, 'dbEncodedBy' => 29, 'dbDiscNumber' => 30, 'dbMood' => 31, 'dbLabel' => 32, 'dbComposer' => 33, 'dbEncoder' => 34, 'dbChecksum' => 35, 'dbLyrics' => 36, 'dbOrchestra' => 37, 'dbConductor' => 38, 'dbLyricist' => 39, 'dbOriginalLyricist' => 40, 'dbRadioStationName' => 41, 'dbInfoUrl' => 42, 'dbArtistUrl' => 43, 'dbAudioSourceUrl' => 44, 'dbRadioStationUrl' => 45, 'dbBuyThisUrl' => 46, 'dbIsrcNumber' => 47, 'dbCatalogNumber' => 48, 'dbOriginalArtist' => 49, 'dbCopyright' => 50, 'dbReportDatetime' => 51, 'dbReportLocation' => 52, 'dbReportOrganization' => 53, 'dbSubject' => 54, 'dbContributor' => 55, 'dbLanguage' => 56, 'dbFileExists' => 57, 'dbSoundcloudId' => 58, 'dbSoundcloudErrorCode' => 59, 'dbSoundcloudErrorMsg' => 60, 'dbSoundcloudLinkToFile' => 61, 'dbSoundCloundUploadTime' => 62, 'dbReplayGain' => 63, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::UTIME => 11, self::LPTIME => 12, self::MD5 => 13, self::TRACK_TITLE => 14, self::ARTIST_NAME => 15, self::BIT_RATE => 16, self::SAMPLE_RATE => 17, self::FORMAT => 18, self::LENGTH => 19, self::ALBUM_TITLE => 20, self::GENRE => 21, self::COMMENTS => 22, self::YEAR => 23, self::TRACK_NUMBER => 24, self::CHANNELS => 25, self::URL => 26, self::BPM => 27, self::RATING => 28, self::ENCODED_BY => 29, self::DISC_NUMBER => 30, self::MOOD => 31, self::LABEL => 32, self::COMPOSER => 33, self::ENCODER => 34, self::CHECKSUM => 35, self::LYRICS => 36, self::ORCHESTRA => 37, self::CONDUCTOR => 38, self::LYRICIST => 39, self::ORIGINAL_LYRICIST => 40, self::RADIO_STATION_NAME => 41, self::INFO_URL => 42, self::ARTIST_URL => 43, self::AUDIO_SOURCE_URL => 44, self::RADIO_STATION_URL => 45, self::BUY_THIS_URL => 46, self::ISRC_NUMBER => 47, self::CATALOG_NUMBER => 48, self::ORIGINAL_ARTIST => 49, self::COPYRIGHT => 50, self::REPORT_DATETIME => 51, self::REPORT_LOCATION => 52, self::REPORT_ORGANIZATION => 53, self::SUBJECT => 54, self::CONTRIBUTOR => 55, self::LANGUAGE => 56, self::FILE_EXISTS => 57, self::SOUNDCLOUD_ID => 58, self::SOUNDCLOUD_ERROR_CODE => 59, self::SOUNDCLOUD_ERROR_MSG => 60, self::SOUNDCLOUD_LINK_TO_FILE => 61, self::SOUNDCLOUD_UPLOAD_TIME => 62, self::REPLAY_GAIN => 63, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'UTIME' => 11, 'LPTIME' => 12, 'MD5' => 13, 'TRACK_TITLE' => 14, 'ARTIST_NAME' => 15, 'BIT_RATE' => 16, 'SAMPLE_RATE' => 17, 'FORMAT' => 18, 'LENGTH' => 19, 'ALBUM_TITLE' => 20, 'GENRE' => 21, 'COMMENTS' => 22, 'YEAR' => 23, 'TRACK_NUMBER' => 24, 'CHANNELS' => 25, 'URL' => 26, 'BPM' => 27, 'RATING' => 28, 'ENCODED_BY' => 29, 'DISC_NUMBER' => 30, 'MOOD' => 31, 'LABEL' => 32, 'COMPOSER' => 33, 'ENCODER' => 34, 'CHECKSUM' => 35, 'LYRICS' => 36, 'ORCHESTRA' => 37, 'CONDUCTOR' => 38, 'LYRICIST' => 39, 'ORIGINAL_LYRICIST' => 40, 'RADIO_STATION_NAME' => 41, 'INFO_URL' => 42, 'ARTIST_URL' => 43, 'AUDIO_SOURCE_URL' => 44, 'RADIO_STATION_URL' => 45, 'BUY_THIS_URL' => 46, 'ISRC_NUMBER' => 47, 'CATALOG_NUMBER' => 48, 'ORIGINAL_ARTIST' => 49, 'COPYRIGHT' => 50, 'REPORT_DATETIME' => 51, 'REPORT_LOCATION' => 52, 'REPORT_ORGANIZATION' => 53, 'SUBJECT' => 54, 'CONTRIBUTOR' => 55, 'LANGUAGE' => 56, 'FILE_EXISTS' => 57, 'SOUNDCLOUD_ID' => 58, 'SOUNDCLOUD_ERROR_CODE' => 59, 'SOUNDCLOUD_ERROR_MSG' => 60, 'SOUNDCLOUD_LINK_TO_FILE' => 61, 'SOUNDCLOUD_UPLOAD_TIME' => 62, 'REPLAY_GAIN' => 63, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'utime' => 11, 'lptime' => 12, 'md5' => 13, 'track_title' => 14, 'artist_name' => 15, 'bit_rate' => 16, 'sample_rate' => 17, 'format' => 18, 'length' => 19, 'album_title' => 20, 'genre' => 21, 'comments' => 22, 'year' => 23, 'track_number' => 24, 'channels' => 25, 'url' => 26, 'bpm' => 27, 'rating' => 28, 'encoded_by' => 29, 'disc_number' => 30, 'mood' => 31, 'label' => 32, 'composer' => 33, 'encoder' => 34, 'checksum' => 35, 'lyrics' => 36, 'orchestra' => 37, 'conductor' => 38, 'lyricist' => 39, 'original_lyricist' => 40, 'radio_station_name' => 41, 'info_url' => 42, 'artist_url' => 43, 'audio_source_url' => 44, 'radio_station_url' => 45, 'buy_this_url' => 46, 'isrc_number' => 47, 'catalog_number' => 48, 'original_artist' => 49, 'copyright' => 50, 'report_datetime' => 51, 'report_location' => 52, 'report_organization' => 53, 'subject' => 54, 'contributor' => 55, 'language' => 56, 'file_exists' => 57, 'soundcloud_id' => 58, 'soundcloud_error_code' => 59, 'soundcloud_error_msg' => 60, 'soundcloud_link_to_file' => 61, 'soundcloud_upload_time' => 62, 'replay_gain' => 63, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -332,7 +329,6 @@ abstract class BaseCcFilesPeer {
|
|||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CcFilesPeer::ID);
|
||||
$criteria->addSelectColumn(CcFilesPeer::GUNID);
|
||||
$criteria->addSelectColumn(CcFilesPeer::NAME);
|
||||
$criteria->addSelectColumn(CcFilesPeer::MIME);
|
||||
$criteria->addSelectColumn(CcFilesPeer::FTYPE);
|
||||
|
@ -397,7 +393,6 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn(CcFilesPeer::REPLAY_GAIN);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.GUNID');
|
||||
$criteria->addSelectColumn($alias . '.NAME');
|
||||
$criteria->addSelectColumn($alias . '.MIME');
|
||||
$criteria->addSelectColumn($alias . '.FTYPE');
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
*
|
||||
*
|
||||
* @method CcFilesQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcFilesQuery orderByDbGunid($order = Criteria::ASC) Order by the gunid column
|
||||
* @method CcFilesQuery orderByDbName($order = Criteria::ASC) Order by the name column
|
||||
* @method CcFilesQuery orderByDbMime($order = Criteria::ASC) Order by the mime column
|
||||
* @method CcFilesQuery orderByDbFtype($order = Criteria::ASC) Order by the ftype column
|
||||
|
@ -72,7 +71,6 @@
|
|||
* @method CcFilesQuery orderByDbReplayGain($order = Criteria::ASC) Order by the replay_gain column
|
||||
*
|
||||
* @method CcFilesQuery groupByDbId() Group by the id column
|
||||
* @method CcFilesQuery groupByDbGunid() Group by the gunid column
|
||||
* @method CcFilesQuery groupByDbName() Group by the name column
|
||||
* @method CcFilesQuery groupByDbMime() Group by the mime column
|
||||
* @method CcFilesQuery groupByDbFtype() Group by the ftype column
|
||||
|
@ -168,7 +166,6 @@
|
|||
* @method CcFiles findOneOrCreate(PropelPDO $con = null) Return the first CcFiles matching the query, or a new CcFiles object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcFiles findOneByDbId(int $id) Return the first CcFiles filtered by the id column
|
||||
* @method CcFiles findOneByDbGunid(string $gunid) Return the first CcFiles filtered by the gunid column
|
||||
* @method CcFiles findOneByDbName(string $name) Return the first CcFiles filtered by the name column
|
||||
* @method CcFiles findOneByDbMime(string $mime) Return the first CcFiles filtered by the mime column
|
||||
* @method CcFiles findOneByDbFtype(string $ftype) Return the first CcFiles filtered by the ftype column
|
||||
|
@ -233,7 +230,6 @@
|
|||
* @method CcFiles findOneByDbReplayGain(string $replay_gain) Return the first CcFiles filtered by the replay_gain column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
|
||||
* @method array findByDbGunid(string $gunid) Return CcFiles objects filtered by the gunid column
|
||||
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
|
||||
* @method array findByDbMime(string $mime) Return CcFiles objects filtered by the mime column
|
||||
* @method array findByDbFtype(string $ftype) Return CcFiles objects filtered by the ftype column
|
||||
|
@ -422,28 +418,6 @@ abstract class BaseCcFilesQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcFilesPeer::ID, $dbId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the gunid column
|
||||
*
|
||||
* @param string $dbGunid 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 CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbGunid($dbGunid = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbGunid)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbGunid)) {
|
||||
$dbGunid = str_replace('*', '%', $dbGunid);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::GUNID, $dbGunid, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the name column
|
||||
*
|
||||
|
|
|
@ -48,6 +48,12 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $file_id;
|
||||
|
||||
/**
|
||||
* The value for the stream_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $stream_id;
|
||||
|
||||
/**
|
||||
* The value for the clip_length field.
|
||||
* Note: this column has a database default value of: '00:00:00'
|
||||
|
@ -120,6 +126,11 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $aCcFiles;
|
||||
|
||||
/**
|
||||
* @var CcWebstream
|
||||
*/
|
||||
protected $aCcWebstream;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
|
@ -248,6 +259,16 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
return $this->file_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [stream_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDbStreamId()
|
||||
{
|
||||
return $this->stream_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [clip_length] column value.
|
||||
*
|
||||
|
@ -526,6 +547,30 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbFileId()
|
||||
|
||||
/**
|
||||
* Set the value of [stream_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return CcSchedule The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbStreamId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->stream_id !== $v) {
|
||||
$this->stream_id = $v;
|
||||
$this->modifiedColumns[] = CcSchedulePeer::STREAM_ID;
|
||||
}
|
||||
|
||||
if ($this->aCcWebstream !== null && $this->aCcWebstream->getDbId() !== $v) {
|
||||
$this->aCcWebstream = null;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbStreamId()
|
||||
|
||||
/**
|
||||
* Set the value of [clip_length] column.
|
||||
*
|
||||
|
@ -838,15 +883,16 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$this->starts = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
||||
$this->ends = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
|
||||
$this->file_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
|
||||
$this->clip_length = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
|
||||
$this->fade_in = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
||||
$this->fade_out = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||
$this->cue_in = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||
$this->cue_out = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
||||
$this->media_item_played = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null;
|
||||
$this->instance_id = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null;
|
||||
$this->playout_status = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
|
||||
$this->broadcasted = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
|
||||
$this->stream_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
|
||||
$this->clip_length = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
||||
$this->fade_in = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||
$this->fade_out = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||
$this->cue_in = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
||||
$this->cue_out = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
|
||||
$this->media_item_played = ($row[$startcol + 10] !== null) ? (boolean) $row[$startcol + 10] : null;
|
||||
$this->instance_id = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
|
||||
$this->playout_status = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
|
||||
$this->broadcasted = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -855,7 +901,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 13; // 13 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 14; // 14 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcSchedule object", $e);
|
||||
|
@ -881,6 +927,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) {
|
||||
$this->aCcFiles = null;
|
||||
}
|
||||
if ($this->aCcWebstream !== null && $this->stream_id !== $this->aCcWebstream->getDbId()) {
|
||||
$this->aCcWebstream = null;
|
||||
}
|
||||
if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) {
|
||||
$this->aCcShowInstances = null;
|
||||
}
|
||||
|
@ -925,6 +974,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
|
||||
$this->aCcShowInstances = null;
|
||||
$this->aCcFiles = null;
|
||||
$this->aCcWebstream = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
|
@ -1054,6 +1104,13 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$this->setCcFiles($this->aCcFiles);
|
||||
}
|
||||
|
||||
if ($this->aCcWebstream !== null) {
|
||||
if ($this->aCcWebstream->isModified() || $this->aCcWebstream->isNew()) {
|
||||
$affectedRows += $this->aCcWebstream->save($con);
|
||||
}
|
||||
$this->setCcWebstream($this->aCcWebstream);
|
||||
}
|
||||
|
||||
if ($this->isNew() ) {
|
||||
$this->modifiedColumns[] = CcSchedulePeer::ID;
|
||||
}
|
||||
|
@ -1160,6 +1217,12 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->aCcWebstream !== null) {
|
||||
if (!$this->aCcWebstream->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $this->aCcWebstream->getValidationFailures());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (($retval = CcSchedulePeer::doValidate($this, $columns)) !== true) {
|
||||
$failureMap = array_merge($failureMap, $retval);
|
||||
|
@ -1212,30 +1275,33 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
return $this->getDbFileId();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getDbClipLength();
|
||||
return $this->getDbStreamId();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getDbFadeIn();
|
||||
return $this->getDbClipLength();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getDbFadeOut();
|
||||
return $this->getDbFadeIn();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getDbCueIn();
|
||||
return $this->getDbFadeOut();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getDbCueOut();
|
||||
return $this->getDbCueIn();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getDbMediaItemPlayed();
|
||||
return $this->getDbCueOut();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getDbInstanceId();
|
||||
return $this->getDbMediaItemPlayed();
|
||||
break;
|
||||
case 11:
|
||||
return $this->getDbPlayoutStatus();
|
||||
return $this->getDbInstanceId();
|
||||
break;
|
||||
case 12:
|
||||
return $this->getDbPlayoutStatus();
|
||||
break;
|
||||
case 13:
|
||||
return $this->getDbBroadcasted();
|
||||
break;
|
||||
default:
|
||||
|
@ -1266,15 +1332,16 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$keys[1] => $this->getDbStarts(),
|
||||
$keys[2] => $this->getDbEnds(),
|
||||
$keys[3] => $this->getDbFileId(),
|
||||
$keys[4] => $this->getDbClipLength(),
|
||||
$keys[5] => $this->getDbFadeIn(),
|
||||
$keys[6] => $this->getDbFadeOut(),
|
||||
$keys[7] => $this->getDbCueIn(),
|
||||
$keys[8] => $this->getDbCueOut(),
|
||||
$keys[9] => $this->getDbMediaItemPlayed(),
|
||||
$keys[10] => $this->getDbInstanceId(),
|
||||
$keys[11] => $this->getDbPlayoutStatus(),
|
||||
$keys[12] => $this->getDbBroadcasted(),
|
||||
$keys[4] => $this->getDbStreamId(),
|
||||
$keys[5] => $this->getDbClipLength(),
|
||||
$keys[6] => $this->getDbFadeIn(),
|
||||
$keys[7] => $this->getDbFadeOut(),
|
||||
$keys[8] => $this->getDbCueIn(),
|
||||
$keys[9] => $this->getDbCueOut(),
|
||||
$keys[10] => $this->getDbMediaItemPlayed(),
|
||||
$keys[11] => $this->getDbInstanceId(),
|
||||
$keys[12] => $this->getDbPlayoutStatus(),
|
||||
$keys[13] => $this->getDbBroadcasted(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aCcShowInstances) {
|
||||
|
@ -1283,6 +1350,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
if (null !== $this->aCcFiles) {
|
||||
$result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true);
|
||||
}
|
||||
if (null !== $this->aCcWebstream) {
|
||||
$result['CcWebstream'] = $this->aCcWebstream->toArray($keyType, $includeLazyLoadColumns, true);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
@ -1327,30 +1397,33 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$this->setDbFileId($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setDbClipLength($value);
|
||||
$this->setDbStreamId($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setDbFadeIn($value);
|
||||
$this->setDbClipLength($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setDbFadeOut($value);
|
||||
$this->setDbFadeIn($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setDbCueIn($value);
|
||||
$this->setDbFadeOut($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setDbCueOut($value);
|
||||
$this->setDbCueIn($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setDbMediaItemPlayed($value);
|
||||
$this->setDbCueOut($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setDbInstanceId($value);
|
||||
$this->setDbMediaItemPlayed($value);
|
||||
break;
|
||||
case 11:
|
||||
$this->setDbPlayoutStatus($value);
|
||||
$this->setDbInstanceId($value);
|
||||
break;
|
||||
case 12:
|
||||
$this->setDbPlayoutStatus($value);
|
||||
break;
|
||||
case 13:
|
||||
$this->setDbBroadcasted($value);
|
||||
break;
|
||||
} // switch()
|
||||
|
@ -1381,15 +1454,16 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[1], $arr)) $this->setDbStarts($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setDbEnds($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setDbFileId($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDbClipLength($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDbFadeIn($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbFadeOut($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->setDbMediaItemPlayed($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setDbInstanceId($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setDbPlayoutStatus($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setDbBroadcasted($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDbStreamId($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDbClipLength($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbFadeIn($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setDbFadeOut($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setDbCueIn($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setDbCueOut($arr[$keys[9]]);
|
||||
if (array_key_exists($keys[10], $arr)) $this->setDbMediaItemPlayed($arr[$keys[10]]);
|
||||
if (array_key_exists($keys[11], $arr)) $this->setDbInstanceId($arr[$keys[11]]);
|
||||
if (array_key_exists($keys[12], $arr)) $this->setDbPlayoutStatus($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setDbBroadcasted($arr[$keys[13]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1405,6 +1479,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcSchedulePeer::STARTS)) $criteria->add(CcSchedulePeer::STARTS, $this->starts);
|
||||
if ($this->isColumnModified(CcSchedulePeer::ENDS)) $criteria->add(CcSchedulePeer::ENDS, $this->ends);
|
||||
if ($this->isColumnModified(CcSchedulePeer::FILE_ID)) $criteria->add(CcSchedulePeer::FILE_ID, $this->file_id);
|
||||
if ($this->isColumnModified(CcSchedulePeer::STREAM_ID)) $criteria->add(CcSchedulePeer::STREAM_ID, $this->stream_id);
|
||||
if ($this->isColumnModified(CcSchedulePeer::CLIP_LENGTH)) $criteria->add(CcSchedulePeer::CLIP_LENGTH, $this->clip_length);
|
||||
if ($this->isColumnModified(CcSchedulePeer::FADE_IN)) $criteria->add(CcSchedulePeer::FADE_IN, $this->fade_in);
|
||||
if ($this->isColumnModified(CcSchedulePeer::FADE_OUT)) $criteria->add(CcSchedulePeer::FADE_OUT, $this->fade_out);
|
||||
|
@ -1478,6 +1553,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$copyObj->setDbStarts($this->starts);
|
||||
$copyObj->setDbEnds($this->ends);
|
||||
$copyObj->setDbFileId($this->file_id);
|
||||
$copyObj->setDbStreamId($this->stream_id);
|
||||
$copyObj->setDbClipLength($this->clip_length);
|
||||
$copyObj->setDbFadeIn($this->fade_in);
|
||||
$copyObj->setDbFadeOut($this->fade_out);
|
||||
|
@ -1628,6 +1704,55 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
return $this->aCcFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a CcWebstream object.
|
||||
*
|
||||
* @param CcWebstream $v
|
||||
* @return CcSchedule The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setCcWebstream(CcWebstream $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setDbStreamId(NULL);
|
||||
} else {
|
||||
$this->setDbStreamId($v->getDbId());
|
||||
}
|
||||
|
||||
$this->aCcWebstream = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the CcWebstream object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addCcSchedule($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated CcWebstream object
|
||||
*
|
||||
* @param PropelPDO Optional Connection object.
|
||||
* @return CcWebstream The associated CcWebstream object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCcWebstream(PropelPDO $con = null)
|
||||
{
|
||||
if ($this->aCcWebstream === null && ($this->stream_id !== null)) {
|
||||
$this->aCcWebstream = CcWebstreamQuery::create()->findPk($this->stream_id, $con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aCcWebstream->addCcSchedules($this);
|
||||
*/
|
||||
}
|
||||
return $this->aCcWebstream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current object and sets all attributes to their default values
|
||||
*/
|
||||
|
@ -1637,6 +1762,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
$this->starts = null;
|
||||
$this->ends = null;
|
||||
$this->file_id = null;
|
||||
$this->stream_id = null;
|
||||
$this->clip_length = null;
|
||||
$this->fade_in = null;
|
||||
$this->fade_out = null;
|
||||
|
@ -1671,6 +1797,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
|
|||
|
||||
$this->aCcShowInstances = null;
|
||||
$this->aCcFiles = null;
|
||||
$this->aCcWebstream = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcSchedulePeer {
|
|||
const TM_CLASS = 'CcScheduleTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 13;
|
||||
const NUM_COLUMNS = 14;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -43,6 +43,9 @@ abstract class BaseCcSchedulePeer {
|
|||
/** the column name for the FILE_ID field */
|
||||
const FILE_ID = 'cc_schedule.FILE_ID';
|
||||
|
||||
/** the column name for the STREAM_ID field */
|
||||
const STREAM_ID = 'cc_schedule.STREAM_ID';
|
||||
|
||||
/** the column name for the CLIP_LENGTH field */
|
||||
const CLIP_LENGTH = 'cc_schedule.CLIP_LENGTH';
|
||||
|
||||
|
@ -86,12 +89,12 @@ abstract class BaseCcSchedulePeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbFileId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbMediaItemPlayed', 'DbInstanceId', 'DbPlayoutStatus', 'DbBroadcasted', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbFileId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbMediaItemPlayed', 'dbInstanceId', 'dbPlayoutStatus', 'dbBroadcasted', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::FILE_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, self::PLAYOUT_STATUS, self::BROADCASTED, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'FILE_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', 'PLAYOUT_STATUS', 'BROADCASTED', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'file_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'media_item_played', 'instance_id', 'playout_status', 'broadcasted', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbFileId', 'DbStreamId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbMediaItemPlayed', 'DbInstanceId', 'DbPlayoutStatus', 'DbBroadcasted', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbFileId', 'dbStreamId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbMediaItemPlayed', 'dbInstanceId', 'dbPlayoutStatus', 'dbBroadcasted', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::FILE_ID, self::STREAM_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, self::PLAYOUT_STATUS, self::BROADCASTED, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'FILE_ID', 'STREAM_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', 'PLAYOUT_STATUS', 'BROADCASTED', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'file_id', 'stream_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'media_item_played', 'instance_id', 'playout_status', 'broadcasted', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -101,12 +104,12 @@ abstract class BaseCcSchedulePeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbFileId' => 3, 'DbClipLength' => 4, 'DbFadeIn' => 5, 'DbFadeOut' => 6, 'DbCueIn' => 7, 'DbCueOut' => 8, 'DbMediaItemPlayed' => 9, 'DbInstanceId' => 10, 'DbPlayoutStatus' => 11, 'DbBroadcasted' => 12, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbFileId' => 3, 'dbClipLength' => 4, 'dbFadeIn' => 5, 'dbFadeOut' => 6, 'dbCueIn' => 7, 'dbCueOut' => 8, 'dbMediaItemPlayed' => 9, 'dbInstanceId' => 10, 'dbPlayoutStatus' => 11, 'dbBroadcasted' => 12, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::FILE_ID => 3, self::CLIP_LENGTH => 4, self::FADE_IN => 5, self::FADE_OUT => 6, self::CUE_IN => 7, self::CUE_OUT => 8, self::MEDIA_ITEM_PLAYED => 9, self::INSTANCE_ID => 10, self::PLAYOUT_STATUS => 11, self::BROADCASTED => 12, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'FILE_ID' => 3, 'CLIP_LENGTH' => 4, 'FADE_IN' => 5, 'FADE_OUT' => 6, 'CUE_IN' => 7, 'CUE_OUT' => 8, 'MEDIA_ITEM_PLAYED' => 9, 'INSTANCE_ID' => 10, 'PLAYOUT_STATUS' => 11, 'BROADCASTED' => 12, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'file_id' => 3, 'clip_length' => 4, 'fade_in' => 5, 'fade_out' => 6, 'cue_in' => 7, 'cue_out' => 8, 'media_item_played' => 9, 'instance_id' => 10, 'playout_status' => 11, 'broadcasted' => 12, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbClipLength' => 5, 'DbFadeIn' => 6, 'DbFadeOut' => 7, 'DbCueIn' => 8, 'DbCueOut' => 9, 'DbMediaItemPlayed' => 10, 'DbInstanceId' => 11, 'DbPlayoutStatus' => 12, 'DbBroadcasted' => 13, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbClipLength' => 5, 'dbFadeIn' => 6, 'dbFadeOut' => 7, 'dbCueIn' => 8, 'dbCueOut' => 9, 'dbMediaItemPlayed' => 10, 'dbInstanceId' => 11, 'dbPlayoutStatus' => 12, 'dbBroadcasted' => 13, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::CLIP_LENGTH => 5, self::FADE_IN => 6, self::FADE_OUT => 7, self::CUE_IN => 8, self::CUE_OUT => 9, self::MEDIA_ITEM_PLAYED => 10, self::INSTANCE_ID => 11, self::PLAYOUT_STATUS => 12, self::BROADCASTED => 13, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'CLIP_LENGTH' => 5, 'FADE_IN' => 6, 'FADE_OUT' => 7, 'CUE_IN' => 8, 'CUE_OUT' => 9, 'MEDIA_ITEM_PLAYED' => 10, 'INSTANCE_ID' => 11, 'PLAYOUT_STATUS' => 12, 'BROADCASTED' => 13, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'file_id' => 3, 'stream_id' => 4, 'clip_length' => 5, 'fade_in' => 6, 'fade_out' => 7, 'cue_in' => 8, 'cue_out' => 9, 'media_item_played' => 10, 'instance_id' => 11, 'playout_status' => 12, 'broadcasted' => 13, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -182,6 +185,7 @@ abstract class BaseCcSchedulePeer {
|
|||
$criteria->addSelectColumn(CcSchedulePeer::STARTS);
|
||||
$criteria->addSelectColumn(CcSchedulePeer::ENDS);
|
||||
$criteria->addSelectColumn(CcSchedulePeer::FILE_ID);
|
||||
$criteria->addSelectColumn(CcSchedulePeer::STREAM_ID);
|
||||
$criteria->addSelectColumn(CcSchedulePeer::CLIP_LENGTH);
|
||||
$criteria->addSelectColumn(CcSchedulePeer::FADE_IN);
|
||||
$criteria->addSelectColumn(CcSchedulePeer::FADE_OUT);
|
||||
|
@ -196,6 +200,7 @@ abstract class BaseCcSchedulePeer {
|
|||
$criteria->addSelectColumn($alias . '.STARTS');
|
||||
$criteria->addSelectColumn($alias . '.ENDS');
|
||||
$criteria->addSelectColumn($alias . '.FILE_ID');
|
||||
$criteria->addSelectColumn($alias . '.STREAM_ID');
|
||||
$criteria->addSelectColumn($alias . '.CLIP_LENGTH');
|
||||
$criteria->addSelectColumn($alias . '.FADE_IN');
|
||||
$criteria->addSelectColumn($alias . '.FADE_OUT');
|
||||
|
@ -590,6 +595,56 @@ abstract class BaseCcSchedulePeer {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related CcWebstream table
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
|
||||
* @param PropelPDO $con
|
||||
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinCcWebstream(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// We need to set the primary table name, since in the case that there are no WHERE columns
|
||||
// it will be impossible for the BasePeer::createSelectSql() method to determine which
|
||||
// tables go into the FROM clause.
|
||||
$criteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcSchedulePeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$count = (int) $row[0];
|
||||
} else {
|
||||
$count = 0; // no rows returned; we infer that means 0 matches.
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of CcSchedule objects pre-filled with their CcShowInstances objects.
|
||||
* @param Criteria $criteria
|
||||
|
@ -722,6 +777,72 @@ abstract class BaseCcSchedulePeer {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of CcSchedule objects pre-filled with their CcWebstream objects.
|
||||
* @param Criteria $criteria
|
||||
* @param PropelPDO $con
|
||||
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
|
||||
* @return array Array of CcSchedule objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinCcWebstream(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
if ($criteria->getDbName() == Propel::getDefaultDB()) {
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
CcSchedulePeer::addSelectColumns($criteria);
|
||||
$startcol = (CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
CcWebstreamPeer::addSelectColumns($criteria);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key1 = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj1 = CcSchedulePeer::getInstanceFromPool($key1))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj1->hydrate($row, 0, true); // rehydrate
|
||||
} else {
|
||||
|
||||
$cls = CcSchedulePeer::getOMClass(false);
|
||||
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($row);
|
||||
CcSchedulePeer::addInstanceToPool($obj1, $key1);
|
||||
} // if $obj1 already loaded
|
||||
|
||||
$key2 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcWebstreamPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcWebstreamPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol);
|
||||
CcWebstreamPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if obj2 already loaded
|
||||
|
||||
// Add the $obj1 (CcSchedule) to $obj2 (CcWebstream)
|
||||
$obj2->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row was not null
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining all related tables
|
||||
*
|
||||
|
@ -762,6 +883,8 @@ abstract class BaseCcSchedulePeer {
|
|||
|
||||
$criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
|
@ -801,10 +924,15 @@ abstract class BaseCcSchedulePeer {
|
|||
CcFilesPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcWebstreamPeer::addSelectColumns($criteria);
|
||||
$startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
|
@ -858,6 +986,24 @@ abstract class BaseCcSchedulePeer {
|
|||
$obj3->addCcSchedule($obj1);
|
||||
} // if joined row not null
|
||||
|
||||
// Add objects for joined CcWebstream rows
|
||||
|
||||
$key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4);
|
||||
if ($key4 !== null) {
|
||||
$obj4 = CcWebstreamPeer::getInstanceFromPool($key4);
|
||||
if (!$obj4) {
|
||||
|
||||
$cls = CcWebstreamPeer::getOMClass(false);
|
||||
|
||||
$obj4 = new $cls();
|
||||
$obj4->hydrate($row, $startcol4);
|
||||
CcWebstreamPeer::addInstanceToPool($obj4, $key4);
|
||||
} // if obj4 loaded
|
||||
|
||||
// Add the $obj1 (CcSchedule) to the collection in $obj4 (CcWebstream)
|
||||
$obj4->addCcSchedule($obj1);
|
||||
} // if joined row not null
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
@ -903,6 +1049,8 @@ abstract class BaseCcSchedulePeer {
|
|||
|
||||
$criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
|
@ -953,6 +1101,60 @@ abstract class BaseCcSchedulePeer {
|
|||
|
||||
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$count = (int) $row[0];
|
||||
} else {
|
||||
$count = 0; // no rows returned; we infer that means 0 matches.
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related CcWebstream table
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
|
||||
* @param PropelPDO $con
|
||||
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCountJoinAllExceptCcWebstream(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
// we're going to modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// We need to set the primary table name, since in the case that there are no WHERE columns
|
||||
// it will be impossible for the BasePeer::createSelectSql() method to determine which
|
||||
// tables go into the FROM clause.
|
||||
$criteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcSchedulePeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
$criteria->clearOrderByColumns(); // ORDER BY should not affect count
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
|
@ -992,8 +1194,13 @@ abstract class BaseCcSchedulePeer {
|
|||
CcFilesPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcWebstreamPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
@ -1029,6 +1236,25 @@ abstract class BaseCcSchedulePeer {
|
|||
// Add the $obj1 (CcSchedule) to the collection in $obj2 (CcFiles)
|
||||
$obj2->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
// Add objects for joined CcWebstream rows
|
||||
|
||||
$key3 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcWebstreamPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcWebstreamPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcWebstreamPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if $obj3 already loaded
|
||||
|
||||
// Add the $obj1 (CcSchedule) to the collection in $obj3 (CcWebstream)
|
||||
$obj3->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
$results[] = $obj1;
|
||||
|
@ -1065,8 +1291,13 @@ abstract class BaseCcSchedulePeer {
|
|||
CcShowInstancesPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcWebstreamPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior);
|
||||
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
@ -1102,6 +1333,122 @@ abstract class BaseCcSchedulePeer {
|
|||
// Add the $obj1 (CcSchedule) to the collection in $obj2 (CcShowInstances)
|
||||
$obj2->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
// Add objects for joined CcWebstream rows
|
||||
|
||||
$key3 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcWebstreamPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcWebstreamPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcWebstreamPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if $obj3 already loaded
|
||||
|
||||
// Add the $obj1 (CcSchedule) to the collection in $obj3 (CcWebstream)
|
||||
$obj3->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of CcSchedule objects pre-filled with all related objects except CcWebstream.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param PropelPDO $con
|
||||
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
|
||||
* @return array Array of CcSchedule objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinAllExceptCcWebstream(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
// $criteria->getDbName() will return the same object if not set to another value
|
||||
// so == check is okay and faster
|
||||
if ($criteria->getDbName() == Propel::getDefaultDB()) {
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
CcSchedulePeer::addSelectColumns($criteria);
|
||||
$startcol2 = (CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcShowInstancesPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcFilesPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key1 = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj1 = CcSchedulePeer::getInstanceFromPool($key1))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj1->hydrate($row, 0, true); // rehydrate
|
||||
} else {
|
||||
$cls = CcSchedulePeer::getOMClass(false);
|
||||
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($row);
|
||||
CcSchedulePeer::addInstanceToPool($obj1, $key1);
|
||||
} // if obj1 already loaded
|
||||
|
||||
// Add objects for joined CcShowInstances rows
|
||||
|
||||
$key2 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol2);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcShowInstancesPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcShowInstancesPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol2);
|
||||
CcShowInstancesPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if $obj2 already loaded
|
||||
|
||||
// Add the $obj1 (CcSchedule) to the collection in $obj2 (CcShowInstances)
|
||||
$obj2->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
// Add objects for joined CcFiles rows
|
||||
|
||||
$key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcFilesPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcFilesPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcFilesPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if $obj3 already loaded
|
||||
|
||||
// Add the $obj1 (CcSchedule) to the collection in $obj3 (CcFiles)
|
||||
$obj3->addCcSchedule($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
$results[] = $obj1;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
* @method CcScheduleQuery orderByDbStarts($order = Criteria::ASC) Order by the starts column
|
||||
* @method CcScheduleQuery orderByDbEnds($order = Criteria::ASC) Order by the ends column
|
||||
* @method CcScheduleQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column
|
||||
* @method CcScheduleQuery orderByDbStreamId($order = Criteria::ASC) Order by the stream_id column
|
||||
* @method CcScheduleQuery orderByDbClipLength($order = Criteria::ASC) Order by the clip_length column
|
||||
* @method CcScheduleQuery orderByDbFadeIn($order = Criteria::ASC) Order by the fade_in column
|
||||
* @method CcScheduleQuery orderByDbFadeOut($order = Criteria::ASC) Order by the fade_out column
|
||||
|
@ -24,6 +25,7 @@
|
|||
* @method CcScheduleQuery groupByDbStarts() Group by the starts column
|
||||
* @method CcScheduleQuery groupByDbEnds() Group by the ends column
|
||||
* @method CcScheduleQuery groupByDbFileId() Group by the file_id column
|
||||
* @method CcScheduleQuery groupByDbStreamId() Group by the stream_id column
|
||||
* @method CcScheduleQuery groupByDbClipLength() Group by the clip_length column
|
||||
* @method CcScheduleQuery groupByDbFadeIn() Group by the fade_in column
|
||||
* @method CcScheduleQuery groupByDbFadeOut() Group by the fade_out column
|
||||
|
@ -46,6 +48,10 @@
|
|||
* @method CcScheduleQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
|
||||
* @method CcScheduleQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
|
||||
*
|
||||
* @method CcScheduleQuery leftJoinCcWebstream($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcWebstream relation
|
||||
* @method CcScheduleQuery rightJoinCcWebstream($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcWebstream relation
|
||||
* @method CcScheduleQuery innerJoinCcWebstream($relationAlias = '') Adds a INNER JOIN clause to the query using the CcWebstream relation
|
||||
*
|
||||
* @method CcSchedule findOne(PropelPDO $con = null) Return the first CcSchedule matching the query
|
||||
* @method CcSchedule findOneOrCreate(PropelPDO $con = null) Return the first CcSchedule matching the query, or a new CcSchedule object populated from the query conditions when no match is found
|
||||
*
|
||||
|
@ -53,6 +59,7 @@
|
|||
* @method CcSchedule findOneByDbStarts(string $starts) Return the first CcSchedule filtered by the starts column
|
||||
* @method CcSchedule findOneByDbEnds(string $ends) Return the first CcSchedule filtered by the ends column
|
||||
* @method CcSchedule findOneByDbFileId(int $file_id) Return the first CcSchedule filtered by the file_id column
|
||||
* @method CcSchedule findOneByDbStreamId(int $stream_id) Return the first CcSchedule filtered by the stream_id column
|
||||
* @method CcSchedule findOneByDbClipLength(string $clip_length) Return the first CcSchedule filtered by the clip_length column
|
||||
* @method CcSchedule findOneByDbFadeIn(string $fade_in) Return the first CcSchedule filtered by the fade_in column
|
||||
* @method CcSchedule findOneByDbFadeOut(string $fade_out) Return the first CcSchedule filtered by the fade_out column
|
||||
|
@ -67,6 +74,7 @@
|
|||
* @method array findByDbStarts(string $starts) Return CcSchedule objects filtered by the starts column
|
||||
* @method array findByDbEnds(string $ends) Return CcSchedule objects filtered by the ends column
|
||||
* @method array findByDbFileId(int $file_id) Return CcSchedule objects filtered by the file_id column
|
||||
* @method array findByDbStreamId(int $stream_id) Return CcSchedule objects filtered by the stream_id column
|
||||
* @method array findByDbClipLength(string $clip_length) Return CcSchedule objects filtered by the clip_length column
|
||||
* @method array findByDbFadeIn(string $fade_in) Return CcSchedule objects filtered by the fade_in column
|
||||
* @method array findByDbFadeOut(string $fade_out) Return CcSchedule objects filtered by the fade_out column
|
||||
|
@ -295,6 +303,37 @@ abstract class BaseCcScheduleQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the stream_id column
|
||||
*
|
||||
* @param int|array $dbStreamId 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 CcScheduleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbStreamId($dbStreamId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbStreamId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbStreamId['min'])) {
|
||||
$this->addUsingAlias(CcSchedulePeer::STREAM_ID, $dbStreamId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbStreamId['max'])) {
|
||||
$this->addUsingAlias(CcSchedulePeer::STREAM_ID, $dbStreamId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcSchedulePeer::STREAM_ID, $dbStreamId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the clip_length column
|
||||
*
|
||||
|
@ -661,6 +700,70 @@ abstract class BaseCcScheduleQuery extends ModelCriteria
|
|||
->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcWebstream object
|
||||
*
|
||||
* @param CcWebstream $ccWebstream the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcScheduleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcWebstream($ccWebstream, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcSchedulePeer::STREAM_ID, $ccWebstream->getDbId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcWebstream relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcScheduleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcWebstream($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcWebstream');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CcWebstream');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcWebstream relation CcWebstream object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcWebstreamQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcWebstreamQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcWebstream($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcWebstream', 'CcWebstreamQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
|
|
|
@ -1992,6 +1992,31 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent
|
|||
return $this->getCcSchedules($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this CcShowInstances is new, it will return
|
||||
* an empty collection; or if this CcShowInstances has previously
|
||||
* been saved, it will retrieve related CcSchedules from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in CcShowInstances.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return PropelCollection|array CcSchedule[] List of CcSchedule objects
|
||||
*/
|
||||
public function getCcSchedulesJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = CcScheduleQuery::create(null, $criteria);
|
||||
$query->joinWith('CcWebstream', $join_behavior);
|
||||
|
||||
return $this->getCcSchedules($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current object and sets all attributes to their default values
|
||||
*/
|
||||
|
|
|
@ -108,11 +108,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $login_attempts;
|
||||
|
||||
/**
|
||||
* @var array CcAccess[] Collection to store aggregation of CcAccess objects.
|
||||
*/
|
||||
protected $collCcAccesss;
|
||||
|
||||
/**
|
||||
* @var array CcFiles[] Collection to store aggregation of CcFiles objects.
|
||||
*/
|
||||
|
@ -826,8 +821,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
|
||||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->collCcAccesss = null;
|
||||
|
||||
$this->collCcFiless = null;
|
||||
|
||||
$this->collCcPermss = null;
|
||||
|
@ -977,14 +970,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
||||
}
|
||||
|
||||
if ($this->collCcAccesss !== null) {
|
||||
foreach ($this->collCcAccesss as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcFiless !== null) {
|
||||
foreach ($this->collCcFiless as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
|
@ -1120,14 +1105,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
|
||||
|
||||
if ($this->collCcAccesss !== null) {
|
||||
foreach ($this->collCcAccesss as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcFiless !== null) {
|
||||
foreach ($this->collCcFiless as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
|
@ -1510,12 +1487,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
// the getter/setter methods for fkey referrer objects.
|
||||
$copyObj->setNew(false);
|
||||
|
||||
foreach ($this->getCcAccesss() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcAccess($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcFiless() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcFiles($relObj->copy($deepCopy));
|
||||
|
@ -1609,115 +1580,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
return self::$peer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcAccesss collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addCcAccesss()
|
||||
*/
|
||||
public function clearCcAccesss()
|
||||
{
|
||||
$this->collCcAccesss = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCcAccesss collection.
|
||||
*
|
||||
* By default this just sets the collCcAccesss collection to an empty array (like clearcollCcAccesss());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCcAccesss()
|
||||
{
|
||||
$this->collCcAccesss = new PropelObjectCollection();
|
||||
$this->collCcAccesss->setModel('CcAccess');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcAccess objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcSubjs is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcAccess[] List of CcAccess objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCcAccesss($criteria = null, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcAccesss || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcAccesss) {
|
||||
// return empty collection
|
||||
$this->initCcAccesss();
|
||||
} else {
|
||||
$collCcAccesss = CcAccessQuery::create(null, $criteria)
|
||||
->filterByCcSubjs($this)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcAccesss;
|
||||
}
|
||||
$this->collCcAccesss = $collCcAccesss;
|
||||
}
|
||||
}
|
||||
return $this->collCcAccesss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related CcAccess objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param PropelPDO $con
|
||||
* @return int Count of related CcAccess objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCcAccesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcAccesss || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcAccesss) {
|
||||
return 0;
|
||||
} else {
|
||||
$query = CcAccessQuery::create(null, $criteria);
|
||||
if($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
return $query
|
||||
->filterByCcSubjs($this)
|
||||
->count($con);
|
||||
}
|
||||
} else {
|
||||
return count($this->collCcAccesss);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a CcAccess object to this object
|
||||
* through the CcAccess foreign key attribute.
|
||||
*
|
||||
* @param CcAccess $l CcAccess
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function addCcAccess(CcAccess $l)
|
||||
{
|
||||
if ($this->collCcAccesss === null) {
|
||||
$this->initCcAccesss();
|
||||
}
|
||||
if (!$this->collCcAccesss->contains($l)) { // only add it if the **same** object is not already associated
|
||||
$this->collCcAccesss[]= $l;
|
||||
$l->setCcSubjs($this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcFiless collection
|
||||
*
|
||||
|
@ -2679,11 +2541,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
public function clearAllReferences($deep = false)
|
||||
{
|
||||
if ($deep) {
|
||||
if ($this->collCcAccesss) {
|
||||
foreach ((array) $this->collCcAccesss as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcFiless) {
|
||||
foreach ((array) $this->collCcFiless as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
|
@ -2726,7 +2583,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
} // if ($deep)
|
||||
|
||||
$this->collCcAccesss = null;
|
||||
$this->collCcFiless = null;
|
||||
$this->collCcPermss = null;
|
||||
$this->collCcShowHostss = null;
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
* @method CcSubjsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcSubjsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcSubjsQuery leftJoinCcAccess($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcAccess relation
|
||||
* @method CcSubjsQuery rightJoinCcAccess($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcAccess relation
|
||||
* @method CcSubjsQuery innerJoinCcAccess($relationAlias = '') Adds a INNER JOIN clause to the query using the CcAccess relation
|
||||
*
|
||||
* @method CcSubjsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
|
||||
* @method CcSubjsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
|
||||
* @method CcSubjsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
|
||||
|
@ -521,70 +517,6 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcAccess object
|
||||
*
|
||||
* @param CcAccess $ccAccess the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcSubjsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcAccess($ccAccess, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcSubjsPeer::ID, $ccAccess->getOwner(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcAccess relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcSubjsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcAccess($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcAccess');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CcAccess');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcAccess relation CcAccess object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcAccessQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcAccessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcAccess($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcAccess', 'CcAccessQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcFiles object
|
||||
*
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,772 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'cc_webstream' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcWebstreamPeer {
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'airtime';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'cc_webstream';
|
||||
|
||||
/** the related Propel class for this table */
|
||||
const OM_CLASS = 'CcWebstream';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'airtime.CcWebstream';
|
||||
|
||||
/** the related TableMap class for this table */
|
||||
const TM_CLASS = 'CcWebstreamTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 8;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/** the column name for the ID field */
|
||||
const ID = 'cc_webstream.ID';
|
||||
|
||||
/** the column name for the NAME field */
|
||||
const NAME = 'cc_webstream.NAME';
|
||||
|
||||
/** the column name for the DESCRIPTION field */
|
||||
const DESCRIPTION = 'cc_webstream.DESCRIPTION';
|
||||
|
||||
/** the column name for the URL field */
|
||||
const URL = 'cc_webstream.URL';
|
||||
|
||||
/** the column name for the LENGTH field */
|
||||
const LENGTH = 'cc_webstream.LENGTH';
|
||||
|
||||
/** the column name for the LOGIN field */
|
||||
const LOGIN = 'cc_webstream.LOGIN';
|
||||
|
||||
/** the column name for the MTIME field */
|
||||
const MTIME = 'cc_webstream.MTIME';
|
||||
|
||||
/** the column name for the UTIME field */
|
||||
const UTIME = 'cc_webstream.UTIME';
|
||||
|
||||
/**
|
||||
* An identiy map to hold any loaded instances of CcWebstream objects.
|
||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||
* queries.
|
||||
* @var array CcWebstream[]
|
||||
*/
|
||||
public static $instances = array();
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbDescription', 'DbUrl', 'DbLength', 'DbLogin', 'DbMtime', 'DbUtime', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbDescription', 'dbUrl', 'dbLength', 'dbLogin', 'dbMtime', 'dbUtime', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::DESCRIPTION, self::URL, self::LENGTH, self::LOGIN, self::MTIME, self::UTIME, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'DESCRIPTION', 'URL', 'LENGTH', 'LOGIN', 'MTIME', 'UTIME', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'description', 'url', 'length', 'login', 'mtime', 'utime', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbDescription' => 2, 'DbUrl' => 3, 'DbLength' => 4, 'DbLogin' => 5, 'DbMtime' => 6, 'DbUtime' => 7, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbDescription' => 2, 'dbUrl' => 3, 'dbLength' => 4, 'dbLogin' => 5, 'dbMtime' => 6, 'dbUtime' => 7, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::DESCRIPTION => 2, self::URL => 3, self::LENGTH => 4, self::LOGIN => 5, self::MTIME => 6, self::UTIME => 7, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'DESCRIPTION' => 2, 'URL' => 3, 'LENGTH' => 4, 'LOGIN' => 5, 'MTIME' => 6, 'UTIME' => 7, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'description' => 2, 'url' => 3, 'length' => 4, 'login' => 5, 'mtime' => 6, 'utime' => 7, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Translates a fieldname to another type
|
||||
*
|
||||
* @param string $name field name
|
||||
* @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
|
||||
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
|
||||
* @param string $toType One of the class type constants
|
||||
* @return string translated name of the field.
|
||||
* @throws PropelException - if the specified name could not be found in the fieldname mappings.
|
||||
*/
|
||||
static public function translateFieldName($name, $fromType, $toType)
|
||||
{
|
||||
$toNames = self::getFieldNames($toType);
|
||||
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
|
||||
if ($key === null) {
|
||||
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
|
||||
}
|
||||
return $toNames[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of field names.
|
||||
*
|
||||
* @param string $type The type of fieldnames to return:
|
||||
* One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
|
||||
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
|
||||
* @return array A list of field names
|
||||
*/
|
||||
|
||||
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
|
||||
{
|
||||
if (!array_key_exists($type, self::$fieldNames)) {
|
||||
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
|
||||
}
|
||||
return self::$fieldNames[$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method which changes table.column to alias.column.
|
||||
*
|
||||
* Using this method you can maintain SQL abstraction while using column aliases.
|
||||
* <code>
|
||||
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
|
||||
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
|
||||
* </code>
|
||||
* @param string $alias The alias for the current table.
|
||||
* @param string $column The column name for current table. (i.e. CcWebstreamPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(CcWebstreamPeer::TABLE_NAME.'.', $alias.'.', $column);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::ID);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::NAME);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::DESCRIPTION);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::URL);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::LENGTH);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::LOGIN);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::MTIME);
|
||||
$criteria->addSelectColumn(CcWebstreamPeer::UTIME);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.NAME');
|
||||
$criteria->addSelectColumn($alias . '.DESCRIPTION');
|
||||
$criteria->addSelectColumn($alias . '.URL');
|
||||
$criteria->addSelectColumn($alias . '.LENGTH');
|
||||
$criteria->addSelectColumn($alias . '.LOGIN');
|
||||
$criteria->addSelectColumn($alias . '.MTIME');
|
||||
$criteria->addSelectColumn($alias . '.UTIME');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
|
||||
* @param PropelPDO $con
|
||||
* @return int Number of matching rows.
|
||||
*/
|
||||
public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
// we may modify criteria, so copy it first
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// We need to set the primary table name, since in the case that there are no WHERE columns
|
||||
// it will be impossible for the BasePeer::createSelectSql() method to determine which
|
||||
// tables go into the FROM clause.
|
||||
$criteria->setPrimaryTableName(CcWebstreamPeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcWebstreamPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
|
||||
$criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
// BasePeer returns a PDOStatement
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$count = (int) $row[0];
|
||||
} else {
|
||||
$count = 0; // no rows returned; we infer that means 0 matches.
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $count;
|
||||
}
|
||||
/**
|
||||
* Method to select one object from the DB.
|
||||
*
|
||||
* @param Criteria $criteria object used to create the SELECT statement.
|
||||
* @param PropelPDO $con
|
||||
* @return CcWebstream
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
|
||||
{
|
||||
$critcopy = clone $criteria;
|
||||
$critcopy->setLimit(1);
|
||||
$objects = CcWebstreamPeer::doSelect($critcopy, $con);
|
||||
if ($objects) {
|
||||
return $objects[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Method to do selects.
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param PropelPDO $con
|
||||
* @return array Array of selected Objects
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelect(Criteria $criteria, PropelPDO $con = null)
|
||||
{
|
||||
return CcWebstreamPeer::populateObjects(CcWebstreamPeer::doSelectStmt($criteria, $con));
|
||||
}
|
||||
/**
|
||||
* Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
|
||||
*
|
||||
* Use this method directly if you want to work with an executed statement durirectly (for example
|
||||
* to perform your own object hydration).
|
||||
*
|
||||
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
|
||||
* @param PropelPDO $con The connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return PDOStatement The executed PDOStatement object.
|
||||
* @see BasePeer::doSelect()
|
||||
*/
|
||||
public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
$criteria = clone $criteria;
|
||||
CcWebstreamPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
// BasePeer returns a PDOStatement
|
||||
return BasePeer::doSelect($criteria, $con);
|
||||
}
|
||||
/**
|
||||
* Adds an object to the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doSelect*()
|
||||
* methods in your stub classes -- you may need to explicitly add objects
|
||||
* to the cache in order to ensure that the same objects are always returned by doSelect*()
|
||||
* and retrieveByPK*() calls.
|
||||
*
|
||||
* @param CcWebstream $value A CcWebstream object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool(CcWebstream $obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if ($key === null) {
|
||||
$key = (string) $obj->getDbId();
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A CcWebstream object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && $value !== null) {
|
||||
if (is_object($value) && $value instanceof CcWebstream) {
|
||||
$key = (string) $value->getDbId();
|
||||
} elseif (is_scalar($value)) {
|
||||
// assume we've been passed a primary key
|
||||
$key = (string) $value;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcWebstream object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
|
||||
throw $e;
|
||||
}
|
||||
|
||||
unset(self::$instances[$key]);
|
||||
}
|
||||
} // removeInstanceFromPool()
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param string $key The key (@see getPrimaryKeyHash()) for this instance.
|
||||
* @return CcWebstream Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
|
||||
* @see getPrimaryKeyHash()
|
||||
*/
|
||||
public static function getInstanceFromPool($key)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if (isset(self::$instances[$key])) {
|
||||
return self::$instances[$key];
|
||||
}
|
||||
}
|
||||
return null; // just to be explicit
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the instance pool.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function clearInstancePool()
|
||||
{
|
||||
self::$instances = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to invalidate the instance pool of all tables related to cc_webstream
|
||||
* by a foreign key with ON DELETE CASCADE
|
||||
*/
|
||||
public static function clearRelatedInstancePool()
|
||||
{
|
||||
// Invalidate objects in CcSchedulePeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcSchedulePeer::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row PropelPDO resultset row.
|
||||
* @param int $startcol The 0-based offset for reading from the resultset row.
|
||||
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[$startcol] === null) {
|
||||
return null;
|
||||
}
|
||||
return (string) $row[$startcol];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row PropelPDO resultset row.
|
||||
* @param int $startcol The 0-based offset for reading from the resultset row.
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $startcol = 0)
|
||||
{
|
||||
return (int) $row[$startcol];
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(PDOStatement $stmt)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = CcWebstreamPeer::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj = CcWebstreamPeer::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
CcWebstreamPeer::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row PropelPDO resultset row.
|
||||
* @param int $startcol The 0-based offset for reading from the resultset row.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (CcWebstream object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $startcol = 0)
|
||||
{
|
||||
$key = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||
if (null !== ($obj = CcWebstreamPeer::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $startcol, true); // rehydrate
|
||||
$col = $startcol + CcWebstreamPeer::NUM_COLUMNS;
|
||||
} else {
|
||||
$cls = CcWebstreamPeer::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $startcol);
|
||||
CcWebstreamPeer::addInstanceToPool($obj, $key);
|
||||
}
|
||||
return array($obj, $col);
|
||||
}
|
||||
/**
|
||||
* Returns the TableMap related to this peer.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this peer class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getDatabaseMap(BaseCcWebstreamPeer::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(BaseCcWebstreamPeer::TABLE_NAME))
|
||||
{
|
||||
$dbMap->addTableObject(new CcWebstreamTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the Peer will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is tranalted into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? CcWebstreamPeer::CLASS_DEFAULT : CcWebstreamPeer::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a CcWebstream or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or CcWebstream object containing data that is used to create the INSERT statement.
|
||||
* @param PropelPDO $con the PropelPDO connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($values, PropelPDO $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from CcWebstream object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(CcWebstreamPeer::ID) && $criteria->keyContainsValue(CcWebstreamPeer::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcWebstreamPeer::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$con->commit();
|
||||
} catch(PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an UPDATE on the database, given a CcWebstream or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or CcWebstream object containing data that is used to create the UPDATE statement.
|
||||
* @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doUpdate($values, PropelPDO $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(CcWebstreamPeer::ID);
|
||||
$value = $criteria->remove(CcWebstreamPeer::ID);
|
||||
if ($value) {
|
||||
$selectCriteria->add(CcWebstreamPeer::ID, $value, $comparison);
|
||||
} else {
|
||||
$selectCriteria->setPrimaryTableName(CcWebstreamPeer::TABLE_NAME);
|
||||
}
|
||||
|
||||
} else { // $values is CcWebstream object
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
}
|
||||
|
||||
// set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to DELETE all rows from the cc_webstream table.
|
||||
*
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll($con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
$affectedRows += BasePeer::doDeleteAll(CcWebstreamPeer::TABLE_NAME, $con, CcWebstreamPeer::DATABASE_NAME);
|
||||
// Because this db requires some delete cascade/set null emulation, we have to
|
||||
// clear the cached instance *after* the emulation has happened (since
|
||||
// instances get re-added by the select statement contained therein).
|
||||
CcWebstreamPeer::clearInstancePool();
|
||||
CcWebstreamPeer::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a CcWebstream or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CcWebstream object or primary key or array of primary keys
|
||||
* which is used to create the DELETE statement
|
||||
* @param PropelPDO $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
|
||||
* if supported by native driver or if emulated using Propel.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doDelete($values, PropelPDO $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// invalidate the cache for all objects of this type, since we have no
|
||||
// way of knowing (without running a query) what objects should be invalidated
|
||||
// from the cache based on this Criteria.
|
||||
CcWebstreamPeer::clearInstancePool();
|
||||
// rename for clarity
|
||||
$criteria = clone $values;
|
||||
} elseif ($values instanceof CcWebstream) { // it's a model object
|
||||
// invalidate the cache for this single object
|
||||
CcWebstreamPeer::removeInstanceFromPool($values);
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(CcWebstreamPeer::ID, (array) $values, Criteria::IN);
|
||||
// invalidate the cache for this object(s)
|
||||
foreach ((array) $values as $singleval) {
|
||||
CcWebstreamPeer::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
$affectedRows = 0; // initialize var to track total num of affected rows
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table or we could emulating ON DELETE CASCADE, etc.
|
||||
$con->beginTransaction();
|
||||
|
||||
$affectedRows += BasePeer::doDelete($criteria, $con);
|
||||
CcWebstreamPeer::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given CcWebstream object.
|
||||
* If parameter $columns is either a single column name or an array of column names
|
||||
* than only those columns are validated.
|
||||
*
|
||||
* NOTICE: This does not apply to primary or foreign keys for now.
|
||||
*
|
||||
* @param CcWebstream $obj The object to validate.
|
||||
* @param mixed $cols Column name or array of column names.
|
||||
*
|
||||
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
|
||||
*/
|
||||
public static function doValidate(CcWebstream $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(CcWebstreamPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(CcWebstreamPeer::TABLE_NAME);
|
||||
|
||||
if (! is_array($cols)) {
|
||||
$cols = array($cols);
|
||||
}
|
||||
|
||||
foreach ($cols as $colName) {
|
||||
if ($tableMap->containsColumn($colName)) {
|
||||
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
|
||||
$columns[$colName] = $obj->$get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return BasePeer::doValidate(CcWebstreamPeer::DATABASE_NAME, CcWebstreamPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param int $pk the primary key.
|
||||
* @param PropelPDO $con the connection to use
|
||||
* @return CcWebstream
|
||||
*/
|
||||
public static function retrieveByPK($pk, PropelPDO $con = null)
|
||||
{
|
||||
|
||||
if (null !== ($obj = CcWebstreamPeer::getInstanceFromPool((string) $pk))) {
|
||||
return $obj;
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(CcWebstreamPeer::DATABASE_NAME);
|
||||
$criteria->add(CcWebstreamPeer::ID, $pk);
|
||||
|
||||
$v = CcWebstreamPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param PropelPDO $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function retrieveByPKs($pks, PropelPDO $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcWebstreamPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria(CcWebstreamPeer::DATABASE_NAME);
|
||||
$criteria->add(CcWebstreamPeer::ID, $pks, Criteria::IN);
|
||||
$objs = CcWebstreamPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
|
||||
} // BaseCcWebstreamPeer
|
||||
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
BaseCcWebstreamPeer::buildTableMap();
|
||||
|
|
@ -0,0 +1,433 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'cc_webstream' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method CcWebstreamQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcWebstreamQuery orderByDbName($order = Criteria::ASC) Order by the name column
|
||||
* @method CcWebstreamQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method CcWebstreamQuery orderByDbUrl($order = Criteria::ASC) Order by the url column
|
||||
* @method CcWebstreamQuery orderByDbLength($order = Criteria::ASC) Order by the length column
|
||||
* @method CcWebstreamQuery orderByDbLogin($order = Criteria::ASC) Order by the login column
|
||||
* @method CcWebstreamQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
|
||||
* @method CcWebstreamQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
|
||||
*
|
||||
* @method CcWebstreamQuery groupByDbId() Group by the id column
|
||||
* @method CcWebstreamQuery groupByDbName() Group by the name column
|
||||
* @method CcWebstreamQuery groupByDbDescription() Group by the description column
|
||||
* @method CcWebstreamQuery groupByDbUrl() Group by the url column
|
||||
* @method CcWebstreamQuery groupByDbLength() Group by the length column
|
||||
* @method CcWebstreamQuery groupByDbLogin() Group by the login column
|
||||
* @method CcWebstreamQuery groupByDbMtime() Group by the mtime column
|
||||
* @method CcWebstreamQuery groupByDbUtime() Group by the utime column
|
||||
*
|
||||
* @method CcWebstreamQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcWebstreamQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcWebstreamQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcWebstreamQuery leftJoinCcSchedule($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSchedule relation
|
||||
* @method CcWebstreamQuery rightJoinCcSchedule($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSchedule relation
|
||||
* @method CcWebstreamQuery innerJoinCcSchedule($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSchedule relation
|
||||
*
|
||||
* @method CcWebstream findOne(PropelPDO $con = null) Return the first CcWebstream matching the query
|
||||
* @method CcWebstream findOneOrCreate(PropelPDO $con = null) Return the first CcWebstream matching the query, or a new CcWebstream object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcWebstream findOneByDbId(int $id) Return the first CcWebstream filtered by the id column
|
||||
* @method CcWebstream findOneByDbName(string $name) Return the first CcWebstream filtered by the name column
|
||||
* @method CcWebstream findOneByDbDescription(string $description) Return the first CcWebstream filtered by the description column
|
||||
* @method CcWebstream findOneByDbUrl(string $url) Return the first CcWebstream filtered by the url column
|
||||
* @method CcWebstream findOneByDbLength(string $length) Return the first CcWebstream filtered by the length column
|
||||
* @method CcWebstream findOneByDbLogin(string $login) Return the first CcWebstream filtered by the login column
|
||||
* @method CcWebstream findOneByDbMtime(string $mtime) Return the first CcWebstream filtered by the mtime column
|
||||
* @method CcWebstream findOneByDbUtime(string $utime) Return the first CcWebstream filtered by the utime column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcWebstream objects filtered by the id column
|
||||
* @method array findByDbName(string $name) Return CcWebstream objects filtered by the name column
|
||||
* @method array findByDbDescription(string $description) Return CcWebstream objects filtered by the description column
|
||||
* @method array findByDbUrl(string $url) Return CcWebstream objects filtered by the url column
|
||||
* @method array findByDbLength(string $length) Return CcWebstream objects filtered by the length column
|
||||
* @method array findByDbLogin(string $login) Return CcWebstream objects filtered by the login column
|
||||
* @method array findByDbMtime(string $mtime) Return CcWebstream objects filtered by the mtime column
|
||||
* @method array findByDbUtime(string $utime) Return CcWebstream objects filtered by the utime column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcWebstreamQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCcWebstreamQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'airtime', $modelName = 'CcWebstream', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CcWebstreamQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CcWebstreamQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CcWebstreamQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CcWebstreamQuery();
|
||||
if (null !== $modelAlias) {
|
||||
$query->setModelAlias($modelAlias);
|
||||
}
|
||||
if ($criteria instanceof Criteria) {
|
||||
$query->mergeWith($criteria);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find object by primary key
|
||||
* Use instance pooling to avoid a database query if the object exists
|
||||
* <code>
|
||||
* $obj = $c->findPk(12, $con);
|
||||
* </code>
|
||||
* @param mixed $key Primary key to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
*
|
||||
* @return CcWebstream|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ((null !== ($obj = CcWebstreamPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
|
||||
// the object is alredy in the instance pool
|
||||
return $obj;
|
||||
} else {
|
||||
// the object has not been requested yet, or the formatter is not an object formatter
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
$stmt = $criteria
|
||||
->filterByPrimaryKey($key)
|
||||
->getSelectStatement($con);
|
||||
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find objects by primary key
|
||||
* <code>
|
||||
* $objs = $c->findPks(array(12, 56, 832), $con);
|
||||
* </code>
|
||||
* @param array $keys Primary keys to use for the query
|
||||
* @param PropelPDO $con an optional connection object
|
||||
*
|
||||
* @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
|
||||
*/
|
||||
public function findPks($keys, $con = null)
|
||||
{
|
||||
$criteria = $this->isKeepQuery() ? clone $this : $this;
|
||||
return $this
|
||||
->filterByPrimaryKeys($keys)
|
||||
->find($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by primary key
|
||||
*
|
||||
* @param mixed $key Primary key to use for the query
|
||||
*
|
||||
* @return CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
return $this->addUsingAlias(CcWebstreamPeer::ID, $key, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a list of primary keys
|
||||
*
|
||||
* @param array $keys The list of primary key to use for the query
|
||||
*
|
||||
* @return CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
return $this->addUsingAlias(CcWebstreamPeer::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* @param int|array $dbId 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbId($dbId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbId) && null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::ID, $dbId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the name column
|
||||
*
|
||||
* @param string $dbName 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbName($dbName = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbName)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbName)) {
|
||||
$dbName = str_replace('*', '%', $dbName);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::NAME, $dbName, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* @param string $dbDescription 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbDescription($dbDescription = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbDescription)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbDescription)) {
|
||||
$dbDescription = str_replace('*', '%', $dbDescription);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::DESCRIPTION, $dbDescription, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the url column
|
||||
*
|
||||
* @param string $dbUrl 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbUrl($dbUrl = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbUrl)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbUrl)) {
|
||||
$dbUrl = str_replace('*', '%', $dbUrl);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::URL, $dbUrl, $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 CcWebstreamQuery 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(CcWebstreamPeer::LENGTH, $dbLength, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the login column
|
||||
*
|
||||
* @param string $dbLogin 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbLogin($dbLogin = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbLogin)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbLogin)) {
|
||||
$dbLogin = str_replace('*', '%', $dbLogin);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::LOGIN, $dbLogin, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the mtime column
|
||||
*
|
||||
* @param string|array $dbMtime 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbMtime($dbMtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbMtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbMtime['min'])) {
|
||||
$this->addUsingAlias(CcWebstreamPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbMtime['max'])) {
|
||||
$this->addUsingAlias(CcWebstreamPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::MTIME, $dbMtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the utime column
|
||||
*
|
||||
* @param string|array $dbUtime 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 CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbUtime($dbUtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbUtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbUtime['min'])) {
|
||||
$this->addUsingAlias(CcWebstreamPeer::UTIME, $dbUtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbUtime['max'])) {
|
||||
$this->addUsingAlias(CcWebstreamPeer::UTIME, $dbUtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcWebstreamPeer::UTIME, $dbUtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSchedule object
|
||||
*
|
||||
* @param CcSchedule $ccSchedule the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcSchedule($ccSchedule, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcWebstreamPeer::ID, $ccSchedule->getDbStreamId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcSchedule relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcSchedule($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcSchedule');
|
||||
|
||||
// create a ModelJoin object for this join
|
||||
$join = new ModelJoin();
|
||||
$join->setJoinType($joinType);
|
||||
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||
if ($previousJoin = $this->getPreviousJoin()) {
|
||||
$join->setPreviousJoin($previousJoin);
|
||||
}
|
||||
|
||||
// add the ModelJoin to the current object
|
||||
if($relationAlias) {
|
||||
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||
$this->addJoinObject($join, $relationAlias);
|
||||
} else {
|
||||
$this->addJoinObject($join, 'CcSchedule');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcSchedule relation CcSchedule object
|
||||
*
|
||||
* @see useQuery()
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation,
|
||||
* to be used as main alias in the secondary query
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcScheduleQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcScheduleQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcSchedule($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcSchedule', 'CcScheduleQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CcWebstream $ccWebstream Object to remove from the list of results
|
||||
*
|
||||
* @return CcWebstreamQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($ccWebstream = null)
|
||||
{
|
||||
if ($ccWebstream) {
|
||||
$this->addUsingAlias(CcWebstreamPeer::ID, $ccWebstream->getDbId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
} // BaseCcWebstreamQuery
|
|
@ -29,10 +29,10 @@
|
|||
<div><span>Contents: </span>
|
||||
<?php foreach($this->contents as $row) : ?>
|
||||
<div>
|
||||
<span><?php echo $row["CcFiles"]["track_title"] ?></span>
|
||||
<span><?php echo $row["CcFiles"]["artist_name"] ?></span>
|
||||
<span><?php echo $row["CcFiles"]["album_title"] ?></span>
|
||||
<span><?php echo $row["cliplength"] ?></span>
|
||||
<span><?php echo $row["track_title"] ?></span>
|
||||
<span><?php echo $row["creator"] ?></span>
|
||||
<span><?php echo $row["album_title"] ?></span>
|
||||
<span><?php echo $row["length"] ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<button id="spl_new" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">New</button>
|
||||
<button id="ws_new" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">New Stream</button>
|
||||
<?php if (isset($this->obj)) : ?>
|
||||
<button id="spl_delete" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">Delete</button>
|
||||
<a href="#" id="spl_crossfade" class="ui-button ui-button-icon-only ui-widget ui-state-default crossfade-main-button">
|
||||
|
|
|
@ -3,11 +3,11 @@ $items = $this->obj->getContents();
|
|||
if (count($items)) : ?>
|
||||
<?php $i = 0; ?>
|
||||
<?php foreach($items as $item) : ?>
|
||||
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$item["id"]; ?>">
|
||||
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["id"]; ?>">
|
||||
<div class="list-item-container">
|
||||
|
||||
<?php if ($item["CcFiles"]['file_exists']):?>
|
||||
<div class="big_play" audioFile="<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]['filepath'], PATHINFO_EXTENSION); ?>">
|
||||
<?php if ($item['exists']):?>
|
||||
<div class="big_play" audioFile="<?php echo $item["id"]; ?>">
|
||||
<span class="ui-icon ui-icon-play"></span>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
@ -17,12 +17,12 @@ if (count($items)) : ?>
|
|||
<?php endif; ?>
|
||||
|
||||
<div class="text-row top">
|
||||
<span class="spl_playlength"><?php echo $item["cliplength"] ?></span>
|
||||
<span class="spl_playlength"><?php echo $item["length"] ?></span>
|
||||
<span class="spl_cue ui-state-default"></span>
|
||||
<span class="spl_title"><?php echo $item["CcFiles"]['track_title'] ?></span>
|
||||
<span class="spl_title"><?php echo $item['track_title'] ?></span>
|
||||
</div>
|
||||
<div class="text-row">
|
||||
<span class="spl_artist"><?php echo $item["CcFiles"]['artist_name'] ?></span>
|
||||
<span class="spl_artist"><?php echo $item['creator'] ?></span>
|
||||
<span class="spl_offset"><?php echo $item["offset"]?></span>
|
||||
</div>
|
||||
<?php //create the crossfade icon.
|
||||
|
@ -38,7 +38,7 @@ if (count($items)) : ?>
|
|||
'id' => $item["id"],
|
||||
'cueIn' => $item['cuein'],
|
||||
'cueOut' => $item['cueout'],
|
||||
'origLength' => $item["CcFiles"]['length'])); ?>
|
||||
'origLength' => $item['length'])); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
<button id="ws_new" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">New</button>
|
||||
<?php if (isset($this->ws)) : ?>
|
||||
<button id="ws_delete" class="ui-button ui-widget ui-state-default" role="button" aria-disabled="false">Delete</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($this->ws)) : ?>
|
||||
<input id="ws_id" type="hidden" value="<?php echo $this->ws->getId(); ?>"></input>
|
||||
<input id="pl_lastMod" type="hidden" value="<?php echo $this->ws->getLastModified('U'); ?>"></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="ws_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->ws->getName(); ?></a>
|
||||
</h3>
|
||||
<h4 id="ws_length"><?php echo $this->ws->getDefaultLength(); ?></h4>
|
||||
</div>
|
||||
|
||||
<fieldset class="toggle closed" id="fieldset-metadate_change">
|
||||
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>View / edit description</legend>
|
||||
<dl class="zend_form">
|
||||
<dt id="description-label"><label for="description">Description</label></dt>
|
||||
<dd id="description-element">
|
||||
<textarea cols="80" rows="24" id="description" name="description"><?php echo $this->ws->getDescription(); ?></textarea>
|
||||
</dd>
|
||||
<dt id="submit-label" style="display: none;"> </dt>
|
||||
<dt id="streamurl-label"><label for="streamurl">Stream URL:</label></dt>
|
||||
<dd id="streamurl-element">
|
||||
<input type="text" value="http://"/>
|
||||
</dd>
|
||||
<dt id="streamlength-label"><label for="streamlength">Default Length:</label></dt>
|
||||
<dd id="streamlength-element">
|
||||
<input type="text" value="00h 20m"/>
|
||||
</dd>
|
||||
<dd id="submit-element" class="buttons">
|
||||
<input class="ui-button ui-state-default" type="submit" value="Cancel" id="webstream_cancel" name="cancel">
|
||||
<input class="ui-button ui-state-default" type="submit" value="Save" id="webstream_save" name="submit">
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
<div>No webstream</div>
|
||||
<?php endif; ?>
|
|
@ -1,29 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--Autogenerated by PropelSchemaReverseTask class.-->
|
||||
<database name="airtime" defaultIdMethod="native">
|
||||
<table name="cc_access" phpName="CcAccess">
|
||||
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="gunid" phpName="Gunid" type="CHAR" size="32" required="false"/>
|
||||
<column name="token" phpName="Token" type="BIGINT" required="false"/>
|
||||
<column name="chsum" phpName="Chsum" type="CHAR" size="32" required="true" defaultValue=""/>
|
||||
<column name="ext" phpName="Ext" type="VARCHAR" size="128" required="true" defaultValue=""/>
|
||||
<column name="type" phpName="Type" type="VARCHAR" size="20" required="true" defaultValue=""/>
|
||||
<column name="parent" phpName="Parent" type="BIGINT" required="false"/>
|
||||
<column name="owner" phpName="Owner" type="INTEGER" required="false"/>
|
||||
<column name="ts" phpName="Ts" type="TIMESTAMP" required="false"/>
|
||||
<foreign-key foreignTable="cc_subjs" name="cc_access_owner_fkey">
|
||||
<reference local="owner" foreign="id"/>
|
||||
</foreign-key>
|
||||
<index name="cc_access_gunid_idx">
|
||||
<index-column name="gunid"/>
|
||||
</index>
|
||||
<index name="cc_access_parent_idx">
|
||||
<index-column name="parent"/>
|
||||
</index>
|
||||
<index name="cc_access_token_idx">
|
||||
<index-column name="token"/>
|
||||
</index>
|
||||
</table>
|
||||
<table name="cc_music_dirs" phpName="CcMusicDirs">
|
||||
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="directory" phpName="Directory" type="LONGVARCHAR" required="false"/>
|
||||
|
@ -36,7 +13,6 @@
|
|||
</table>
|
||||
<table name="cc_files" phpName="CcFiles">
|
||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="gunid" phpName="DbGunid" type="char" size="32" required="true"/>
|
||||
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
||||
<column name="mime" phpName="DbMime" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
||||
<column name="ftype" phpName="DbFtype" type="VARCHAR" size="128" required="true" defaultValue=""/>
|
||||
|
@ -105,9 +81,6 @@
|
|||
<foreign-key foreignTable="cc_music_dirs" name="cc_music_dirs_folder_fkey">
|
||||
<reference local="directory" foreign="id"/>
|
||||
</foreign-key>
|
||||
<unique name="cc_files_gunid_idx">
|
||||
<unique-column name="gunid"/>
|
||||
</unique>
|
||||
<index name="cc_files_md5_idx">
|
||||
<index-column name="md5"/>
|
||||
</index>
|
||||
|
@ -243,6 +216,7 @@
|
|||
0: audiotrack
|
||||
1: webstream
|
||||
2: block
|
||||
1: webstream
|
||||
-->
|
||||
<column name="type" phpName="DbType" type="SMALLINT" required="true" default="0"/>
|
||||
<column name="position" phpName="DbPosition" type="INTEGER" required="false"/>
|
||||
|
@ -331,6 +305,7 @@
|
|||
<column name="starts" phpName="DbStarts" type="TIMESTAMP" required="true"/>
|
||||
<column name="ends" phpName="DbEnds" type="TIMESTAMP" required="true"/>
|
||||
<column name="file_id" phpName="DbFileId" type="INTEGER" required="false"/>
|
||||
<column name="stream_id" phpName="DbStreamId" type="INTEGER" required="false"/>
|
||||
<column name="clip_length" phpName="DbClipLength" type="VARCHAR" sqlType="interval" required="false" defaultValue="00:00:00"/>
|
||||
<column name="fade_in" phpName="DbFadeIn" type="TIME" required="false" defaultValue="00:00:00"/>
|
||||
<column name="fade_out" phpName="DbFadeOut" type="TIME" required="false" defaultValue="00:00:00"/>
|
||||
|
@ -350,7 +325,10 @@
|
|||
<foreign-key foreignTable="cc_files" name="cc_show_file_fkey" onDelete="CASCADE">
|
||||
<reference local="file_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<foreign-key foreignTable="cc_webstream" name="cc_show_stream_fkey" onDelete="CASCADE">
|
||||
<reference local="stream_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<table name="cc_sess" phpName="CcSess">
|
||||
<column name="sessid" phpName="Sessid" type="CHAR" size="32" primaryKey="true" required="true"/>
|
||||
<column name="userid" phpName="Userid" type="INTEGER" required="false"/>
|
||||
|
@ -433,4 +411,15 @@
|
|||
<column name="start_time" phpName="DbStartTime" type="TIMESTAMP" required="true" />
|
||||
<column name="end_time" phpName="DbEndTime" type="TIMESTAMP" required="false"/>
|
||||
</table>
|
||||
<table name="cc_webstream" phpName="CcWebstream">
|
||||
<column name="id" phpName="DbId" primaryKey="true" type="INTEGER" autoIncrement="true" required="true" />
|
||||
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" />
|
||||
<!-- TODO, remove hardlimit on this column length? -->
|
||||
<column name="description" phpName="DbDescription" type="VARCHAR" size="255" required="true" />
|
||||
<column name="url" phpName="DbUrl" type="VARCHAR" size="255" required="true" />
|
||||
<column name="length" phpName="DbLength" type="VARCHAR" sqlType="interval" required="true" defaultValue="00:00:00"/>
|
||||
<column name="login" phpName="DbLogin" type="VARCHAR" size="255" required="true" />
|
||||
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="true" />
|
||||
<column name="utime" phpName="DbUtime" type="TIMESTAMP" size="6" required="true" />
|
||||
</table>
|
||||
</database>
|
||||
|
|
|
@ -1,35 +1,4 @@
|
|||
|
||||
-----------------------------------------------------------------------------
|
||||
-- cc_access
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE "cc_access" CASCADE;
|
||||
|
||||
|
||||
CREATE TABLE "cc_access"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"gunid" CHAR(32),
|
||||
"token" INT8,
|
||||
"chsum" CHAR(32) default '' NOT NULL,
|
||||
"ext" VARCHAR(128) default '' NOT NULL,
|
||||
"type" VARCHAR(20) default '' NOT NULL,
|
||||
"parent" INT8,
|
||||
"owner" INTEGER,
|
||||
"ts" TIMESTAMP,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "cc_access" IS '';
|
||||
|
||||
|
||||
SET search_path TO public;
|
||||
CREATE INDEX "cc_access_gunid_idx" ON "cc_access" ("gunid");
|
||||
|
||||
CREATE INDEX "cc_access_parent_idx" ON "cc_access" ("parent");
|
||||
|
||||
CREATE INDEX "cc_access_token_idx" ON "cc_access" ("token");
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- cc_music_dirs
|
||||
-----------------------------------------------------------------------------
|
||||
|
@ -62,7 +31,6 @@ DROP TABLE "cc_files" CASCADE;
|
|||
CREATE TABLE "cc_files"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"gunid" CHAR(32) NOT NULL,
|
||||
"name" VARCHAR(255) default '' NOT NULL,
|
||||
"mime" VARCHAR(255) default '' NOT NULL,
|
||||
"ftype" VARCHAR(128) default '' NOT NULL,
|
||||
|
@ -125,8 +93,7 @@ CREATE TABLE "cc_files"
|
|||
"soundcloud_link_to_file" VARCHAR(4096),
|
||||
"soundcloud_upload_time" TIMESTAMP(6),
|
||||
"replay_gain" VARCHAR(16),
|
||||
PRIMARY KEY ("id"),
|
||||
CONSTRAINT "cc_files_gunid_idx" UNIQUE ("gunid")
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "cc_files" IS '';
|
||||
|
@ -444,6 +411,7 @@ CREATE TABLE "cc_schedule"
|
|||
"starts" TIMESTAMP NOT NULL,
|
||||
"ends" TIMESTAMP NOT NULL,
|
||||
"file_id" INTEGER,
|
||||
"stream_id" INTEGER,
|
||||
"clip_length" interval default '00:00:00',
|
||||
"fade_in" TIME default '00:00:00',
|
||||
"fade_out" TIME default '00:00:00',
|
||||
|
@ -652,8 +620,30 @@ COMMENT ON TABLE "cc_live_log" IS '';
|
|||
|
||||
|
||||
SET search_path TO public;
|
||||
ALTER TABLE "cc_access" ADD CONSTRAINT "cc_access_owner_fkey" FOREIGN KEY ("owner") REFERENCES "cc_subjs" ("id");
|
||||
-----------------------------------------------------------------------------
|
||||
-- cc_webstream
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE "cc_webstream" CASCADE;
|
||||
|
||||
|
||||
CREATE TABLE "cc_webstream"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"name" VARCHAR(255) NOT NULL,
|
||||
"description" VARCHAR(255) NOT NULL,
|
||||
"url" VARCHAR(255) NOT NULL,
|
||||
"length" interval default '00:00:00' NOT NULL,
|
||||
"login" VARCHAR(255) NOT NULL,
|
||||
"mtime" TIMESTAMP(6) NOT NULL,
|
||||
"utime" TIMESTAMP(6) NOT NULL,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "cc_webstream" IS '';
|
||||
|
||||
|
||||
SET search_path TO public;
|
||||
ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");
|
||||
|
||||
ALTER TABLE "cc_files" ADD CONSTRAINT "cc_music_dirs_folder_fkey" FOREIGN KEY ("directory") REFERENCES "cc_music_dirs" ("id");
|
||||
|
@ -696,6 +686,8 @@ ALTER TABLE "cc_schedule" ADD CONSTRAINT "cc_show_inst_fkey" FOREIGN KEY ("insta
|
|||
|
||||
ALTER TABLE "cc_schedule" ADD CONSTRAINT "cc_show_file_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_schedule" ADD CONSTRAINT "cc_show_stream_fkey" FOREIGN KEY ("stream_id") REFERENCES "cc_webstream" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey" FOREIGN KEY ("userid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_subjs_token" ADD CONSTRAINT "cc_subjs_token_userid_fkey" FOREIGN KEY ("user_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
||||
|
|
|
@ -449,4 +449,4 @@ div.helper li {
|
|||
|
||||
li.spl_empty {
|
||||
height: 56px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,8 +30,9 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
if (aData.ftype === "audioclip") {
|
||||
$nRow.addClass("lib-audio");
|
||||
}
|
||||
else {
|
||||
} else if (aData.ftype === "stream"){
|
||||
$nRow.addClass("lib-stream");
|
||||
} else {
|
||||
$nRow.addClass("lib-pl");
|
||||
}
|
||||
|
||||
|
@ -45,7 +46,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
mod.redrawChosen();
|
||||
mod.checkToolBarIcons();
|
||||
|
||||
$('#library_display tr.lib-audio').draggable({
|
||||
$('#library_display tr.lib-audio, tr.lib-stream, tr.lib-pl').draggable({
|
||||
helper: function(){
|
||||
|
||||
var $el = $(this),
|
||||
|
|
|
@ -27,11 +27,12 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.fnRowCallback = function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
var $nRow = $(nRow);
|
||||
|
||||
|
||||
if (aData.ftype === "audioclip") {
|
||||
$nRow.addClass("lib-audio");
|
||||
}
|
||||
else {
|
||||
} else if (aData.ftype === "stream"){
|
||||
$nRow.addClass("lib-stream");
|
||||
} else {
|
||||
$nRow.addClass("lib-pl");
|
||||
}
|
||||
|
||||
|
@ -45,7 +46,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
mod.redrawChosen();
|
||||
mod.checkToolBarIcons();
|
||||
|
||||
$('#library_display tr.lib-audio, tr.lib-pl').draggable({
|
||||
$('#library_display tr.lib-audio, tr.lib-pl, tr.lib-stream').draggable({
|
||||
helper: function(){
|
||||
|
||||
var $el = $(this),
|
||||
|
@ -178,4 +179,4 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
}(AIRTIME || {}));
|
||||
|
|
|
@ -40,7 +40,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
cItem,
|
||||
i, length,
|
||||
count = 0,
|
||||
reAudio=/^au/ ;
|
||||
reAudio=/^(au|st|pl)/ ;
|
||||
|
||||
// Get visible items and check if any chosenItems are visible
|
||||
$trs = $libTable.find("tbody input:checkbox").parents("tr");
|
||||
|
@ -614,11 +614,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
else {
|
||||
callback = function() {
|
||||
if (data.ftype === "playlist") {
|
||||
AIRTIME.playlist.fnEdit(data.id, 'playlist');
|
||||
} else {
|
||||
AIRTIME.playlist.fnEdit(data.id, 'block');
|
||||
}
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype);
|
||||
};
|
||||
}
|
||||
oItems.edit.callback = callback;
|
||||
|
|
|
@ -488,7 +488,39 @@ var AIRTIME = (function(AIRTIME){
|
|||
$fs.addClass("closed");
|
||||
}
|
||||
});
|
||||
|
||||
$pl.on("click", "#webstream_save", function(){
|
||||
//get all fields and POST to server
|
||||
//description
|
||||
//stream url
|
||||
//default_length
|
||||
//playlist name
|
||||
var description = $pl.find("#description").val();
|
||||
var streamurl = $pl.find("#streamurl-element input").val();
|
||||
var length = $pl.find("#streamlength-element input").val();
|
||||
var name = $pl.find("#playlist_name_display").text();
|
||||
|
||||
var url = 'Webstream/save';
|
||||
$.post(url,
|
||||
{format: "json", description: description, url:streamurl, length: length, name: name},
|
||||
function(json){
|
||||
console.log(json);
|
||||
|
||||
/*
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
} else {
|
||||
setModified(json.modified);
|
||||
textarea.val(json.description);
|
||||
$pl.find("#fieldset-metadate_change").addClass("closed");
|
||||
redrawLib();
|
||||
} */
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
)
|
||||
$pl.on("click", "#description_save", function(){
|
||||
var textarea = $pl.find("#fieldset-metadate_change textarea"),
|
||||
description = textarea.val(),
|
||||
|
@ -543,9 +575,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
aSelected = AIRTIME.library.getSelectedData();
|
||||
|
||||
for (i = 0, length = aSelected.length; i < length; i++) {
|
||||
if (aSelected[i].ftype === "audioclip") {
|
||||
aItems.push(aSelected[i].id);
|
||||
}
|
||||
var type = aSelected[i].ftype;
|
||||
aItems.push(new Array(aSelected[i].id, type));
|
||||
}
|
||||
|
||||
aReceiveItems = aItems;
|
||||
|
@ -627,6 +658,19 @@ var AIRTIME = (function(AIRTIME){
|
|||
redrawLib();
|
||||
});
|
||||
};
|
||||
|
||||
mod.fnWsNew = function() {
|
||||
var url = '/Webstream/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
$.post(url,
|
||||
{format: "json"},
|
||||
function(json){
|
||||
openPlaylist(json);
|
||||
redrawLib();
|
||||
});
|
||||
};
|
||||
|
||||
mod.fnNewBlock = function() {
|
||||
var url = '/Playlist/new';
|
||||
|
@ -733,7 +777,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.fnAddItems = function(aItems, iAfter, sAddType) {
|
||||
var sUrl = "/playlist/add-items";
|
||||
oData = {"ids": aItems, "afterItem": iAfter, "type": sAddType};
|
||||
oData = {"aItems": aItems, "afterItem": iAfter, "type": sAddType};
|
||||
|
||||
playlistRequest(sUrl, oData);
|
||||
};
|
||||
|
@ -759,13 +803,16 @@ var AIRTIME = (function(AIRTIME){
|
|||
ignoreRightClick: true,
|
||||
items: {
|
||||
"sp": {name: "New Playlist", callback: AIRTIME.playlist.fnNew},
|
||||
"sb": {name: "New Smart Block", callback: AIRTIME.playlist.fnNewBlock}
|
||||
"sb": {name: "New Smart Playlist", callback: AIRTIME.playlist.fnNewBlock}
|
||||
}
|
||||
});
|
||||
/*
|
||||
$pl.delegate("#spl_new",
|
||||
{"click": AIRTIME.playlist.fnNew});*/
|
||||
|
||||
$pl.delegate("#ws_new",
|
||||
{"click": AIRTIME.playlist.fnWsNew});
|
||||
|
||||
$pl.delegate("#spl_delete", {"click": function(ev){
|
||||
AIRTIME.playlist.fnDelete();
|
||||
}});
|
||||
|
|
|
@ -295,7 +295,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
|
||||
mod.fnServerData = function fnBuilderServerData( sSource, aoData, fnCallback ) {
|
||||
|
||||
|
||||
aoData.push( { name: "timestamp", value: mod.getTimestamp()} );
|
||||
aoData.push( { name: "instances", value: mod.getShowInstances()} );
|
||||
aoData.push( { name: "format", value: "json"} );
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash -e
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
cd $SCRIPTPATH/../airtime_mvc/
|
||||
path=`pwd`
|
||||
cd build
|
||||
sed -i s#"project\.home =.*$"#"project.home = $path"#g build.properties
|
||||
../library/propel/generator/bin/propel-gen
|
|
@ -24,7 +24,6 @@ Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-co
|
|||
|
||||
echo PHP_EOL;
|
||||
echo "* Uninstalling Airtime ".AIRTIME_VERSION.PHP_EOL;
|
||||
//AirtimeInstall::UninstallPhpCode();
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Delete the database
|
||||
|
@ -88,11 +87,3 @@ if ($results == 0) {
|
|||
echo " * Nothing to delete.".PHP_EOL;
|
||||
}
|
||||
|
||||
//AirtimeInstall::RemoveSymlinks();
|
||||
//AirtimeInstall::UninstallBinaries();
|
||||
//AirtimeInstall::RemoveLogDirectories();
|
||||
//AirtimeInstall::removeVirtualEnvDistributeFile();
|
||||
//AirtimeIni::RemoveMonitFile();
|
||||
//@unlink('/etc/cron.d/airtime-crons');
|
||||
|
||||
/* FINISHED AIRTIME PHP UNINSTALLER */
|
||||
|
|
|
@ -8,18 +8,19 @@ def generate_liquidsoap_config(ss):
|
|||
fh.write("################################################\n")
|
||||
fh.write("# THIS FILE IS AUTO GENERATED. DO NOT CHANGE!! #\n")
|
||||
fh.write("################################################\n")
|
||||
for d in data:
|
||||
|
||||
for d in data:
|
||||
key = d['keyname']
|
||||
|
||||
str_buffer = d[u'keyname'] + " = "
|
||||
if(d[u'type'] == 'string'):
|
||||
if d[u'type'] == 'string':
|
||||
val = '"%s"' % d['value']
|
||||
else:
|
||||
val = d[u'value']
|
||||
val = val if len(val) > 0 else "0"
|
||||
str_buffer = "%s = %s\n" % (key, val)
|
||||
fh.write(str_buffer.encode('utf-8'))
|
||||
|
||||
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
||||
fh.close()
|
||||
|
||||
|
|
|
@ -227,3 +227,80 @@ def add_skip_command(s)
|
|||
description="Skip the current song.",
|
||||
"skip",skip)
|
||||
end
|
||||
|
||||
dyn_out = output.icecast(%wav,
|
||||
host="localhost",
|
||||
port=8999,
|
||||
password="hackme",
|
||||
mount="test-harbor",
|
||||
fallible=true)
|
||||
|
||||
# Function to create a playlist source and output it.
|
||||
def create_dynamic_source(uri) =
|
||||
# The playlist source
|
||||
s = input.http(uri)
|
||||
|
||||
# The output
|
||||
active_dyn_out = dyn_out(s)
|
||||
|
||||
# We register both source and output
|
||||
# in the list of sources
|
||||
dyn_sources :=
|
||||
list.append( [(uri,s),(uri,active_dyn_out)],
|
||||
!dyn_sources )
|
||||
"Done!"
|
||||
end
|
||||
|
||||
# A function to destroy a dynamic source
|
||||
def destroy_dynamic_source(uri) =
|
||||
# We need to find the source in the list,
|
||||
# remove it and destroy it. Currently, the language
|
||||
# lacks some nice operators for that so we do it
|
||||
# the functional way
|
||||
|
||||
# This function is executed on every item in the list
|
||||
# of dynamic sources
|
||||
def parse_list(ret, current_element) =
|
||||
# ret is of the form: (matching_sources, remaining_sources)
|
||||
# We extract those two:
|
||||
matching_sources = fst(ret)
|
||||
remaining_sources = snd(ret)
|
||||
|
||||
# current_element is of the form: ("uri", source) so
|
||||
# we check the first element
|
||||
current_uri = fst(current_element)
|
||||
if current_uri == uri then
|
||||
# In this case, we add the source to the list of
|
||||
# matched sources
|
||||
(list.append( [snd(current_element)],
|
||||
matching_sources),
|
||||
remaining_sources)
|
||||
else
|
||||
# In this case, we put the element in the list of remaining
|
||||
# sources
|
||||
(matching_sources,
|
||||
list.append([current_element],
|
||||
remaining_sources))
|
||||
end
|
||||
end
|
||||
|
||||
# Now we execute the function:
|
||||
result = list.fold(parse_list, ([], []), !dyn_sources)
|
||||
matching_sources = fst(result)
|
||||
remaining_sources = snd(result)
|
||||
|
||||
# We store the remaining sources in dyn_sources
|
||||
dyn_sources := remaining_sources
|
||||
|
||||
# If no source matched, we return an error
|
||||
if list.length(matching_sources) == 0 then
|
||||
"Error: no matching sources!"
|
||||
else
|
||||
# We stop all sources
|
||||
list.iter(source.shutdown, matching_sources)
|
||||
# And return
|
||||
"Done!"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -6,14 +6,23 @@ set("log.stdout", true)
|
|||
set("server.telnet", true)
|
||||
set("server.telnet.port", 1234)
|
||||
|
||||
#Dynamic source list
|
||||
dyn_sources = ref []
|
||||
|
||||
time = ref string_of(gettimeofday())
|
||||
|
||||
queue = audio_to_stereo(id="queue_src", request.equeue(id="queue", length=0.5))
|
||||
queue = cue_cut(queue)
|
||||
queue = amplify(1., override="replay_gain", queue)
|
||||
|
||||
#fallback between queue and input.harbor (for restreaming other web-streams)
|
||||
#live stream setup
|
||||
set("harbor.bind_addr", "0.0.0.0")
|
||||
|
||||
#TODO: Need to create a randomized password for every instance
|
||||
web_stream = input.harbor("test-harbor",port=8999,password="hackme")
|
||||
|
||||
pypo_data = ref '0'
|
||||
web_stream_enabled = ref false
|
||||
stream_metadata_type = ref 0
|
||||
default_dj_fade = ref 0.
|
||||
station_name = ref ''
|
||||
|
@ -33,17 +42,27 @@ queue = on_metadata(notify, queue)
|
|||
queue = map_metadata(append_title, queue)
|
||||
# the crossfade function controls fade in/out
|
||||
queue = crossfade(queue)
|
||||
|
||||
queue = fallback([web_stream, queue])
|
||||
ignore(output.dummy(queue, fallible=true))
|
||||
|
||||
server.register(namespace="vars", "pypo_data", fun (s) -> begin pypo_data := s "Done" end)
|
||||
server.register(namespace="vars", "web_stream_enabled", fun (s) -> begin web_stream_enabled := (s == "true") string_of(!web_stream_enabled) end)
|
||||
server.register(namespace="vars", "stream_metadata_type", fun (s) -> begin stream_metadata_type := int_of_string(s) s end)
|
||||
server.register(namespace="vars", "show_name", fun (s) -> begin show_name := s s end)
|
||||
server.register(namespace="vars", "station_name", fun (s) -> begin station_name := s s end)
|
||||
server.register(namespace="vars", "bootup_time", fun (s) -> begin time := s s end)
|
||||
server.register(namespace="streams", "connection_status", fun (s) -> begin "1:#{!s1_connected},2:#{!s2_connected},3:#{!s3_connected}" end)
|
||||
server.register(namespace="vars", "default_dj_fade", fun (s) -> begin default_dj_fade := float_of_string(s) s end)
|
||||
|
||||
server.register(namespace="dynamic_source",
|
||||
description="Start a new dynamic source.",
|
||||
usage="start <uri>",
|
||||
"start",
|
||||
create_dynamic_source)
|
||||
server.register(namespace="dynamic_source",
|
||||
description="Stop a dynamic source.",
|
||||
usage="stop <uri>",
|
||||
"stop",
|
||||
destroy_dynamic_source)
|
||||
|
||||
default = amplify(id="silence_src", 0.00001, noise())
|
||||
default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)
|
||||
|
@ -78,9 +97,6 @@ def make_scheduled_play_unavailable()
|
|||
scheduled_play_enabled := false
|
||||
end
|
||||
|
||||
#live stream setup
|
||||
set("harbor.bind_addr", "0.0.0.0")
|
||||
|
||||
def update_source_status(sourcename, status) =
|
||||
system("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --source-name=#{sourcename} --source-status=#{status} &")
|
||||
log("/usr/lib/airtime/pypo/bin/liquidsoap_scripts/notify.sh --source-name=#{sourcename} --source-status=#{status} &")
|
||||
|
@ -120,13 +136,8 @@ def check_dj_client(user,password) =
|
|||
#get the output of the php script
|
||||
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}")
|
||||
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
||||
ret = list.hd(ret)
|
||||
#return true to let the client transmit data, or false to tell harbor to decline
|
||||
if (ret == "True") then
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
hd = list.hd(ret)
|
||||
hd == "True"
|
||||
end
|
||||
|
||||
def append_dj_inputs(master_harbor_input_port, master_harbor_input_mount_point, dj_harbor_input_port, dj_harbor_input_mount_point, s) =
|
||||
|
@ -166,20 +177,6 @@ s = append_dj_inputs(master_live_stream_port, master_live_stream_mp, dj_live_str
|
|||
|
||||
# Attach a skip command to the source s:
|
||||
|
||||
#web_stream_source = input.http(id="web_stream", autostart = false, buffer=0.5, max=20., "")
|
||||
|
||||
#once the stream is started, give it a sink so that liquidsoap doesn't
|
||||
#create buffer overflow warnings in the log file.
|
||||
#output.dummy(fallible=true, web_stream_source)
|
||||
|
||||
#s = switch(track_sensitive = false,
|
||||
# transitions=[to_live,to_live],
|
||||
# [
|
||||
# ({ !web_stream_enabled }, web_stream_source),
|
||||
# ({ true }, s)
|
||||
# ]
|
||||
#)
|
||||
|
||||
add_skip_command(s)
|
||||
|
||||
server.register(namespace="streams",
|
||||
|
|
|
@ -425,9 +425,14 @@ class PypoFetch(Thread):
|
|||
|
||||
for key in media:
|
||||
media_item = media[key]
|
||||
"""
|
||||
{u'end': u'2012-07-26-04-05-00', u'fade_out': 500, u'show_name': u'Untitled Show', u'uri': u'http://',
|
||||
u'cue_in': 0, u'start': u'2012-07-26-04-00-00', u'replay_gain': u'0', u'row_id': 16, u'cue_out': 300, u'type':
|
||||
u'stream', u'id': 1, u'fade_in': 500}
|
||||
"""
|
||||
if(media_item['type'] == 'file'):
|
||||
fileExt = os.path.splitext(media_item['uri'])[1]
|
||||
dst = os.path.join(download_dir, media_item['id'] + fileExt)
|
||||
dst = os.path.join(download_dir, unicode(media_item['id']) + fileExt)
|
||||
media_item['dst'] = dst
|
||||
media_item['file_ready'] = False
|
||||
media_filtered[key] = media_item
|
||||
|
@ -455,15 +460,19 @@ class PypoFetch(Thread):
|
|||
|
||||
for mkey in media:
|
||||
media_item = media[mkey]
|
||||
fileExt = os.path.splitext(media_item['uri'])[1]
|
||||
scheduled_file_set.add(media_item["id"] + fileExt)
|
||||
if media_item['type'] == 'file':
|
||||
fileExt = os.path.splitext(media_item['uri'])[1]
|
||||
scheduled_file_set.add(unicode(media_item["id"]) + fileExt)
|
||||
|
||||
unneeded_files = cached_file_set - scheduled_file_set
|
||||
expired_files = cached_file_set - scheduled_file_set
|
||||
|
||||
self.logger.debug("Files to remove " + str(unneeded_files))
|
||||
for f in unneeded_files:
|
||||
self.logger.debug("Removing %s" % os.path.join(self.cache_dir, f))
|
||||
os.remove(os.path.join(self.cache_dir, f))
|
||||
self.logger.debug("Files to remove " + str(expired_files))
|
||||
for f in expired_files:
|
||||
try:
|
||||
self.logger.debug("Removing %s" % os.path.join(self.cache_dir, f))
|
||||
os.remove(os.path.join(self.cache_dir, f))
|
||||
except Exception, e:
|
||||
self.logger.error(e)
|
||||
|
||||
def main(self):
|
||||
# Bootstrap: since we are just starting up, we need to grab the
|
||||
|
|
|
@ -241,8 +241,12 @@ class PypoPush(Thread):
|
|||
|
||||
for mkey in sorted_keys:
|
||||
media_item = media_schedule[mkey]
|
||||
if media_item['type'] == "event":
|
||||
if media_item['independent_event']:
|
||||
if len(current_chain) > 0:
|
||||
chains.append(current_chain)
|
||||
|
||||
chains.append([media_item])
|
||||
current_chain = []
|
||||
elif len(current_chain) == 0:
|
||||
current_chain.append(media_item)
|
||||
elif media_item['start'] == current_chain[-1]['end']:
|
||||
|
@ -353,9 +357,55 @@ class PypoPush(Thread):
|
|||
PypoFetch.disconnect_source(self.logger, self.telnet_lock, "live_dj")
|
||||
elif media_item['event_type'] == "switch_off":
|
||||
PypoFetch.switch_source(self.logger, self.telnet_lock, "live_dj", "off")
|
||||
elif media_item['type'] == "stream":
|
||||
"""
|
||||
Source is a stream that we need to being downloading to a file. Then we may simply
|
||||
point Liquidsoap to play this file.
|
||||
"""
|
||||
self.start_web_stream(media_item)
|
||||
elif media_item['type'] == "stream_end":
|
||||
self.stop_web_stream(media_item)
|
||||
except Exception, e:
|
||||
self.logger.error('Pypo Push Exception: %s', e)
|
||||
|
||||
def start_web_stream(self, media_item):
|
||||
try:
|
||||
self.telnet_lock.acquire()
|
||||
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
|
||||
#dynamic_source.start http://87.230.101.24:80/top100station.mp3
|
||||
|
||||
msg = 'streams.scheduled_play_start\n'
|
||||
tn.write(msg)
|
||||
msg = 'dynamic_source.start %s\n' % media_item['uri'].encode('latin-1')
|
||||
self.logger.debug(msg)
|
||||
tn.write(msg)
|
||||
|
||||
tn.write("exit\n")
|
||||
self.logger.debug(tn.read_all())
|
||||
|
||||
except Exception, e:
|
||||
self.logger.error(str(e))
|
||||
finally:
|
||||
self.telnet_lock.release()
|
||||
|
||||
def stop_web_stream(self, media_item):
|
||||
try:
|
||||
self.telnet_lock.acquire()
|
||||
tn = telnetlib.Telnet(LS_HOST, LS_PORT)
|
||||
#dynamic_source.stop http://87.230.101.24:80/top100station.mp3
|
||||
|
||||
msg = 'dynamic_source.stop %s\n' % media_item['uri'].encode('latin-1')
|
||||
self.logger.debug(msg)
|
||||
tn.write(msg)
|
||||
|
||||
tn.write("exit\n")
|
||||
self.logger.debug(tn.read_all())
|
||||
|
||||
except Exception, e:
|
||||
self.logger.error(str(e))
|
||||
finally:
|
||||
self.telnet_lock.release()
|
||||
|
||||
def clear_liquidsoap_queue(self):
|
||||
self.logger.debug("Clearing Liquidsoap queue")
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue