Merge branch 'cc-1799-put-airtime-storage-into-a-human-readable-file-naming-convention' into devel

Conflicts:
	airtime_mvc/application/controllers/PreferenceController.php
	airtime_mvc/application/models/Preference.php
	airtime_mvc/application/views/scripts/form/preferences.phtml
	airtime_mvc/public/js/airtime/preferences/preferences.js
This commit is contained in:
Naomi Aro 2011-06-21 11:20:35 +02:00
commit 253eb811c7
42 changed files with 3966 additions and 499 deletions

View File

@ -127,6 +127,7 @@
<formFile formName="AddShowAbsoluteRebroadcastDates"/>
<formFile formName="SoundcloudPreferences"/>
<formFile formName="GeneralPreferences"/>
<formFile formName="WatchedDirPreferences"/>
</formsDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory>
@ -378,18 +379,18 @@
<testApplicationDirectory>
<testApplicationBootstrapFile filesystemName="bootstrap.php"/>
<testApplicationControllerDirectory>
<testApplicationControllerFile filesystemName="PlaylistControllerTest.php"/>
<testApplicationControllerFile filesystemName="LibraryControllerTest.php"/>
<testApplicationControllerFile filesystemName="PluploadControllerTest.php"/>
<testApplicationControllerFile filesystemName="SearchControllerTest.php"/>
<testApplicationControllerFile filesystemName="LoginControllerTest.php"/>
<testApplicationControllerFile filesystemName="ScheduleControllerTest.php"/>
<testApplicationControllerFile filesystemName="ApiControllerTest.php"/>
<testApplicationControllerFile filesystemName="UserControllerTest.php"/>
<testApplicationControllerFile filesystemName="NowplayingControllerTest.php"/>
<testApplicationControllerFile filesystemName="PreferenceControllerTest.php"/>
<testApplicationControllerFile filesystemName="DashboardControllerTest.php"/>
<testApplicationControllerFile filesystemName="RecorderControllerTest.php"/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
<testApplicationControllerFile/>
</testApplicationControllerDirectory>
</testApplicationDirectory>
<testLibraryDirectory>

View File

@ -16,6 +16,7 @@ require_once __DIR__."/configs/conf.php";
require_once 'DB.php';
require_once 'Soundcloud.php';
require_once 'MusicDir.php';
require_once 'Playlist.php';
require_once 'StoredFile.php';
require_once 'Schedule.php';

View File

@ -8,6 +8,13 @@ return array (
'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',
'CcMusicDirsQuery' => 'airtime/CcMusicDirsQuery.php',
'BaseCcMusicDirsPeer' => 'airtime/om/BaseCcMusicDirsPeer.php',
'BaseCcMusicDirs' => 'airtime/om/BaseCcMusicDirs.php',
'BaseCcMusicDirsQuery' => 'airtime/om/BaseCcMusicDirsQuery.php',
'CcFilesTableMap' => 'airtime/map/CcFilesTableMap.php',
'CcFilesPeer' => 'airtime/CcFilesPeer.php',
'CcFiles' => 'airtime/CcFiles.php',

View File

@ -52,6 +52,12 @@ $pages = array(
'controller' => 'user',
'action' => 'add-user',
'resource' => 'user'
),
array(
'label' => 'Manage Music Folders',
'module' => 'default',
'controller' => 'Preference',
'action' => 'directory-config'
)
)
),

View File

@ -468,6 +468,9 @@ class ApiController extends Zend_Controller_Action
return;
}
else {
$filepath = $md['MDATA_KEY_FILEPATH'];
$filepath = str_replace("\\", "", $filepath);
$file->setFilePath($filepath);
$file->setMetadata($md);
}
}

View File

@ -9,6 +9,9 @@ class PreferenceController extends Zend_Controller_Action
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('register', 'json')
->addActionContext('remindme', 'json')
->addActionContext('server-browse', 'json')
->addActionContext('reload-watch-directory', 'json')
->addActionContext('remove-watch-directory', 'json')
->initContext();
}
@ -40,27 +43,27 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetSoundCloudTags($values["preferences_soundcloud"]["SoundCloudTags"]);
Application_Model_Preference::SetSoundCloudGenre($values["preferences_soundcloud"]["SoundCloudGenre"]);
Application_Model_Preference::SetSoundCloudTrackType($values["preferences_soundcloud"]["SoundCloudTrackType"]);
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
Application_Model_Preference::SetPhone($values["preferences_support"]["Phone"]);
Application_Model_Preference::SetEmail($values["preferences_support"]["Email"]);
Application_Model_Preference::SetStationWebSite($values["preferences_support"]["StationWebSite"]);
Application_Model_Preference::SetSupportFeedback($values["preferences_support"]["SupportFeedback"]);
Application_Model_Preference::SetPublicise($values["preferences_support"]["Publicise"]);
$imagePath = $form->getSubForm('preferences_support')->Logo->getFileName();
Application_Model_Preference::SetStationCountry($values["preferences_support"]["Country"]);
Application_Model_Preference::SetStationCity($values["preferences_support"]["City"]);
Application_Model_Preference::SetStationDescription($values["preferences_support"]["Description"]);
Application_Model_Preference::SetStationLogo($imagePath);
$data = array();
$data["directory"] = $values["preferences_general"]["watchedFolder"];
RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
Application_Model_Preference::SetSoundCloudLicense($values["preferences_soundcloud"]["SoundCloudLicense"]);
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
}
}
}
$this->view->supportFeedback = Application_Model_Preference::GetSupportFeedback();
$logo = Application_Model_Preference::GetStationLogo();
@ -69,17 +72,17 @@ class PreferenceController extends Zend_Controller_Action
}
$this->view->form = $form;
}
public function registerAction(){
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript');
$form = new Application_Form_RegisterAirtime();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$values = $form->getValues();
@ -89,9 +92,9 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetEmail($values["Email"]);
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
Application_Model_Preference::SetPublicise($values["Publicise"]);
$imagePath = $form->Logo->getFileName();
Application_Model_Preference::SetStationCountry($values["Country"]);
Application_Model_Preference::SetStationCity($values["City"]);
Application_Model_Preference::SetStationDescription($values["Description"]);
@ -100,25 +103,108 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
// unset session
Zend_Session::namespaceUnset('referrer');
$this->_redirect('Nowplaying');
}else{
$logo = Application_Model_Preference::GetStationLogo();
if($logo){
$this->view->logoImg = $logo;
}
$this->view->dialog = $form->render($this->view);
}
}
public function remindmeAction(){
public function remindmeAction()
{
// unset session
Zend_Session::namespaceUnset('referrer');
$now = date("Y-m-d H:i:s");
Application_Model_Preference::SetRemindMeDate($now);
die();
}
public function directoryConfigAction()
{
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/serverbrowse/serverbrowser.js','text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/preferences.js','text/javascript');
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
$watched_dirs_pref->setWatchedDirs();
$this->view->form = $watched_dirs_pref;
}
public function serverBrowseAction()
{
$request = $this->getRequest();
$path = $request->getParam("path", null);
$result = array();
if(is_null($path))
{
$element = array();
$element["name"] = "path should be specified";
$element["isFolder"] = false;
$element["isError"] = true;
$result[$path] = $element;
}
else
{
$path = $path.'/';
$handle = opendir($path);
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
//only show directories that aren't private.
if (is_dir($path.$file) && substr($file, 0, 1) != ".") {
$element = array();
$element["name"] = $file;
$element["isFolder"] = true;
$element["isError"] = false;
$result[$file] = $element;
}
}
}
}
ksort($result);
//returns format serverBrowse is looking for.
die(json_encode($result));
}
public function reloadWatchDirectoryAction()
{
$chosen = $this->getRequest()->getParam("dir");
$watched_dirs_form = new Application_Form_WatchedDirPreferences();
$watched_dirs_form->populate(array('watchedFolder' => $chosen));
$bool = $watched_dirs_form->verifyChosenFolder();
if ($bool === true) {
MusicDir::addWatchedDir($chosen);
$data = array();
$data["directory"] = $chosen;
RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
}
$watched_dirs_form->setWatchedDirs();
$this->view->subform = $watched_dirs_form->render();
}
public function removeWatchDirectoryAction()
{
$chosen = $this->getRequest()->getParam("dir");
$dir = MusicDir::getDirByPath($chosen);
$dir->remove();
$data = array();
$data["directory"] = $chosen;
RabbitMq::SendMessageToMediaMonitor("remove_watch", $data);
}
}

View File

@ -59,17 +59,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$third_party_api->setDecorators(array('ViewHelper'));
$this->addElement($third_party_api);
//Default station fade
$this->addElement('text', 'watchedFolder', array(
'class' => 'input_text',
'label' => 'WatchedFolder:',
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetWatchedDirectory(),
'decorators' => array(
'ViewHelper'
)
));
}

View File

@ -11,7 +11,7 @@ class Application_Form_Preferences extends Zend_Form
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences.phtml'))
));
$general_pref = new Application_Form_GeneralPreferences();
$this->addSubForm($general_pref, 'preferences_general');
@ -28,6 +28,6 @@ class Application_Form_Preferences extends Zend_Form
'decorators' => array(
'ViewHelper'
)
));
));
}
}

View File

@ -0,0 +1,58 @@
<?php
class Application_Form_WatchedDirPreferences extends Zend_Form_SubForm
{
public function init()
{
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/preferences_watched_dirs.phtml'))
));
$this->addElement('text', 'watchedFolder', array(
'class' => 'input_text',
'label' => 'Choose a Folder to Watch:',
'required' => false,
'filters' => array('StringTrim'),
'value' => '',
'decorators' => array(
'ViewHelper'
)
));
}
public function verifyChosenFolder() {
$element = $this->getElement('watchedFolder');
if (!is_dir($element->getValue())) {
$element->setErrors(array('Not a valid Directory'));
return false;
}
else {
$element->setValue("");
return true;
}
}
public function setWatchedDirs() {
$watched_dirs = MusicDir::getWatchedDirs();
$i = 1;
foreach($watched_dirs as $dir) {
$text = new Zend_Form_Element_Text("watched_dir_$i");
$text->setAttrib('class', 'input_text');
$text->addFilter('StringTrim');
$text->setValue($dir->getDirectory());
$text->setDecorators(array('ViewHelper'));
$this->addElement($text);
$i = $i + 1;
}
}
}

View File

@ -0,0 +1,148 @@
<?php
class MusicDir {
/**
* @holds propel database object
*/
private $_dir;
public function __construct()
{
}
public function getId()
{
return $this->_dir->getId();
}
public function getType()
{
return $this->_dir->getType();
}
public function setType($type)
{
$this->_dir->setType($type);
}
public function getDirectory()
{
return $this->_dir->getDirectory();
}
public function setDirectory($dir)
{
$this->_dir->setDirectory($dir);
}
public function remove()
{
$this->_dir->delete();
}
public static function addDir($p_path, $p_type)
{
$dir = new CcMusicDirs();
$dir->setType($p_type);
$dir->setDirectory($p_path);
$dir->save();
$mus_dir = new MusicDir();
$mus_dir->_dir = $dir;
return $mus_dir;
}
public static function addWatchedDir($p_path)
{
return self::addDir($p_path, "watched");
}
public static function getDirByPK($pk)
{
$dir = CcMusicDirQuery::create()->findPK($pk);
$mus_dir = new MusicDir();
$mus_dir->_dir = $dir;
return $mus_dir;
}
public static function getDirByPath($p_path)
{
$dir = CcMusicDirsQuery::create()
->filterByDirectory($p_path)
->findOne();
$mus_dir = new MusicDir();
$mus_dir->_dir = $dir;
return $mus_dir;
}
public static function getWatchedDirs()
{
$result = array();
$dirs = CcMusicDirsQuery::create()
->filterByType("watched")
->find();
foreach($dirs as $dir) {
$tmp = new MusicDir();
$tmp->_dir = $dir;
$result[] = $tmp;
}
return $result;
}
public static function getStorDir()
{
$dir = CcMusicDirsQuery::create()
->filterByType("stor")
->findOne();
$mus_dir = new MusicDir();
$mus_dir->_dir = $dir;
return $mus_dir;
}
public static function getWatchedDirFromFilepath($p_filepath)
{
$dirs = CcMusicDirsQuery::create()
->find();
foreach($dirs as $dir) {
$directory = $dir->getDirectory();
if (substr($p_filepath, 0, strlen($directory)) === $directory) {
$mus_dir = new MusicDir();
$mus_dir->_dir = $dir;
return $mus_dir;
}
}
return null;
}
public static function splitFilePath($p_filepath)
{
$mus_dir = self::getWatchedDirFromFilepath($p_filepath);
if(is_null($mus_dir)) {
return null;
}
$length_dir = strlen($mus_dir->getDirectory());
$length_filepath = strlen($p_filepath);
$length = $length_filepath - $length_dir;
$fp = substr($p_filepath, $length_dir+1, $length);
return array($mus_dir->getDirectory(), $fp);
}
}

View File

@ -188,79 +188,79 @@ class Application_Model_Preference
return $val;
}
}
public static function SetPhone($phone){
Application_Model_Preference::SetValue("phone", $phone);
}
public static function GetPhone(){
return Application_Model_Preference::GetValue("phone");
}
public static function SetEmail($email){
Application_Model_Preference::SetValue("email", $email);
}
public static function GetEmail(){
return Application_Model_Preference::GetValue("email");
}
public static function SetStationWebSite($site){
Application_Model_Preference::SetValue("station_website", $site);
}
public static function GetStationWebSite(){
return Application_Model_Preference::GetValue("station_website");
}
public static function SetSupportFeedback($feedback){
Application_Model_Preference::SetValue("support_feedback", $feedback);
}
public static function GetSupportFeedback(){
return Application_Model_Preference::GetValue("support_feedback");
}
public static function SetPublicise($publicise){
Application_Model_Preference::SetValue("publicise", $publicise);
}
public static function GetPublicise(){
return Application_Model_Preference::GetValue("publicise");
}
public static function SetRegistered($registered){
Application_Model_Preference::SetValue("registered", $registered);
}
public static function GetRegistered(){
return Application_Model_Preference::GetValue("registered");
}
public static function SetStationCountry($country){
Application_Model_Preference::SetValue("country", $country);
}
public static function GetStationCountry(){
return Application_Model_Preference::GetValue("country");
}
public static function SetStationCity($city){
Application_Model_Preference::SetValue("city", $city);
}
public static function GetStationCity(){
return Application_Model_Preference::GetValue("city");
}
public static function SetStationDescription($description){
Application_Model_Preference::SetValue("description", $description);
}
public static function GetStationDescription(){
return Application_Model_Preference::GetValue("description");
}
public static function SetStationLogo($imagePath){
if(!empty($imagePath)){
$image = file_get_contents($imagePath);
@ -268,15 +268,15 @@ class Application_Model_Preference
Application_Model_Preference::SetValue("logoImage", $image);
}
}
public static function GetStationLogo(){
return Application_Model_Preference::GetValue("logoImage");
}
public static function GetUniqueId(){
return Application_Model_Preference::GetValue("uniqueId");
}
public static function GetCountryList(){
global $CC_DBC;
$sql = "SELECT * FROM cc_country";
@ -287,24 +287,24 @@ class Application_Model_Preference
}
return $out;
}
public static function GetSystemInfo($returnArray=false){
exec('/usr/bin/airtime-check-system', $output);
$output = preg_replace('/\s+/', ' ', $output);
$systemInfoArray = array();
foreach( $output as $key => &$out){
$info = explode('=', $out);
if(isset($info[1])){
$key = str_replace(' ', '_', trim($info[0]));
$key = strtoupper($key);
$systemInfoArray[$key] = $info[1];
$systemInfoArray[$key] = $info[1];
}
}
$outputArray = array();
$outputArray['STATION_NAME'] = Application_Model_Preference::GetStationName();
$outputArray['PHONE'] = Application_Model_Preference::GetPhone();
$outputArray['EMAIL'] = Application_Model_Preference::GetEmail();
@ -312,24 +312,24 @@ class Application_Model_Preference
$outputArray['STATION_COUNTRY'] = Application_Model_Preference::GetStationCountry();
$outputArray['STATION_CITY'] = Application_Model_Preference::GetStationCity();
$outputArrat['STATION_DESCRIPTION'] = Application_Model_Preference::GetStationDescription();
// get web server info
$url = $systemInfoArray["AIRTIME_VERSION_URL"];
$index = strpos($url,'/api/');
$url = substr($url, 0, $index);
$headerInfo = get_headers(trim($url),1);
$outputArray['WEB_SERVER'] = $headerInfo['Server'][0];
$outputArray['NUM_OF_USERS'] = User::getUserCount();
$outputArray['NUM_OF_SONGS'] = StoredFile::getFileCount();
$outputArray['NUM_OF_PLAYLISTS'] = Playlist::getPlaylistCount();
$outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Schedule::getSchduledPlaylistCount();
$outputArray['NUM_OF_PAST_SHOWS'] = ShowInstance::GetShowInstanceCount(date("Y-m-d H:i:s"));
$outputArray['UNIQUE_ID'] = Application_Model_Preference::GetUniqueId();
$outputArray = array_merge($outputArray, $systemInfoArray);
$outputString = "\n";
foreach($outputArray as $key => $out){
$outputString .= $key.' : '.$out."\n";
@ -341,22 +341,14 @@ class Application_Model_Preference
return $outputString;
}
}
public static function SetRemindMeDate($now){
$weekAfter = mktime(0, 0, 0, date("m") , date("d")+7, date("Y"));
Application_Model_Preference::SetValue("remindme", $weekAfter);
}
public static function GetRemindMeDate(){
return Application_Model_Preference::GetValue("remindme");
}
public static function SetWatchedDirectory($directory) {
Application_Model_Preference::SetValue("watched_directory", $directory);
}
public static function GetWatchedDirectory() {
return Application_Model_Preference::GetValue("watched_directory");
}
}

View File

@ -39,7 +39,6 @@ class StoredFile {
"bit_rate" => "DbBitRate",
"sample_rate" => "DbSampleRate",
"mime" => "DbMime",
"filepath" => "DbFilepath",
"md5" => "DbMd5",
"ftype" => "DbFtype"
);
@ -119,9 +118,11 @@ class StoredFile {
if($dbColumn == "track_title" && (is_null($mdValue) || $mdValue == "")) {
continue;
}
$propelColumn = $this->_dbMD[$dbColumn];
$method = "set$propelColumn";
$this->_file->$method($mdValue);
if (isset($this->_dbMD[$dbColumn])) {
$propelColumn = $this->_dbMD[$dbColumn];
$method = "set$propelColumn";
$this->_file->$method($mdValue);
}
}
}
@ -155,10 +156,12 @@ class StoredFile {
if($p_category == "track_title" && (is_null($p_value) || $p_value == "")) {
return;
}
$propelColumn = $this->_dbMD[$p_category];
$method = "set$propelColumn";
$this->_file->$method($p_value);
$this->_file->save();
if (isset($this->_dbMD[$dbColumn])) {
$propelColumn = $this->_dbMD[$p_category];
$method = "set$propelColumn";
$this->_file->$method($p_value);
$this->_file->save();
}
}
/**
@ -409,7 +412,28 @@ class StoredFile {
*/
public function getFilePath()
{
return $this->_file->getDbFilepath();
$music_dir = MusicDir::getDirByPK($this->_file->getDbDirectory());
$filepath = $this->_file->getDbFilepath();
return $music_dir->getDirectory()."/".$filepath;
}
/**
* Set real filename of raw media data
*
* @return string
*/
public function setFilePath($p_filepath)
{
$path_info = MusicDir::splitFilePath($p_filepath);
if (is_null($path_info)) {
return -1;
}
$musicDir = MusicDir::getDirByPath($path_info[0]);
$this->_file->setDbDirectory($musicDir->getId());
$this->_file->setDbFilepath($path_info[1]);
$this->_file->save();
}
/**
@ -425,11 +449,20 @@ class StoredFile {
{
$file = new CcFiles();
$file->setDbGunid(md5(uniqid("", true)));
$file->save();
$storedFile = new StoredFile();
$storedFile->_file = $file;
if(isset($md['MDATA_KEY_FILEPATH'])) {
$res = $storedFile->setFilePath($md['MDATA_KEY_FILEPATH']);
if ($res === -1) {
return null;
}
}
else {
return null;
}
if(isset($md)) {
$storedFile->setMetadata($md);
}
@ -467,8 +500,15 @@ class StoredFile {
->findOne();
}
else if (isset($p_filepath)) {
$path_info = MusicDir::splitFilePath($p_filepath);
if (is_null($path_info)) {
return null;
}
$musicDir = MusicDir::getDirByPath($path_info[0]);
$file = CcFilesQuery::create()
->filterByDbFilepath($p_filepath)
->filterByDbDirectory($music_dir->getId())
->filterByDbFilepath($path_info[1])
->findOne();
}
else {
@ -766,8 +806,9 @@ class StoredFile {
}
else {
global $CC_CONFIG;
$stor = $CC_CONFIG["storageDir"];
$storDir = MusicDir::getStorDir();
$stor = $storDir->getDirectory();
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
$md = array();
@ -776,7 +817,6 @@ class StoredFile {
$md['MDATA_KEY_TITLE'] = $fileName;
StoredFile::Insert($md);
$r = @chmod($audio_file, 0666);
$r = @rename($audio_file, $audio_stor);
}

View File

@ -1,6 +1,6 @@
<?php
require_once('Common.php');
/**
* Skeleton subclass for representing a row from the 'cc_files' table.
@ -11,21 +11,8 @@ require_once('Common.php');
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.campcaster
* @package propel.generator.airtime
*/
class CcFiles extends BaseCcFiles {
public function getDbLength()
{
return $this->length;
}
public function setDbLength($time)
{
$this->length = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH;
return Common::setTimeInSub($this, 'LENGTH', $time);
}
} // CcFiles

View File

@ -0,0 +1,18 @@
<?php
/**
* Skeleton subclass for representing a row from the 'cc_music_dirs' 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 CcMusicDirs extends BaseCcMusicDirs {
} // CcMusicDirs

View File

@ -0,0 +1,18 @@
<?php
/**
* Skeleton subclass for performing query and update operations on the 'cc_music_dirs' 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 CcMusicDirsPeer extends BaseCcMusicDirsPeer {
} // CcMusicDirsPeer

View File

@ -0,0 +1,18 @@
<?php
/**
* Skeleton subclass for performing query and update operations on the 'cc_music_dirs' 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 CcMusicDirsQuery extends BaseCcMusicDirsQuery {
} // CcMusicDirsQuery

View File

@ -11,38 +11,8 @@
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.campcaster
* @package propel.generator.airtime
*/
class CcPlaylist extends BaseCcPlaylist {
public function computeLastPosition()
{
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
$sql = 'SELECT MAX('.CcPlaylistcontentsPeer::POSITION.') AS pos'
. ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME
. ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1';
$stmt = $con->prepare($sql);
$stmt->bindValue(':p1', $this->getDbId());
$stmt->execute();
return $stmt->fetchColumn();
}
public function computeLength()
{
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
$sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length'
. ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME
. ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1';
$stmt = $con->prepare($sql);
$stmt->bindValue(':p1', $this->getDbId());
$stmt->execute();
return $stmt->fetchColumn();
}
} // CcPlaylist

View File

@ -1,6 +1,6 @@
<?php
require_once('Common.php');
/**
* Skeleton subclass for representing a row from the 'cc_playlistcontents' table.
@ -11,71 +11,8 @@ require_once('Common.php');
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.campcaster
* @package propel.generator.airtime
*/
class CcPlaylistcontents extends BaseCcPlaylistcontents {
public function getDbFadein()
{
return $this->fadein;
}
public function setDbFadein($time)
{
$this->fadein = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
Common::setTimeInSub($this, 'FADEIN', $time);
}
public function getDbFadeout()
{
return $this->fadeout;
}
public function setDbFadeout($time)
{
$this->fadeout = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
Common::setTimeInSub($this, 'FADEOUT', $time);
}
public function getDbCuein()
{
return $this->cuein;
}
public function setDbCuein($time)
{
$this->cuein = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN;
Common::setTimeInSub($this, 'CUEIN', $time);
}
public function getDbCueout()
{
return $this->cueout;
}
public function setDbCueout($time)
{
$this->cueout = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT;
Common::setTimeInSub($this, 'CUEOUT', $time);
}
public function getDbCliplength()
{
return $this->cliplength;
}
public function setDbCliplength($time)
{
$this->cliplength = $time;
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH;
Common::setTimeInSub($this, 'CLIPLENGTH', $time);
}
} // CcPlaylistcontents

View File

@ -43,6 +43,7 @@ class CcFilesTableMap extends TableMap {
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
$this->addColumn('MIME', 'DbMime', 'VARCHAR', true, 255, '');
$this->addColumn('FTYPE', 'DbFtype', 'VARCHAR', true, 128, '');
$this->addForeignKey('DIRECTORY', 'DbDirectory', 'INTEGER', 'cc_music_dirs', 'ID', false, null, null);
$this->addColumn('FILEPATH', 'DbFilepath', 'LONGVARCHAR', false, null, '');
$this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty');
$this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
@ -101,6 +102,7 @@ class CcFilesTableMap extends TableMap {
public function buildRelations()
{
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null);
$this->addRelation('CcMusicDirs', 'CcMusicDirs', RelationMap::MANY_TO_ONE, array('directory' => 'id', ), null, null);
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
} // buildRelations()

View File

@ -0,0 +1,55 @@
<?php
/**
* This class defines the structure of the 'cc_music_dirs' 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 CcMusicDirsTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.CcMusicDirsTableMap';
/**
* 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_music_dirs');
$this->setPhpName('CcMusicDirs');
$this->setClassname('CcMusicDirs');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_music_dirs_id_seq');
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('DIRECTORY', 'Directory', 'LONGVARCHAR', false, null, null);
$this->addColumn('TYPE', 'Type', 'VARCHAR', false, 255, null);
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'directory', ), null, null);
} // buildRelations()
} // CcMusicDirsTableMap

View File

@ -57,6 +57,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
*/
protected $ftype;
/**
* The value for the directory field.
* @var int
*/
protected $directory;
/**
* The value for the filepath field.
* Note: this column has a database default value of: ''
@ -359,6 +365,11 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
*/
protected $aCcSubjs;
/**
* @var CcMusicDirs
*/
protected $aCcMusicDirs;
/**
* @var array CcShowInstances[] Collection to store aggregation of CcShowInstances objects.
*/
@ -459,6 +470,16 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->ftype;
}
/**
* Get the [directory] column value.
*
* @return int
*/
public function getDbDirectory()
{
return $this->directory;
}
/**
* Get the [filepath] column value.
*
@ -1095,6 +1116,30 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this;
} // setDbFtype()
/**
* Set the value of [directory] column.
*
* @param int $v new value
* @return CcFiles The current object (for fluent API support)
*/
public function setDbDirectory($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->directory !== $v) {
$this->directory = $v;
$this->modifiedColumns[] = CcFilesPeer::DIRECTORY;
}
if ($this->aCcMusicDirs !== null && $this->aCcMusicDirs->getId() !== $v) {
$this->aCcMusicDirs = null;
}
return $this;
} // setDbDirectory()
/**
* Set the value of [filepath] column.
*
@ -2198,55 +2243,56 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->mime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->ftype = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->filepath = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->state = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
$this->currentlyaccessing = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null;
$this->editedby = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
$this->mtime = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
$this->md5 = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
$this->track_title = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
$this->artist_name = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
$this->bit_rate = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
$this->sample_rate = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
$this->format = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
$this->length = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
$this->album_title = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
$this->genre = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
$this->comments = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
$this->year = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
$this->track_number = ($row[$startcol + 21] !== null) ? (int) $row[$startcol + 21] : null;
$this->channels = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null;
$this->url = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null;
$this->bpm = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null;
$this->rating = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null;
$this->encoded_by = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null;
$this->disc_number = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
$this->mood = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
$this->label = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
$this->composer = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
$this->encoder = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
$this->checksum = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
$this->lyrics = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
$this->orchestra = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null;
$this->conductor = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
$this->lyricist = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null;
$this->original_lyricist = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null;
$this->radio_station_name = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
$this->info_url = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
$this->artist_url = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
$this->audio_source_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null;
$this->radio_station_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null;
$this->buy_this_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
$this->isrc_number = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
$this->catalog_number = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null;
$this->original_artist = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null;
$this->copyright = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
$this->report_datetime = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
$this->report_location = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
$this->report_organization = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
$this->subject = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
$this->contributor = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
$this->language = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
$this->directory = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
$this->filepath = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
$this->state = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
$this->currentlyaccessing = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
$this->editedby = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null;
$this->mtime = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
$this->md5 = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
$this->track_title = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
$this->artist_name = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null;
$this->bit_rate = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null;
$this->sample_rate = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null;
$this->format = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null;
$this->length = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null;
$this->album_title = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null;
$this->genre = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null;
$this->comments = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null;
$this->year = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null;
$this->track_number = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null;
$this->channels = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null;
$this->url = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null;
$this->bpm = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null;
$this->rating = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null;
$this->encoded_by = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null;
$this->disc_number = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null;
$this->mood = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null;
$this->label = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null;
$this->composer = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null;
$this->encoder = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null;
$this->checksum = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null;
$this->lyrics = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null;
$this->orchestra = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null;
$this->conductor = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null;
$this->lyricist = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null;
$this->original_lyricist = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null;
$this->radio_station_name = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null;
$this->info_url = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null;
$this->artist_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null;
$this->audio_source_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null;
$this->radio_station_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null;
$this->buy_this_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null;
$this->isrc_number = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null;
$this->catalog_number = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null;
$this->original_artist = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null;
$this->copyright = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null;
$this->report_datetime = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null;
$this->report_location = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null;
$this->report_organization = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null;
$this->subject = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null;
$this->contributor = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null;
$this->language = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null;
$this->resetModified();
$this->setNew(false);
@ -2255,7 +2301,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 54; // 54 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 55; // 55 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcFiles object", $e);
@ -2278,6 +2324,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
public function ensureConsistency()
{
if ($this->aCcMusicDirs !== null && $this->directory !== $this->aCcMusicDirs->getId()) {
$this->aCcMusicDirs = null;
}
if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) {
$this->aCcSubjs = null;
}
@ -2321,6 +2370,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($deep) { // also de-associate any related objects?
$this->aCcSubjs = null;
$this->aCcMusicDirs = null;
$this->collCcShowInstancess = null;
$this->collCcPlaylistcontentss = null;
@ -2447,6 +2497,13 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->setCcSubjs($this->aCcSubjs);
}
if ($this->aCcMusicDirs !== null) {
if ($this->aCcMusicDirs->isModified() || $this->aCcMusicDirs->isNew()) {
$affectedRows += $this->aCcMusicDirs->save($con);
}
$this->setCcMusicDirs($this->aCcMusicDirs);
}
if ($this->isNew() ) {
$this->modifiedColumns[] = CcFilesPeer::ID;
}
@ -2563,6 +2620,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
}
}
if ($this->aCcMusicDirs !== null) {
if (!$this->aCcMusicDirs->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcMusicDirs->getValidationFailures());
}
}
if (($retval = CcFilesPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
@ -2634,150 +2697,153 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->getDbFtype();
break;
case 5:
return $this->getDbFilepath();
return $this->getDbDirectory();
break;
case 6:
return $this->getDbState();
return $this->getDbFilepath();
break;
case 7:
return $this->getDbCurrentlyaccessing();
return $this->getDbState();
break;
case 8:
return $this->getDbEditedby();
return $this->getDbCurrentlyaccessing();
break;
case 9:
return $this->getDbMtime();
return $this->getDbEditedby();
break;
case 10:
return $this->getDbMd5();
return $this->getDbMtime();
break;
case 11:
return $this->getDbTrackTitle();
return $this->getDbMd5();
break;
case 12:
return $this->getDbArtistName();
return $this->getDbTrackTitle();
break;
case 13:
return $this->getDbBitRate();
return $this->getDbArtistName();
break;
case 14:
return $this->getDbSampleRate();
return $this->getDbBitRate();
break;
case 15:
return $this->getDbFormat();
return $this->getDbSampleRate();
break;
case 16:
return $this->getDbLength();
return $this->getDbFormat();
break;
case 17:
return $this->getDbAlbumTitle();
return $this->getDbLength();
break;
case 18:
return $this->getDbGenre();
return $this->getDbAlbumTitle();
break;
case 19:
return $this->getDbComments();
return $this->getDbGenre();
break;
case 20:
return $this->getDbYear();
return $this->getDbComments();
break;
case 21:
return $this->getDbTrackNumber();
return $this->getDbYear();
break;
case 22:
return $this->getDbChannels();
return $this->getDbTrackNumber();
break;
case 23:
return $this->getDbUrl();
return $this->getDbChannels();
break;
case 24:
return $this->getDbBpm();
return $this->getDbUrl();
break;
case 25:
return $this->getDbRating();
return $this->getDbBpm();
break;
case 26:
return $this->getDbEncodedBy();
return $this->getDbRating();
break;
case 27:
return $this->getDbDiscNumber();
return $this->getDbEncodedBy();
break;
case 28:
return $this->getDbMood();
return $this->getDbDiscNumber();
break;
case 29:
return $this->getDbLabel();
return $this->getDbMood();
break;
case 30:
return $this->getDbComposer();
return $this->getDbLabel();
break;
case 31:
return $this->getDbEncoder();
return $this->getDbComposer();
break;
case 32:
return $this->getDbChecksum();
return $this->getDbEncoder();
break;
case 33:
return $this->getDbLyrics();
return $this->getDbChecksum();
break;
case 34:
return $this->getDbOrchestra();
return $this->getDbLyrics();
break;
case 35:
return $this->getDbConductor();
return $this->getDbOrchestra();
break;
case 36:
return $this->getDbLyricist();
return $this->getDbConductor();
break;
case 37:
return $this->getDbOriginalLyricist();
return $this->getDbLyricist();
break;
case 38:
return $this->getDbRadioStationName();
return $this->getDbOriginalLyricist();
break;
case 39:
return $this->getDbInfoUrl();
return $this->getDbRadioStationName();
break;
case 40:
return $this->getDbArtistUrl();
return $this->getDbInfoUrl();
break;
case 41:
return $this->getDbAudioSourceUrl();
return $this->getDbArtistUrl();
break;
case 42:
return $this->getDbRadioStationUrl();
return $this->getDbAudioSourceUrl();
break;
case 43:
return $this->getDbBuyThisUrl();
return $this->getDbRadioStationUrl();
break;
case 44:
return $this->getDbIsrcNumber();
return $this->getDbBuyThisUrl();
break;
case 45:
return $this->getDbCatalogNumber();
return $this->getDbIsrcNumber();
break;
case 46:
return $this->getDbOriginalArtist();
return $this->getDbCatalogNumber();
break;
case 47:
return $this->getDbCopyright();
return $this->getDbOriginalArtist();
break;
case 48:
return $this->getDbReportDatetime();
return $this->getDbCopyright();
break;
case 49:
return $this->getDbReportLocation();
return $this->getDbReportDatetime();
break;
case 50:
return $this->getDbReportOrganization();
return $this->getDbReportLocation();
break;
case 51:
return $this->getDbSubject();
return $this->getDbReportOrganization();
break;
case 52:
return $this->getDbContributor();
return $this->getDbSubject();
break;
case 53:
return $this->getDbContributor();
break;
case 54:
return $this->getDbLanguage();
break;
default:
@ -2809,60 +2875,64 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$keys[2] => $this->getDbName(),
$keys[3] => $this->getDbMime(),
$keys[4] => $this->getDbFtype(),
$keys[5] => $this->getDbFilepath(),
$keys[6] => $this->getDbState(),
$keys[7] => $this->getDbCurrentlyaccessing(),
$keys[8] => $this->getDbEditedby(),
$keys[9] => $this->getDbMtime(),
$keys[10] => $this->getDbMd5(),
$keys[11] => $this->getDbTrackTitle(),
$keys[12] => $this->getDbArtistName(),
$keys[13] => $this->getDbBitRate(),
$keys[14] => $this->getDbSampleRate(),
$keys[15] => $this->getDbFormat(),
$keys[16] => $this->getDbLength(),
$keys[17] => $this->getDbAlbumTitle(),
$keys[18] => $this->getDbGenre(),
$keys[19] => $this->getDbComments(),
$keys[20] => $this->getDbYear(),
$keys[21] => $this->getDbTrackNumber(),
$keys[22] => $this->getDbChannels(),
$keys[23] => $this->getDbUrl(),
$keys[24] => $this->getDbBpm(),
$keys[25] => $this->getDbRating(),
$keys[26] => $this->getDbEncodedBy(),
$keys[27] => $this->getDbDiscNumber(),
$keys[28] => $this->getDbMood(),
$keys[29] => $this->getDbLabel(),
$keys[30] => $this->getDbComposer(),
$keys[31] => $this->getDbEncoder(),
$keys[32] => $this->getDbChecksum(),
$keys[33] => $this->getDbLyrics(),
$keys[34] => $this->getDbOrchestra(),
$keys[35] => $this->getDbConductor(),
$keys[36] => $this->getDbLyricist(),
$keys[37] => $this->getDbOriginalLyricist(),
$keys[38] => $this->getDbRadioStationName(),
$keys[39] => $this->getDbInfoUrl(),
$keys[40] => $this->getDbArtistUrl(),
$keys[41] => $this->getDbAudioSourceUrl(),
$keys[42] => $this->getDbRadioStationUrl(),
$keys[43] => $this->getDbBuyThisUrl(),
$keys[44] => $this->getDbIsrcNumber(),
$keys[45] => $this->getDbCatalogNumber(),
$keys[46] => $this->getDbOriginalArtist(),
$keys[47] => $this->getDbCopyright(),
$keys[48] => $this->getDbReportDatetime(),
$keys[49] => $this->getDbReportLocation(),
$keys[50] => $this->getDbReportOrganization(),
$keys[51] => $this->getDbSubject(),
$keys[52] => $this->getDbContributor(),
$keys[53] => $this->getDbLanguage(),
$keys[5] => $this->getDbDirectory(),
$keys[6] => $this->getDbFilepath(),
$keys[7] => $this->getDbState(),
$keys[8] => $this->getDbCurrentlyaccessing(),
$keys[9] => $this->getDbEditedby(),
$keys[10] => $this->getDbMtime(),
$keys[11] => $this->getDbMd5(),
$keys[12] => $this->getDbTrackTitle(),
$keys[13] => $this->getDbArtistName(),
$keys[14] => $this->getDbBitRate(),
$keys[15] => $this->getDbSampleRate(),
$keys[16] => $this->getDbFormat(),
$keys[17] => $this->getDbLength(),
$keys[18] => $this->getDbAlbumTitle(),
$keys[19] => $this->getDbGenre(),
$keys[20] => $this->getDbComments(),
$keys[21] => $this->getDbYear(),
$keys[22] => $this->getDbTrackNumber(),
$keys[23] => $this->getDbChannels(),
$keys[24] => $this->getDbUrl(),
$keys[25] => $this->getDbBpm(),
$keys[26] => $this->getDbRating(),
$keys[27] => $this->getDbEncodedBy(),
$keys[28] => $this->getDbDiscNumber(),
$keys[29] => $this->getDbMood(),
$keys[30] => $this->getDbLabel(),
$keys[31] => $this->getDbComposer(),
$keys[32] => $this->getDbEncoder(),
$keys[33] => $this->getDbChecksum(),
$keys[34] => $this->getDbLyrics(),
$keys[35] => $this->getDbOrchestra(),
$keys[36] => $this->getDbConductor(),
$keys[37] => $this->getDbLyricist(),
$keys[38] => $this->getDbOriginalLyricist(),
$keys[39] => $this->getDbRadioStationName(),
$keys[40] => $this->getDbInfoUrl(),
$keys[41] => $this->getDbArtistUrl(),
$keys[42] => $this->getDbAudioSourceUrl(),
$keys[43] => $this->getDbRadioStationUrl(),
$keys[44] => $this->getDbBuyThisUrl(),
$keys[45] => $this->getDbIsrcNumber(),
$keys[46] => $this->getDbCatalogNumber(),
$keys[47] => $this->getDbOriginalArtist(),
$keys[48] => $this->getDbCopyright(),
$keys[49] => $this->getDbReportDatetime(),
$keys[50] => $this->getDbReportLocation(),
$keys[51] => $this->getDbReportOrganization(),
$keys[52] => $this->getDbSubject(),
$keys[53] => $this->getDbContributor(),
$keys[54] => $this->getDbLanguage(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcSubjs) {
$result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true);
}
if (null !== $this->aCcMusicDirs) {
$result['CcMusicDirs'] = $this->aCcMusicDirs->toArray($keyType, $includeLazyLoadColumns, true);
}
}
return $result;
}
@ -2910,150 +2980,153 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->setDbFtype($value);
break;
case 5:
$this->setDbFilepath($value);
$this->setDbDirectory($value);
break;
case 6:
$this->setDbState($value);
$this->setDbFilepath($value);
break;
case 7:
$this->setDbCurrentlyaccessing($value);
$this->setDbState($value);
break;
case 8:
$this->setDbEditedby($value);
$this->setDbCurrentlyaccessing($value);
break;
case 9:
$this->setDbMtime($value);
$this->setDbEditedby($value);
break;
case 10:
$this->setDbMd5($value);
$this->setDbMtime($value);
break;
case 11:
$this->setDbTrackTitle($value);
$this->setDbMd5($value);
break;
case 12:
$this->setDbArtistName($value);
$this->setDbTrackTitle($value);
break;
case 13:
$this->setDbBitRate($value);
$this->setDbArtistName($value);
break;
case 14:
$this->setDbSampleRate($value);
$this->setDbBitRate($value);
break;
case 15:
$this->setDbFormat($value);
$this->setDbSampleRate($value);
break;
case 16:
$this->setDbLength($value);
$this->setDbFormat($value);
break;
case 17:
$this->setDbAlbumTitle($value);
$this->setDbLength($value);
break;
case 18:
$this->setDbGenre($value);
$this->setDbAlbumTitle($value);
break;
case 19:
$this->setDbComments($value);
$this->setDbGenre($value);
break;
case 20:
$this->setDbYear($value);
$this->setDbComments($value);
break;
case 21:
$this->setDbTrackNumber($value);
$this->setDbYear($value);
break;
case 22:
$this->setDbChannels($value);
$this->setDbTrackNumber($value);
break;
case 23:
$this->setDbUrl($value);
$this->setDbChannels($value);
break;
case 24:
$this->setDbBpm($value);
$this->setDbUrl($value);
break;
case 25:
$this->setDbRating($value);
$this->setDbBpm($value);
break;
case 26:
$this->setDbEncodedBy($value);
$this->setDbRating($value);
break;
case 27:
$this->setDbDiscNumber($value);
$this->setDbEncodedBy($value);
break;
case 28:
$this->setDbMood($value);
$this->setDbDiscNumber($value);
break;
case 29:
$this->setDbLabel($value);
$this->setDbMood($value);
break;
case 30:
$this->setDbComposer($value);
$this->setDbLabel($value);
break;
case 31:
$this->setDbEncoder($value);
$this->setDbComposer($value);
break;
case 32:
$this->setDbChecksum($value);
$this->setDbEncoder($value);
break;
case 33:
$this->setDbLyrics($value);
$this->setDbChecksum($value);
break;
case 34:
$this->setDbOrchestra($value);
$this->setDbLyrics($value);
break;
case 35:
$this->setDbConductor($value);
$this->setDbOrchestra($value);
break;
case 36:
$this->setDbLyricist($value);
$this->setDbConductor($value);
break;
case 37:
$this->setDbOriginalLyricist($value);
$this->setDbLyricist($value);
break;
case 38:
$this->setDbRadioStationName($value);
$this->setDbOriginalLyricist($value);
break;
case 39:
$this->setDbInfoUrl($value);
$this->setDbRadioStationName($value);
break;
case 40:
$this->setDbArtistUrl($value);
$this->setDbInfoUrl($value);
break;
case 41:
$this->setDbAudioSourceUrl($value);
$this->setDbArtistUrl($value);
break;
case 42:
$this->setDbRadioStationUrl($value);
$this->setDbAudioSourceUrl($value);
break;
case 43:
$this->setDbBuyThisUrl($value);
$this->setDbRadioStationUrl($value);
break;
case 44:
$this->setDbIsrcNumber($value);
$this->setDbBuyThisUrl($value);
break;
case 45:
$this->setDbCatalogNumber($value);
$this->setDbIsrcNumber($value);
break;
case 46:
$this->setDbOriginalArtist($value);
$this->setDbCatalogNumber($value);
break;
case 47:
$this->setDbCopyright($value);
$this->setDbOriginalArtist($value);
break;
case 48:
$this->setDbReportDatetime($value);
$this->setDbCopyright($value);
break;
case 49:
$this->setDbReportLocation($value);
$this->setDbReportDatetime($value);
break;
case 50:
$this->setDbReportOrganization($value);
$this->setDbReportLocation($value);
break;
case 51:
$this->setDbSubject($value);
$this->setDbReportOrganization($value);
break;
case 52:
$this->setDbContributor($value);
$this->setDbSubject($value);
break;
case 53:
$this->setDbContributor($value);
break;
case 54:
$this->setDbLanguage($value);
break;
} // switch()
@ -3085,55 +3158,56 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if (array_key_exists($keys[2], $arr)) $this->setDbName($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbMime($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbFtype($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbFilepath($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbState($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbEditedby($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDbMtime($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setDbMd5($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setDbTrackTitle($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDbArtistName($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setDbBitRate($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setDbSampleRate($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setDbFormat($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setDbLength($arr[$keys[16]]);
if (array_key_exists($keys[17], $arr)) $this->setDbAlbumTitle($arr[$keys[17]]);
if (array_key_exists($keys[18], $arr)) $this->setDbGenre($arr[$keys[18]]);
if (array_key_exists($keys[19], $arr)) $this->setDbComments($arr[$keys[19]]);
if (array_key_exists($keys[20], $arr)) $this->setDbYear($arr[$keys[20]]);
if (array_key_exists($keys[21], $arr)) $this->setDbTrackNumber($arr[$keys[21]]);
if (array_key_exists($keys[22], $arr)) $this->setDbChannels($arr[$keys[22]]);
if (array_key_exists($keys[23], $arr)) $this->setDbUrl($arr[$keys[23]]);
if (array_key_exists($keys[24], $arr)) $this->setDbBpm($arr[$keys[24]]);
if (array_key_exists($keys[25], $arr)) $this->setDbRating($arr[$keys[25]]);
if (array_key_exists($keys[26], $arr)) $this->setDbEncodedBy($arr[$keys[26]]);
if (array_key_exists($keys[27], $arr)) $this->setDbDiscNumber($arr[$keys[27]]);
if (array_key_exists($keys[28], $arr)) $this->setDbMood($arr[$keys[28]]);
if (array_key_exists($keys[29], $arr)) $this->setDbLabel($arr[$keys[29]]);
if (array_key_exists($keys[30], $arr)) $this->setDbComposer($arr[$keys[30]]);
if (array_key_exists($keys[31], $arr)) $this->setDbEncoder($arr[$keys[31]]);
if (array_key_exists($keys[32], $arr)) $this->setDbChecksum($arr[$keys[32]]);
if (array_key_exists($keys[33], $arr)) $this->setDbLyrics($arr[$keys[33]]);
if (array_key_exists($keys[34], $arr)) $this->setDbOrchestra($arr[$keys[34]]);
if (array_key_exists($keys[35], $arr)) $this->setDbConductor($arr[$keys[35]]);
if (array_key_exists($keys[36], $arr)) $this->setDbLyricist($arr[$keys[36]]);
if (array_key_exists($keys[37], $arr)) $this->setDbOriginalLyricist($arr[$keys[37]]);
if (array_key_exists($keys[38], $arr)) $this->setDbRadioStationName($arr[$keys[38]]);
if (array_key_exists($keys[39], $arr)) $this->setDbInfoUrl($arr[$keys[39]]);
if (array_key_exists($keys[40], $arr)) $this->setDbArtistUrl($arr[$keys[40]]);
if (array_key_exists($keys[41], $arr)) $this->setDbAudioSourceUrl($arr[$keys[41]]);
if (array_key_exists($keys[42], $arr)) $this->setDbRadioStationUrl($arr[$keys[42]]);
if (array_key_exists($keys[43], $arr)) $this->setDbBuyThisUrl($arr[$keys[43]]);
if (array_key_exists($keys[44], $arr)) $this->setDbIsrcNumber($arr[$keys[44]]);
if (array_key_exists($keys[45], $arr)) $this->setDbCatalogNumber($arr[$keys[45]]);
if (array_key_exists($keys[46], $arr)) $this->setDbOriginalArtist($arr[$keys[46]]);
if (array_key_exists($keys[47], $arr)) $this->setDbCopyright($arr[$keys[47]]);
if (array_key_exists($keys[48], $arr)) $this->setDbReportDatetime($arr[$keys[48]]);
if (array_key_exists($keys[49], $arr)) $this->setDbReportLocation($arr[$keys[49]]);
if (array_key_exists($keys[50], $arr)) $this->setDbReportOrganization($arr[$keys[50]]);
if (array_key_exists($keys[51], $arr)) $this->setDbSubject($arr[$keys[51]]);
if (array_key_exists($keys[52], $arr)) $this->setDbContributor($arr[$keys[52]]);
if (array_key_exists($keys[53], $arr)) $this->setDbLanguage($arr[$keys[53]]);
if (array_key_exists($keys[5], $arr)) $this->setDbDirectory($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbFilepath($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbState($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDbEditedby($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setDbMtime($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setDbMd5($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDbTrackTitle($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setDbArtistName($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setDbBitRate($arr[$keys[14]]);
if (array_key_exists($keys[15], $arr)) $this->setDbSampleRate($arr[$keys[15]]);
if (array_key_exists($keys[16], $arr)) $this->setDbFormat($arr[$keys[16]]);
if (array_key_exists($keys[17], $arr)) $this->setDbLength($arr[$keys[17]]);
if (array_key_exists($keys[18], $arr)) $this->setDbAlbumTitle($arr[$keys[18]]);
if (array_key_exists($keys[19], $arr)) $this->setDbGenre($arr[$keys[19]]);
if (array_key_exists($keys[20], $arr)) $this->setDbComments($arr[$keys[20]]);
if (array_key_exists($keys[21], $arr)) $this->setDbYear($arr[$keys[21]]);
if (array_key_exists($keys[22], $arr)) $this->setDbTrackNumber($arr[$keys[22]]);
if (array_key_exists($keys[23], $arr)) $this->setDbChannels($arr[$keys[23]]);
if (array_key_exists($keys[24], $arr)) $this->setDbUrl($arr[$keys[24]]);
if (array_key_exists($keys[25], $arr)) $this->setDbBpm($arr[$keys[25]]);
if (array_key_exists($keys[26], $arr)) $this->setDbRating($arr[$keys[26]]);
if (array_key_exists($keys[27], $arr)) $this->setDbEncodedBy($arr[$keys[27]]);
if (array_key_exists($keys[28], $arr)) $this->setDbDiscNumber($arr[$keys[28]]);
if (array_key_exists($keys[29], $arr)) $this->setDbMood($arr[$keys[29]]);
if (array_key_exists($keys[30], $arr)) $this->setDbLabel($arr[$keys[30]]);
if (array_key_exists($keys[31], $arr)) $this->setDbComposer($arr[$keys[31]]);
if (array_key_exists($keys[32], $arr)) $this->setDbEncoder($arr[$keys[32]]);
if (array_key_exists($keys[33], $arr)) $this->setDbChecksum($arr[$keys[33]]);
if (array_key_exists($keys[34], $arr)) $this->setDbLyrics($arr[$keys[34]]);
if (array_key_exists($keys[35], $arr)) $this->setDbOrchestra($arr[$keys[35]]);
if (array_key_exists($keys[36], $arr)) $this->setDbConductor($arr[$keys[36]]);
if (array_key_exists($keys[37], $arr)) $this->setDbLyricist($arr[$keys[37]]);
if (array_key_exists($keys[38], $arr)) $this->setDbOriginalLyricist($arr[$keys[38]]);
if (array_key_exists($keys[39], $arr)) $this->setDbRadioStationName($arr[$keys[39]]);
if (array_key_exists($keys[40], $arr)) $this->setDbInfoUrl($arr[$keys[40]]);
if (array_key_exists($keys[41], $arr)) $this->setDbArtistUrl($arr[$keys[41]]);
if (array_key_exists($keys[42], $arr)) $this->setDbAudioSourceUrl($arr[$keys[42]]);
if (array_key_exists($keys[43], $arr)) $this->setDbRadioStationUrl($arr[$keys[43]]);
if (array_key_exists($keys[44], $arr)) $this->setDbBuyThisUrl($arr[$keys[44]]);
if (array_key_exists($keys[45], $arr)) $this->setDbIsrcNumber($arr[$keys[45]]);
if (array_key_exists($keys[46], $arr)) $this->setDbCatalogNumber($arr[$keys[46]]);
if (array_key_exists($keys[47], $arr)) $this->setDbOriginalArtist($arr[$keys[47]]);
if (array_key_exists($keys[48], $arr)) $this->setDbCopyright($arr[$keys[48]]);
if (array_key_exists($keys[49], $arr)) $this->setDbReportDatetime($arr[$keys[49]]);
if (array_key_exists($keys[50], $arr)) $this->setDbReportLocation($arr[$keys[50]]);
if (array_key_exists($keys[51], $arr)) $this->setDbReportOrganization($arr[$keys[51]]);
if (array_key_exists($keys[52], $arr)) $this->setDbSubject($arr[$keys[52]]);
if (array_key_exists($keys[53], $arr)) $this->setDbContributor($arr[$keys[53]]);
if (array_key_exists($keys[54], $arr)) $this->setDbLanguage($arr[$keys[54]]);
}
/**
@ -3150,6 +3224,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
if ($this->isColumnModified(CcFilesPeer::NAME)) $criteria->add(CcFilesPeer::NAME, $this->name);
if ($this->isColumnModified(CcFilesPeer::MIME)) $criteria->add(CcFilesPeer::MIME, $this->mime);
if ($this->isColumnModified(CcFilesPeer::FTYPE)) $criteria->add(CcFilesPeer::FTYPE, $this->ftype);
if ($this->isColumnModified(CcFilesPeer::DIRECTORY)) $criteria->add(CcFilesPeer::DIRECTORY, $this->directory);
if ($this->isColumnModified(CcFilesPeer::FILEPATH)) $criteria->add(CcFilesPeer::FILEPATH, $this->filepath);
if ($this->isColumnModified(CcFilesPeer::STATE)) $criteria->add(CcFilesPeer::STATE, $this->state);
if ($this->isColumnModified(CcFilesPeer::CURRENTLYACCESSING)) $criteria->add(CcFilesPeer::CURRENTLYACCESSING, $this->currentlyaccessing);
@ -3264,6 +3339,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$copyObj->setDbName($this->name);
$copyObj->setDbMime($this->mime);
$copyObj->setDbFtype($this->ftype);
$copyObj->setDbDirectory($this->directory);
$copyObj->setDbFilepath($this->filepath);
$copyObj->setDbState($this->state);
$copyObj->setDbCurrentlyaccessing($this->currentlyaccessing);
@ -3425,6 +3501,55 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
return $this->aCcSubjs;
}
/**
* Declares an association between this object and a CcMusicDirs object.
*
* @param CcMusicDirs $v
* @return CcFiles The current object (for fluent API support)
* @throws PropelException
*/
public function setCcMusicDirs(CcMusicDirs $v = null)
{
if ($v === null) {
$this->setDbDirectory(NULL);
} else {
$this->setDbDirectory($v->getId());
}
$this->aCcMusicDirs = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcMusicDirs object, it will not be re-added.
if ($v !== null) {
$v->addCcFiles($this);
}
return $this;
}
/**
* Get the associated CcMusicDirs object
*
* @param PropelPDO Optional Connection object.
* @return CcMusicDirs The associated CcMusicDirs object.
* @throws PropelException
*/
public function getCcMusicDirs(PropelPDO $con = null)
{
if ($this->aCcMusicDirs === null && ($this->directory !== null)) {
$this->aCcMusicDirs = CcMusicDirsQuery::create()->findPk($this->directory, $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->aCcMusicDirs->addCcFiless($this);
*/
}
return $this->aCcMusicDirs;
}
/**
* Clears out the collCcShowInstancess collection
*
@ -3728,6 +3853,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->name = null;
$this->mime = null;
$this->ftype = null;
$this->directory = null;
$this->filepath = null;
$this->state = null;
$this->currentlyaccessing = null;
@ -3813,6 +3939,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
$this->collCcShowInstancess = null;
$this->collCcPlaylistcontentss = null;
$this->aCcSubjs = null;
$this->aCcMusicDirs = null;
}
/**

View File

@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
const TM_CLASS = 'CcFilesTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 54;
const NUM_COLUMNS = 55;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -46,6 +46,9 @@ abstract class BaseCcFilesPeer {
/** the column name for the FTYPE field */
const FTYPE = 'cc_files.FTYPE';
/** the column name for the DIRECTORY field */
const DIRECTORY = 'cc_files.DIRECTORY';
/** the column name for the FILEPATH field */
const FILEPATH = 'cc_files.FILEPATH';
@ -209,12 +212,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', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', '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', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', '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', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, 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, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', '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', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', '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', ),
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, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', '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', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', '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', ),
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::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, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', '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', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', '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', ),
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, )
);
/**
@ -224,12 +227,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, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbMd5' => 10, 'DbTrackTitle' => 11, 'DbArtistName' => 12, 'DbBitRate' => 13, 'DbSampleRate' => 14, 'DbFormat' => 15, 'DbLength' => 16, 'DbAlbumTitle' => 17, 'DbGenre' => 18, 'DbComments' => 19, 'DbYear' => 20, 'DbTrackNumber' => 21, 'DbChannels' => 22, 'DbUrl' => 23, 'DbBpm' => 24, 'DbRating' => 25, 'DbEncodedBy' => 26, 'DbDiscNumber' => 27, 'DbMood' => 28, 'DbLabel' => 29, 'DbComposer' => 30, 'DbEncoder' => 31, 'DbChecksum' => 32, 'DbLyrics' => 33, 'DbOrchestra' => 34, 'DbConductor' => 35, 'DbLyricist' => 36, 'DbOriginalLyricist' => 37, 'DbRadioStationName' => 38, 'DbInfoUrl' => 39, 'DbArtistUrl' => 40, 'DbAudioSourceUrl' => 41, 'DbRadioStationUrl' => 42, 'DbBuyThisUrl' => 43, 'DbIsrcNumber' => 44, 'DbCatalogNumber' => 45, 'DbOriginalArtist' => 46, 'DbCopyright' => 47, 'DbReportDatetime' => 48, 'DbReportLocation' => 49, 'DbReportOrganization' => 50, 'DbSubject' => 51, 'DbContributor' => 52, 'DbLanguage' => 53, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbMd5' => 10, 'dbTrackTitle' => 11, 'dbArtistName' => 12, 'dbBitRate' => 13, 'dbSampleRate' => 14, 'dbFormat' => 15, 'dbLength' => 16, 'dbAlbumTitle' => 17, 'dbGenre' => 18, 'dbComments' => 19, 'dbYear' => 20, 'dbTrackNumber' => 21, 'dbChannels' => 22, 'dbUrl' => 23, 'dbBpm' => 24, 'dbRating' => 25, 'dbEncodedBy' => 26, 'dbDiscNumber' => 27, 'dbMood' => 28, 'dbLabel' => 29, 'dbComposer' => 30, 'dbEncoder' => 31, 'dbChecksum' => 32, 'dbLyrics' => 33, 'dbOrchestra' => 34, 'dbConductor' => 35, 'dbLyricist' => 36, 'dbOriginalLyricist' => 37, 'dbRadioStationName' => 38, 'dbInfoUrl' => 39, 'dbArtistUrl' => 40, 'dbAudioSourceUrl' => 41, 'dbRadioStationUrl' => 42, 'dbBuyThisUrl' => 43, 'dbIsrcNumber' => 44, 'dbCatalogNumber' => 45, 'dbOriginalArtist' => 46, 'dbCopyright' => 47, 'dbReportDatetime' => 48, 'dbReportLocation' => 49, 'dbReportOrganization' => 50, 'dbSubject' => 51, 'dbContributor' => 52, 'dbLanguage' => 53, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::MD5 => 10, self::TRACK_TITLE => 11, self::ARTIST_NAME => 12, self::BIT_RATE => 13, self::SAMPLE_RATE => 14, self::FORMAT => 15, self::LENGTH => 16, self::ALBUM_TITLE => 17, self::GENRE => 18, self::COMMENTS => 19, self::YEAR => 20, self::TRACK_NUMBER => 21, self::CHANNELS => 22, self::URL => 23, self::BPM => 24, self::RATING => 25, self::ENCODED_BY => 26, self::DISC_NUMBER => 27, self::MOOD => 28, self::LABEL => 29, self::COMPOSER => 30, self::ENCODER => 31, self::CHECKSUM => 32, self::LYRICS => 33, self::ORCHESTRA => 34, self::CONDUCTOR => 35, self::LYRICIST => 36, self::ORIGINAL_LYRICIST => 37, self::RADIO_STATION_NAME => 38, self::INFO_URL => 39, self::ARTIST_URL => 40, self::AUDIO_SOURCE_URL => 41, self::RADIO_STATION_URL => 42, self::BUY_THIS_URL => 43, self::ISRC_NUMBER => 44, self::CATALOG_NUMBER => 45, self::ORIGINAL_ARTIST => 46, self::COPYRIGHT => 47, self::REPORT_DATETIME => 48, self::REPORT_LOCATION => 49, self::REPORT_ORGANIZATION => 50, self::SUBJECT => 51, self::CONTRIBUTOR => 52, self::LANGUAGE => 53, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'MD5' => 10, 'TRACK_TITLE' => 11, 'ARTIST_NAME' => 12, 'BIT_RATE' => 13, 'SAMPLE_RATE' => 14, 'FORMAT' => 15, 'LENGTH' => 16, 'ALBUM_TITLE' => 17, 'GENRE' => 18, 'COMMENTS' => 19, 'YEAR' => 20, 'TRACK_NUMBER' => 21, 'CHANNELS' => 22, 'URL' => 23, 'BPM' => 24, 'RATING' => 25, 'ENCODED_BY' => 26, 'DISC_NUMBER' => 27, 'MOOD' => 28, 'LABEL' => 29, 'COMPOSER' => 30, 'ENCODER' => 31, 'CHECKSUM' => 32, 'LYRICS' => 33, 'ORCHESTRA' => 34, 'CONDUCTOR' => 35, 'LYRICIST' => 36, 'ORIGINAL_LYRICIST' => 37, 'RADIO_STATION_NAME' => 38, 'INFO_URL' => 39, 'ARTIST_URL' => 40, 'AUDIO_SOURCE_URL' => 41, 'RADIO_STATION_URL' => 42, 'BUY_THIS_URL' => 43, 'ISRC_NUMBER' => 44, 'CATALOG_NUMBER' => 45, 'ORIGINAL_ARTIST' => 46, 'COPYRIGHT' => 47, 'REPORT_DATETIME' => 48, 'REPORT_LOCATION' => 49, 'REPORT_ORGANIZATION' => 50, 'SUBJECT' => 51, 'CONTRIBUTOR' => 52, 'LANGUAGE' => 53, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'md5' => 10, 'track_title' => 11, 'artist_name' => 12, 'bit_rate' => 13, 'sample_rate' => 14, 'format' => 15, 'length' => 16, 'album_title' => 17, 'genre' => 18, 'comments' => 19, 'year' => 20, 'track_number' => 21, 'channels' => 22, 'url' => 23, 'bpm' => 24, 'rating' => 25, 'encoded_by' => 26, 'disc_number' => 27, 'mood' => 28, 'label' => 29, 'composer' => 30, 'encoder' => 31, 'checksum' => 32, 'lyrics' => 33, 'orchestra' => 34, 'conductor' => 35, 'lyricist' => 36, 'original_lyricist' => 37, 'radio_station_name' => 38, 'info_url' => 39, 'artist_url' => 40, 'audio_source_url' => 41, 'radio_station_url' => 42, 'buy_this_url' => 43, 'isrc_number' => 44, 'catalog_number' => 45, 'original_artist' => 46, 'copyright' => 47, 'report_datetime' => 48, 'report_location' => 49, 'report_organization' => 50, 'subject' => 51, 'contributor' => 52, 'language' => 53, ),
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, )
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, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, ),
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, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, ),
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::MD5 => 11, self::TRACK_TITLE => 12, self::ARTIST_NAME => 13, self::BIT_RATE => 14, self::SAMPLE_RATE => 15, self::FORMAT => 16, self::LENGTH => 17, self::ALBUM_TITLE => 18, self::GENRE => 19, self::COMMENTS => 20, self::YEAR => 21, self::TRACK_NUMBER => 22, self::CHANNELS => 23, self::URL => 24, self::BPM => 25, self::RATING => 26, self::ENCODED_BY => 27, self::DISC_NUMBER => 28, self::MOOD => 29, self::LABEL => 30, self::COMPOSER => 31, self::ENCODER => 32, self::CHECKSUM => 33, self::LYRICS => 34, self::ORCHESTRA => 35, self::CONDUCTOR => 36, self::LYRICIST => 37, self::ORIGINAL_LYRICIST => 38, self::RADIO_STATION_NAME => 39, self::INFO_URL => 40, self::ARTIST_URL => 41, self::AUDIO_SOURCE_URL => 42, self::RADIO_STATION_URL => 43, self::BUY_THIS_URL => 44, self::ISRC_NUMBER => 45, self::CATALOG_NUMBER => 46, self::ORIGINAL_ARTIST => 47, self::COPYRIGHT => 48, self::REPORT_DATETIME => 49, self::REPORT_LOCATION => 50, self::REPORT_ORGANIZATION => 51, self::SUBJECT => 52, self::CONTRIBUTOR => 53, self::LANGUAGE => 54, ),
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, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, ),
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, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, ),
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, )
);
/**
@ -306,6 +309,7 @@ abstract class BaseCcFilesPeer {
$criteria->addSelectColumn(CcFilesPeer::NAME);
$criteria->addSelectColumn(CcFilesPeer::MIME);
$criteria->addSelectColumn(CcFilesPeer::FTYPE);
$criteria->addSelectColumn(CcFilesPeer::DIRECTORY);
$criteria->addSelectColumn(CcFilesPeer::FILEPATH);
$criteria->addSelectColumn(CcFilesPeer::STATE);
$criteria->addSelectColumn(CcFilesPeer::CURRENTLYACCESSING);
@ -361,6 +365,7 @@ abstract class BaseCcFilesPeer {
$criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.MIME');
$criteria->addSelectColumn($alias . '.FTYPE');
$criteria->addSelectColumn($alias . '.DIRECTORY');
$criteria->addSelectColumn($alias . '.FILEPATH');
$criteria->addSelectColumn($alias . '.STATE');
$criteria->addSelectColumn($alias . '.CURRENTLYACCESSING');
@ -751,6 +756,56 @@ abstract class BaseCcFilesPeer {
}
/**
* Returns the number of rows matching criteria, joining the related CcMusicDirs 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 doCountJoinCcMusicDirs(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(CcFilesPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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 CcFiles objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
@ -817,6 +872,72 @@ abstract class BaseCcFilesPeer {
}
/**
* Selects a collection of CcFiles objects pre-filled with their CcMusicDirs 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 CcFiles objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcMusicDirs(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);
}
CcFilesPeer::addSelectColumns($criteria);
$startcol = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
CcMusicDirsPeer::addSelectColumns($criteria);
$criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcFilesPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcMusicDirsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcMusicDirsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcMusicDirsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (CcFiles) to $obj2 (CcMusicDirs)
$obj2->addCcFiles($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
@ -855,6 +976,8 @@ abstract class BaseCcFilesPeer {
$criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
@ -891,8 +1014,13 @@ abstract class BaseCcFilesPeer {
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
CcMusicDirsPeer::addSelectColumns($criteria);
$startcol4 = $startcol3 + (CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
$criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
@ -928,6 +1056,270 @@ abstract class BaseCcFilesPeer {
$obj2->addCcFiles($obj1);
} // if joined row not null
// Add objects for joined CcMusicDirs rows
$key3 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol3);
if ($key3 !== null) {
$obj3 = CcMusicDirsPeer::getInstanceFromPool($key3);
if (!$obj3) {
$cls = CcMusicDirsPeer::getOMClass(false);
$obj3 = new $cls();
$obj3->hydrate($row, $startcol3);
CcMusicDirsPeer::addInstanceToPool($obj3, $key3);
} // if obj3 loaded
// Add the $obj1 (CcFiles) to the collection in $obj3 (CcMusicDirs)
$obj3->addCcFiles($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinAllExceptCcSubjs(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(CcFilesPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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 CcMusicDirs 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 doCountJoinAllExceptCcMusicDirs(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(CcFilesPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::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 CcFiles objects pre-filled with all related objects except CcSubjs.
*
* @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 CcFiles objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptCcSubjs(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);
}
CcFilesPeer::addSelectColumns($criteria);
$startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
CcMusicDirsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcFilesPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcMusicDirs rows
$key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcMusicDirsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcMusicDirsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcMusicDirsPeer::addInstanceToPool($obj2, $key2);
} // if $obj2 already loaded
// Add the $obj1 (CcFiles) to the collection in $obj2 (CcMusicDirs)
$obj2->addCcFiles($obj1);
} // if joined row is not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Selects a collection of CcFiles objects pre-filled with all related objects except CcMusicDirs.
*
* @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 CcFiles objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAllExceptCcMusicDirs(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);
}
CcFilesPeer::addSelectColumns($criteria);
$startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcFilesPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcSubjs rows
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if $obj2 already loaded
// Add the $obj1 (CcFiles) to the collection in $obj2 (CcSubjs)
$obj2->addCcFiles($obj1);
} // if joined row is not null
$results[] = $obj1;
}
$stmt->closeCursor();

View File

@ -11,6 +11,7 @@
* @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
* @method CcFilesQuery orderByDbDirectory($order = Criteria::ASC) Order by the directory column
* @method CcFilesQuery orderByDbFilepath($order = Criteria::ASC) Order by the filepath column
* @method CcFilesQuery orderByDbState($order = Criteria::ASC) Order by the state column
* @method CcFilesQuery orderByDbCurrentlyaccessing($order = Criteria::ASC) Order by the currentlyaccessing column
@ -66,6 +67,7 @@
* @method CcFilesQuery groupByDbName() Group by the name column
* @method CcFilesQuery groupByDbMime() Group by the mime column
* @method CcFilesQuery groupByDbFtype() Group by the ftype column
* @method CcFilesQuery groupByDbDirectory() Group by the directory column
* @method CcFilesQuery groupByDbFilepath() Group by the filepath column
* @method CcFilesQuery groupByDbState() Group by the state column
* @method CcFilesQuery groupByDbCurrentlyaccessing() Group by the currentlyaccessing column
@ -124,6 +126,10 @@
* @method CcFilesQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method CcFilesQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method CcFilesQuery leftJoinCcMusicDirs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcMusicDirs relation
* @method CcFilesQuery rightJoinCcMusicDirs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcMusicDirs relation
* @method CcFilesQuery innerJoinCcMusicDirs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcMusicDirs relation
*
* @method CcFilesQuery leftJoinCcShowInstances($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowInstances relation
* @method CcFilesQuery rightJoinCcShowInstances($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowInstances relation
* @method CcFilesQuery innerJoinCcShowInstances($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowInstances relation
@ -140,6 +146,7 @@
* @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
* @method CcFiles findOneByDbDirectory(int $directory) Return the first CcFiles filtered by the directory column
* @method CcFiles findOneByDbFilepath(string $filepath) Return the first CcFiles filtered by the filepath column
* @method CcFiles findOneByDbState(string $state) Return the first CcFiles filtered by the state column
* @method CcFiles findOneByDbCurrentlyaccessing(int $currentlyaccessing) Return the first CcFiles filtered by the currentlyaccessing column
@ -195,6 +202,7 @@
* @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
* @method array findByDbDirectory(int $directory) Return CcFiles objects filtered by the directory column
* @method array findByDbFilepath(string $filepath) Return CcFiles objects filtered by the filepath column
* @method array findByDbState(string $state) Return CcFiles objects filtered by the state column
* @method array findByDbCurrentlyaccessing(int $currentlyaccessing) Return CcFiles objects filtered by the currentlyaccessing column
@ -458,6 +466,37 @@ abstract class BaseCcFilesQuery extends ModelCriteria
return $this->addUsingAlias(CcFilesPeer::FTYPE, $dbFtype, $comparison);
}
/**
* Filter the query on the directory column
*
* @param int|array $dbDirectory 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 CcFilesQuery The current query, for fluid interface
*/
public function filterByDbDirectory($dbDirectory = null, $comparison = null)
{
if (is_array($dbDirectory)) {
$useMinMax = false;
if (isset($dbDirectory['min'])) {
$this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbDirectory['max'])) {
$this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory, $comparison);
}
/**
* Filter the query on the filepath column
*
@ -1654,6 +1693,70 @@ abstract class BaseCcFilesQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
}
/**
* Filter the query by a related CcMusicDirs object
*
* @param CcMusicDirs $ccMusicDirs the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcFilesQuery The current query, for fluid interface
*/
public function filterByCcMusicDirs($ccMusicDirs, $comparison = null)
{
return $this
->addUsingAlias(CcFilesPeer::DIRECTORY, $ccMusicDirs->getId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcMusicDirs relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcFilesQuery The current query, for fluid interface
*/
public function joinCcMusicDirs($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcMusicDirs');
// 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, 'CcMusicDirs');
}
return $this;
}
/**
* Use the CcMusicDirs relation CcMusicDirs 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 CcMusicDirsQuery A secondary query class using the current class as primary query
*/
public function useCcMusicDirsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcMusicDirs($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcMusicDirs', 'CcMusicDirsQuery');
}
/**
* Filter the query by a related CcShowInstances object
*

View File

@ -0,0 +1,941 @@
<?php
/**
* Base class that represents a row from the 'cc_music_dirs' table.
*
*
*
* @package propel.generator.airtime.om
*/
abstract class BaseCcMusicDirs extends BaseObject implements Persistent
{
/**
* Peer class name
*/
const PEER = 'CcMusicDirsPeer';
/**
* The Peer class.
* Instance provides a convenient way of calling static methods on a class
* that calling code may not be able to identify.
* @var CcMusicDirsPeer
*/
protected static $peer;
/**
* The value for the id field.
* @var int
*/
protected $id;
/**
* The value for the directory field.
* @var string
*/
protected $directory;
/**
* The value for the type field.
* @var string
*/
protected $type;
/**
* @var array CcFiles[] Collection to store aggregation of CcFiles objects.
*/
protected $collCcFiless;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInSave = false;
/**
* Flag to prevent endless validation loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInValidation = false;
/**
* Get the [id] column value.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Get the [directory] column value.
*
* @return string
*/
public function getDirectory()
{
return $this->directory;
}
/**
* Get the [type] column value.
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set the value of [id] column.
*
* @param int $v new value
* @return CcMusicDirs The current object (for fluent API support)
*/
public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CcMusicDirsPeer::ID;
}
return $this;
} // setId()
/**
* Set the value of [directory] column.
*
* @param string $v new value
* @return CcMusicDirs The current object (for fluent API support)
*/
public function setDirectory($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->directory !== $v) {
$this->directory = $v;
$this->modifiedColumns[] = CcMusicDirsPeer::DIRECTORY;
}
return $this;
} // setDirectory()
/**
* Set the value of [type] column.
*
* @param string $v new value
* @return CcMusicDirs The current object (for fluent API support)
*/
public function setType($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->type !== $v) {
$this->type = $v;
$this->modifiedColumns[] = CcMusicDirsPeer::TYPE;
}
return $this;
} // setType()
/**
* Indicates whether the columns in this object are only set to default values.
*
* This method can be used in conjunction with isModified() to indicate whether an object is both
* modified _and_ has some values set which are non-default.
*
* @return boolean Whether the columns in this object are only been set with default values.
*/
public function hasOnlyDefaultValues()
{
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
* An offset (0-based "start column") is specified so that objects can be hydrated
* with a subset of the columns in the resultset rows. This is needed, for example,
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->directory = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->resetModified();
$this->setNew(false);
if ($rehydrate) {
$this->ensureConsistency();
}
return $startcol + 3; // 3 = CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcMusicDirs object", $e);
}
}
/**
* Checks and repairs the internal consistency of the object.
*
* This method is executed after an already-instantiated object is re-hydrated
* from the database. It exists to check any foreign keys to make sure that
* the objects related to the current object are correct based on foreign key.
*
* You can override this method in the stub class, but you should always invoke
* the base method from the overridden method (i.e. parent::ensureConsistency()),
* in case your model changes.
*
* @throws PropelException
*/
public function ensureConsistency()
{
} // ensureConsistency
/**
* Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
*
* This will only work if the object has been saved and has a valid primary key set.
*
* @param boolean $deep (optional) Whether to also de-associated any related objects.
* @param PropelPDO $con (optional) The PropelPDO connection to use.
* @return void
* @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
*/
public function reload($deep = false, PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
if ($con === null) {
$con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
$stmt = CcMusicDirsPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
$row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor();
if (!$row) {
throw new PropelException('Cannot find matching row in the database to reload object values.');
}
$this->hydrate($row, 0, true); // rehydrate
if ($deep) { // also de-associate any related objects?
$this->collCcFiless = null;
} // if (deep)
}
/**
* Removes this object from datastore and sets delete attribute.
*
* @param PropelPDO $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
if ($ret) {
CcMusicDirsQuery::create()
->filterByPrimaryKey($this->getPrimaryKey())
->delete($con);
$this->postDelete($con);
$con->commit();
$this->setDeleted(true);
} else {
$con->commit();
}
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Persists this object to the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All modified related objects will also be persisted in the doSave()
* method. This method wraps all precipitate database operations in a
* single transaction.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see doSave()
*/
public function save(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("You cannot save an object that has been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
$isInsert = $this->isNew();
try {
$ret = $this->preSave($con);
if ($isInsert) {
$ret = $ret && $this->preInsert($con);
} else {
$ret = $ret && $this->preUpdate($con);
}
if ($ret) {
$affectedRows = $this->doSave($con);
if ($isInsert) {
$this->postInsert($con);
} else {
$this->postUpdate($con);
}
$this->postSave($con);
CcMusicDirsPeer::addInstanceToPool($this);
} else {
$affectedRows = 0;
}
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Performs the work of inserting or updating the row in the database.
*
* If the object is new, it inserts it; otherwise an update is performed.
* All related objects are also updated in this method.
*
* @param PropelPDO $con
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @see save()
*/
protected function doSave(PropelPDO $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isNew() ) {
$this->modifiedColumns[] = CcMusicDirsPeer::ID;
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$criteria = $this->buildCriteria();
if ($criteria->keyContainsValue(CcMusicDirsPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::ID.')');
}
$pk = BasePeer::doInsert($criteria, $con);
$affectedRows = 1;
$this->setId($pk); //[IMV] update autoincrement primary key
$this->setNew(false);
} else {
$affectedRows = CcMusicDirsPeer::doUpdate($this, $con);
}
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
}
if ($this->collCcFiless !== null) {
foreach ($this->collCcFiless as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false;
}
return $affectedRows;
} // doSave()
/**
* Array of ValidationFailed objects.
* @var array ValidationFailed[]
*/
protected $validationFailures = array();
/**
* Gets any ValidationFailed objects that resulted from last call to validate().
*
*
* @return array ValidationFailed[]
* @see validate()
*/
public function getValidationFailures()
{
return $this->validationFailures;
}
/**
* Validates the objects modified field values and all objects related to this table.
*
* If $columns is either a column name or an array of column names
* only those columns are validated.
*
* @param mixed $columns Column name or an array of column names.
* @return boolean Whether all columns pass validation.
* @see doValidate()
* @see getValidationFailures()
*/
public function validate($columns = null)
{
$res = $this->doValidate($columns);
if ($res === true) {
$this->validationFailures = array();
return true;
} else {
$this->validationFailures = $res;
return false;
}
}
/**
* This function performs the validation work for complex object models.
*
* In addition to checking the current object, all related objects will
* also be validated. If all pass then <code>true</code> is returned; otherwise
* an aggreagated array of ValidationFailed objects will be returned.
*
* @param array $columns Array of column names to validate.
* @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
*/
protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
if (($retval = CcMusicDirsPeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval);
}
if ($this->collCcFiless !== null) {
foreach ($this->collCcFiless as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false;
}
return (!empty($failureMap) ? $failureMap : true);
}
/**
* Retrieves a field from the object by name passed in as a string.
*
* @param string $name name
* @param string $type The type of fieldname the $name is of:
* one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return mixed Value of field.
*/
public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
}
/**
* Retrieves a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
*/
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getDirectory();
break;
case 2:
return $this->getType();
break;
default:
return null;
break;
} // switch()
}
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
{
$keys = CcMusicDirsPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getDirectory(),
$keys[2] => $this->getType(),
);
return $result;
}
/**
* Sets a field from the object by name passed in as a string.
*
* @param string $name peer name
* @param mixed $value field value
* @param string $type The type of fieldname the $name is of:
* one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return void
*/
public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
{
$pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
/**
* Sets a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
*/
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setDirectory($value);
break;
case 2:
$this->setType($value);
break;
} // switch()
}
/**
* Populates the object using an array.
*
* This is particularly useful when populating an object from one of the
* request arrays (e.g. $_POST). This method goes through the column
* names, checking to see whether a matching key exists in populated
* array. If so the setByName() method is called for that column.
*
* You can specify the key type of the array by additionally passing one
* of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* The default key type is the column's phpname (e.g. 'AuthorId')
*
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CcMusicDirsPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDirectory($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]);
}
/**
* Build a Criteria object containing the values of all modified columns in this object.
*
* @return Criteria The Criteria object containing all modified values.
*/
public function buildCriteria()
{
$criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
if ($this->isColumnModified(CcMusicDirsPeer::ID)) $criteria->add(CcMusicDirsPeer::ID, $this->id);
if ($this->isColumnModified(CcMusicDirsPeer::DIRECTORY)) $criteria->add(CcMusicDirsPeer::DIRECTORY, $this->directory);
if ($this->isColumnModified(CcMusicDirsPeer::TYPE)) $criteria->add(CcMusicDirsPeer::TYPE, $this->type);
return $criteria;
}
/**
* Builds a Criteria object containing the primary key for this object.
*
* Unlike buildCriteria() this method includes the primary key values regardless
* of whether or not they have been modified.
*
* @return Criteria The Criteria object containing value(s) for primary key(s).
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
$criteria->add(CcMusicDirsPeer::ID, $this->id);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return int
*/
public function getPrimaryKey()
{
return $this->getId();
}
/**
* Generic method to set the primary key (id column).
*
* @param int $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setId($key);
}
/**
* Returns true if the primary key for this object is null.
* @return boolean
*/
public function isPrimaryKeyNull()
{
return null === $this->getId();
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of CcMusicDirs (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setDirectory($this->directory);
$copyObj->setType($this->type);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
// the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false);
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));
}
}
} // if ($deepCopy)
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
}
/**
* Makes a copy of this object that will be inserted as a new row in table when saved.
* It creates a new object filling in the simple attributes, but skipping any primary
* keys that are defined for the table.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return CcMusicDirs Clone of current object.
* @throws PropelException
*/
public function copy($deepCopy = false)
{
// we use get_class(), because this might be a subclass
$clazz = get_class($this);
$copyObj = new $clazz();
$this->copyInto($copyObj, $deepCopy);
return $copyObj;
}
/**
* Returns a peer instance associated with this om.
*
* Since Peer classes are not to have any instance attributes, this method returns the
* same instance for all member of this class. The method could therefore
* be static, but this would prevent one from overriding the behavior.
*
* @return CcMusicDirsPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CcMusicDirsPeer();
}
return self::$peer;
}
/**
* Clears out the collCcFiless 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 addCcFiless()
*/
public function clearCcFiless()
{
$this->collCcFiless = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Initializes the collCcFiless collection.
*
* By default this just sets the collCcFiless collection to an empty array (like clearcollCcFiless());
* 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 initCcFiless()
{
$this->collCcFiless = new PropelObjectCollection();
$this->collCcFiless->setModel('CcFiles');
}
/**
* Gets an array of CcFiles 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 CcMusicDirs 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 CcFiles[] List of CcFiles objects
* @throws PropelException
*/
public function getCcFiless($criteria = null, PropelPDO $con = null)
{
if(null === $this->collCcFiless || null !== $criteria) {
if ($this->isNew() && null === $this->collCcFiless) {
// return empty collection
$this->initCcFiless();
} else {
$collCcFiless = CcFilesQuery::create(null, $criteria)
->filterByCcMusicDirs($this)
->find($con);
if (null !== $criteria) {
return $collCcFiless;
}
$this->collCcFiless = $collCcFiless;
}
}
return $this->collCcFiless;
}
/**
* Returns the number of related CcFiles objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related CcFiles objects.
* @throws PropelException
*/
public function countCcFiless(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
if(null === $this->collCcFiless || null !== $criteria) {
if ($this->isNew() && null === $this->collCcFiless) {
return 0;
} else {
$query = CcFilesQuery::create(null, $criteria);
if($distinct) {
$query->distinct();
}
return $query
->filterByCcMusicDirs($this)
->count($con);
}
} else {
return count($this->collCcFiless);
}
}
/**
* Method called to associate a CcFiles object to this object
* through the CcFiles foreign key attribute.
*
* @param CcFiles $l CcFiles
* @return void
* @throws PropelException
*/
public function addCcFiles(CcFiles $l)
{
if ($this->collCcFiless === null) {
$this->initCcFiless();
}
if (!$this->collCcFiless->contains($l)) { // only add it if the **same** object is not already associated
$this->collCcFiless[]= $l;
$l->setCcMusicDirs($this);
}
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this CcMusicDirs is new, it will return
* an empty collection; or if this CcMusicDirs has previously
* been saved, it will retrieve related CcFiless 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 CcMusicDirs.
*
* @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 CcFiles[] List of CcFiles objects
*/
public function getCcFilessJoinCcSubjs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$query = CcFilesQuery::create(null, $criteria);
$query->joinWith('CcSubjs', $join_behavior);
return $this->getCcFiless($query, $con);
}
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->id = null;
$this->directory = null;
$this->type = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
}
/**
* Resets all collections of referencing foreign keys.
*
* This method is a user-space workaround for PHP's inability to garbage collect objects
* with circular references. This is currently necessary when using Propel in certain
* daemon or large-volumne/high-memory operations.
*
* @param boolean $deep Whether to also clear the references on all associated objects.
*/
public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collCcFiless) {
foreach ((array) $this->collCcFiless as $o) {
$o->clearAllReferences($deep);
}
}
} // if ($deep)
$this->collCcFiless = null;
}
/**
* Catches calls to virtual methods
*/
public function __call($name, $params)
{
if (preg_match('/get(\w+)/', $name, $matches)) {
$virtualColumn = $matches[1];
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
// no lcfirst in php<5.3...
$virtualColumn[0] = strtolower($virtualColumn[0]);
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
}
throw new PropelException('Call to undefined method: ' . $name);
}
} // BaseCcMusicDirs

View File

@ -0,0 +1,744 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_music_dirs' table.
*
*
*
* @package propel.generator.airtime.om
*/
abstract class BaseCcMusicDirsPeer {
/** the default database name for this class */
const DATABASE_NAME = 'airtime';
/** the table name for this class */
const TABLE_NAME = 'cc_music_dirs';
/** the related Propel class for this table */
const OM_CLASS = 'CcMusicDirs';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'airtime.CcMusicDirs';
/** the related TableMap class for this table */
const TM_CLASS = 'CcMusicDirsTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 3;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'cc_music_dirs.ID';
/** the column name for the DIRECTORY field */
const DIRECTORY = 'cc_music_dirs.DIRECTORY';
/** the column name for the TYPE field */
const TYPE = 'cc_music_dirs.TYPE';
/**
* An identiy map to hold any loaded instances of CcMusicDirs objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcMusicDirs[]
*/
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 ('Id', 'Directory', 'Type', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'directory', 'type', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::DIRECTORY, self::TYPE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DIRECTORY', 'TYPE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'directory', 'type', ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
/**
* 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 ('Id' => 0, 'Directory' => 1, 'Type' => 2, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DIRECTORY => 1, self::TYPE => 2, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DIRECTORY' => 1, 'TYPE' => 2, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, ),
BasePeer::TYPE_NUM => array (0, 1, 2, )
);
/**
* 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. CcMusicDirsPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcMusicDirsPeer::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(CcMusicDirsPeer::ID);
$criteria->addSelectColumn(CcMusicDirsPeer::DIRECTORY);
$criteria->addSelectColumn(CcMusicDirsPeer::TYPE);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.DIRECTORY');
$criteria->addSelectColumn($alias . '.TYPE');
}
}
/**
* 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(CcMusicDirsPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcMusicDirsPeer::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(CcMusicDirsPeer::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 CcMusicDirs
* @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 = CcMusicDirsPeer::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 CcMusicDirsPeer::populateObjects(CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcMusicDirsPeer::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 CcMusicDirs $value A CcMusicDirs object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcMusicDirs $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
} // 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 CcMusicDirs object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcMusicDirs) {
$key = (string) $value->getId();
} 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 CcMusicDirs 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 CcMusicDirs 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_music_dirs
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
}
/**
* 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 = CcMusicDirsPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcMusicDirsPeer::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;
CcMusicDirsPeer::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 (CcMusicDirs object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcMusicDirsPeer::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 + CcMusicDirsPeer::NUM_COLUMNS;
} else {
$cls = CcMusicDirsPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcMusicDirsPeer::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(BaseCcMusicDirsPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcMusicDirsPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcMusicDirsTableMap());
}
}
/**
* 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 ? CcMusicDirsPeer::CLASS_DEFAULT : CcMusicDirsPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcMusicDirs or Criteria object.
*
* @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcMusicDirs object
}
if ($criteria->containsKey(CcMusicDirsPeer::ID) && $criteria->keyContainsValue(CcMusicDirsPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::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 CcMusicDirs or Criteria object.
*
* @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcMusicDirsPeer::ID);
$value = $criteria->remove(CcMusicDirsPeer::ID);
if ($value) {
$selectCriteria->add(CcMusicDirsPeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcMusicDirsPeer::TABLE_NAME);
}
} else { // $values is CcMusicDirs 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_music_dirs 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(CcMusicDirsPeer::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(CcMusicDirsPeer::TABLE_NAME, $con, CcMusicDirsPeer::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).
CcMusicDirsPeer::clearInstancePool();
CcMusicDirsPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcMusicDirs or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::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.
CcMusicDirsPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcMusicDirs) { // it's a model object
// invalidate the cache for this single object
CcMusicDirsPeer::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(CcMusicDirsPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcMusicDirsPeer::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);
CcMusicDirsPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcMusicDirs 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 CcMusicDirs $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(CcMusicDirs $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcMusicDirsPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, CcMusicDirsPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcMusicDirs
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcMusicDirsPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
$criteria->add(CcMusicDirsPeer::ID, $pk);
$v = CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME);
$criteria->add(CcMusicDirsPeer::ID, $pks, Criteria::IN);
$objs = CcMusicDirsPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcMusicDirsPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcMusicDirsPeer::buildTableMap();

View File

@ -0,0 +1,285 @@
<?php
/**
* Base class that represents a query for the 'cc_music_dirs' table.
*
*
*
* @method CcMusicDirsQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcMusicDirsQuery orderByDirectory($order = Criteria::ASC) Order by the directory column
* @method CcMusicDirsQuery orderByType($order = Criteria::ASC) Order by the type column
*
* @method CcMusicDirsQuery groupById() Group by the id column
* @method CcMusicDirsQuery groupByDirectory() Group by the directory column
* @method CcMusicDirsQuery groupByType() Group by the type column
*
* @method CcMusicDirsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcMusicDirsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcMusicDirsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcMusicDirsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
* @method CcMusicDirsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
* @method CcMusicDirsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
*
* @method CcMusicDirs findOne(PropelPDO $con = null) Return the first CcMusicDirs matching the query
* @method CcMusicDirs findOneOrCreate(PropelPDO $con = null) Return the first CcMusicDirs matching the query, or a new CcMusicDirs object populated from the query conditions when no match is found
*
* @method CcMusicDirs findOneById(int $id) Return the first CcMusicDirs filtered by the id column
* @method CcMusicDirs findOneByDirectory(string $directory) Return the first CcMusicDirs filtered by the directory column
* @method CcMusicDirs findOneByType(string $type) Return the first CcMusicDirs filtered by the type column
*
* @method array findById(int $id) Return CcMusicDirs objects filtered by the id column
* @method array findByDirectory(string $directory) Return CcMusicDirs objects filtered by the directory column
* @method array findByType(string $type) Return CcMusicDirs objects filtered by the type column
*
* @package propel.generator.airtime.om
*/
abstract class BaseCcMusicDirsQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcMusicDirsQuery 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 = 'CcMusicDirs', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcMusicDirsQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcMusicDirsQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcMusicDirsQuery) {
return $criteria;
}
$query = new CcMusicDirsQuery();
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 CcMusicDirs|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcMusicDirsPeer::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 CcMusicDirsQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcMusicDirsPeer::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 CcMusicDirsQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcMusicDirsPeer::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* @param int|array $id 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 CcMusicDirsQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id) && null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(CcMusicDirsPeer::ID, $id, $comparison);
}
/**
* Filter the query on the directory column
*
* @param string $directory 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 CcMusicDirsQuery The current query, for fluid interface
*/
public function filterByDirectory($directory = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($directory)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $directory)) {
$directory = str_replace('*', '%', $directory);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcMusicDirsPeer::DIRECTORY, $directory, $comparison);
}
/**
* Filter the query on the type column
*
* @param string $type 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 CcMusicDirsQuery The current query, for fluid interface
*/
public function filterByType($type = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($type)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $type)) {
$type = str_replace('*', '%', $type);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcMusicDirsPeer::TYPE, $type, $comparison);
}
/**
* Filter the query by a related CcFiles object
*
* @param CcFiles $ccFiles the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcMusicDirsQuery The current query, for fluid interface
*/
public function filterByCcFiles($ccFiles, $comparison = null)
{
return $this
->addUsingAlias(CcMusicDirsPeer::ID, $ccFiles->getDbDirectory(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcFiles relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcMusicDirsQuery The current query, for fluid interface
*/
public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcFiles');
// 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, 'CcFiles');
}
return $this;
}
/**
* Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query
*/
public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcFiles($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
}
/**
* Exclude object from result
*
* @param CcMusicDirs $ccMusicDirs Object to remove from the list of results
*
* @return CcMusicDirsQuery The current query, for fluid interface
*/
public function prune($ccMusicDirs = null)
{
if ($ccMusicDirs) {
$this->addUsingAlias(CcMusicDirsPeer::ID, $ccMusicDirs->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcMusicDirsQuery

View File

@ -1669,6 +1669,31 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
/**
* If this collection has already been initialized with
* an identical criteria, it returns the collection.
* Otherwise if this CcSubjs is new, it will return
* an empty collection; or if this CcSubjs has previously
* been saved, it will retrieve related CcFiless 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 CcSubjs.
*
* @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 CcFiles[] List of CcFiles objects
*/
public function getCcFilessJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$query = CcFilesQuery::create(null, $criteria);
$query->joinWith('CcMusicDirs', $join_behavior);
return $this->getCcFiless($query, $con);
}
/**
* Clears out the collCcPermss collection
*

View File

@ -2,11 +2,13 @@
<?php echo $this->element->getSubform('preferences_general') ?>
<h3 class="collapsible-header" id="soundcloud-heading"><span class="arrow-icon"></span>SoundCloud Settings</h3>
<div class="collapsible-content" id="soundcloud-settings" style="display: none;">
<?php echo $this->element->getSubform('preferences_soundcloud') ?>
</div>
<h3 class="collapsible-header" id="support-heading"><span class="arrow-icon"></span>Support Settings</h3>
<div class="collapsible-content" id="support-settings" style="display: none;">
<?php echo $this->element->getSubform('preferences_support') ?>

View File

@ -73,19 +73,5 @@
</ul>
<?php endif; ?>
</dd>
<dt id="watchedFolder-label" class="block-display">
<label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label>
</dt>
<dd id="watchedFolder-element" class="block-display">
<?php echo $this->element->getElement('watchedFolder') ?>
<?php if($this->element->getElement('watchedFolder')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('watchedFolder')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dl>
</fieldset>

View File

@ -0,0 +1,31 @@
<dl class="zend_form">
<dt id="watchedFolder-label" class="block-display">
<label class="required" for="watchedFolder"><?php echo $this->element->getElement('watchedFolder')->getLabel() ?></label>
</dt>
<dd id="watchedFolder-element">
<?php echo $this->element->getElement('watchedFolder') ?>
<input id="watchedFolder-selection" type="button" value="choose folder"></input>
<?php if($this->element->getElement('watchedFolder')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('watchedFolder')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
<dd>
<input id="watchedFolder-ok" type="button" value="OK"></input>
</dd>
<div id="watchedFolder-table">
<?php $i = 1; ?>
<?php $element = $this->element->getElement("watched_dir_$i"); ?>
<?php while(isset($element)): ?>
<div><span><?php echo $element->getValue(); ?></span><span class="ui-icon ui-icon-close"></span></div>
<?php $i = $i + 1; ?>
<?php $element = $this->element->getElement("watched_dir_$i"); ?>
<?php endwhile; ?>
</div>
</dl>

View File

@ -0,0 +1,3 @@
<div id="watched-folder-section">
<?php echo $this->form; ?>
</div>

View File

@ -24,12 +24,21 @@
<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"/>
<column name="type" phpName="Type" type="VARCHAR" size="255" required="false"/>
<unique name="cc_music_dir_unique">
<unique-column name="directory"/>
</unique>
</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=""/>
<column name="directory" phpName="DbDirectory" type="INTEGER" required="false"/>
<column name="filepath" phpName="DbFilepath" type="LONGVARCHAR" required="false" defaultValue=""/>
<column name="state" phpName="DbState" type="VARCHAR" size="128" required="true" defaultValue="empty"/>
<column name="currentlyaccessing" phpName="DbCurrentlyaccessing" type="INTEGER" required="true" defaultValue="0"/>
@ -82,6 +91,9 @@
<foreign-key foreignTable="cc_subjs" name="cc_files_editedby_fkey">
<reference local="editedby" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="cc_music_dirs" name="cc_music_dirs_folder_fkey" onDelete="CASCADE">
<reference local="directory" foreign="id"/>
</foreign-key>
<unique name="cc_files_gunid_idx">
<unique-column name="gunid"/>
</unique>

View File

@ -30,6 +30,26 @@ CREATE INDEX "cc_access_parent_idx" ON "cc_access" ("parent");
CREATE INDEX "cc_access_token_idx" ON "cc_access" ("token");
-----------------------------------------------------------------------------
-- cc_music_dirs
-----------------------------------------------------------------------------
DROP TABLE "cc_music_dirs" CASCADE;
CREATE TABLE "cc_music_dirs"
(
"id" serial NOT NULL,
"directory" TEXT,
"type" VARCHAR(255),
PRIMARY KEY ("id"),
CONSTRAINT "cc_music_dir_unique" UNIQUE ("directory")
);
COMMENT ON TABLE "cc_music_dirs" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_files
-----------------------------------------------------------------------------
@ -44,6 +64,7 @@ CREATE TABLE "cc_files"
"name" VARCHAR(255) default '' NOT NULL,
"mime" VARCHAR(255) default '' NOT NULL,
"ftype" VARCHAR(128) default '' NOT NULL,
"directory" INTEGER,
"filepath" TEXT default '',
"state" VARCHAR(128) default 'empty' NOT NULL,
"currentlyaccessing" INTEGER default 0 NOT NULL,
@ -444,6 +465,8 @@ ALTER TABLE "cc_access" ADD CONSTRAINT "cc_access_owner_fkey" FOREIGN KEY ("owne
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") ON DELETE CASCADE;
ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey" FOREIGN KEY ("subj") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_instances" ADD CONSTRAINT "cc_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

View File

@ -1,12 +1,64 @@
function setWatchedDirEvents() {
$('#watchedFolder-selection').serverBrowser({
onSelect: function(path) {
$('#watchedFolder').val(path);
},
onLoad: function() {
return $('#watchedFolder').val();
},
width: 500,
height: 250,
position: ['center', 'center'],
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
knownPaths: [],
imageUrl: 'img/icons/',
systemImageUrl: 'img/browser/',
handlerUrl: '/Preference/server-browse/format/json',
title: 'Choose Folder to Watch',
basePath: '/home',
requestMethod: 'POST',
});
$('#watchedFolder-ok').click(function(){
var url, chosen;
url = "/Preference/reload-watch-directory";
chosen = $('#watchedFolder').val();
$.post(url,
{format: "json", dir: chosen},
function(json) {
$("#watched-folder-section").empty();
$("#watched-folder-section").append(json.subform);
setWatchedDirEvents();
});
});
$('#watchedFolder-table').find('.ui-icon-close').click(function(){
var row = $(this).parent();
var folder = $(this).prev().text();
url = "/Preference/remove-watch-directory";
$.post(url,
{format: "json", dir: folder},
function(json) {
row.remove();
});
});
}
$(document).ready(function() {
var form = $("form");
$('.collapsible-header').live('click',function() {
$(this).next().toggle('fast');
$(this).toggleClass("close");
return false;
}).next().hide();
$("#SupportFeedback").click( function(){
var pub = $("#Publicise");
if( !$(this).is(':checked') ){
@ -16,9 +68,10 @@ $(document).ready(function() {
pub.removeAttr("disabled");
}
});
showErrorSections();
setWatchedDirEvents();
});
function showErrorSections() {
@ -35,17 +88,17 @@ function showErrorSections() {
function resizeImg(ele){
var img = $(ele);
var width = ele.width;
var height = ele.height;
// resize img proportionaly
if( width > height && width > 450){
var ratio = 450/width;
img.css("width", "450px");
var newHeight = height * ratio;
img.css("height", newHeight );
}else if( width < height && height > 450){
var ratio = 450/height;
img.css("height", "450px");
@ -55,7 +108,10 @@ function resizeImg(ele){
img.css("height", "450px");
img.css("width", "450px" );
}
}
});

View File

@ -0,0 +1,370 @@
/*
author: ApmeM (artem.votincev@gmail.com)
date: 9-June-2010
version: 1.4
download: http://code.google.com/p/jq-serverbrowse/
*/
(function($) {
$.fn.serverBrowser = function(settings) {
this.each(function() {
var config = {
// Event function
// Appear when user click 'Ok' button, or doubleclick on file
onSelect: function(file) {
alert('You select: ' + file);
},
onLoad: function() {
return config.basePath;
},
multiselect: false,
// Image parameters
// System images (loading.gif, unknown.png, folder.png and images from knownPaths) will be referenced to systemImageUrl
// if systemImageUrl is empty or not specified - imageUrl will be taken
// All other images (like images for extension) will be taken from imageUrl
imageUrl: 'img/',
systemImageUrl: '',
showUpInList: false,
// Path properties
// Base path, that links should start from.
// If opened path is not under this path, alert will be shown and nothing will be opened
// Path separator, that will be used to split specified paths and join paths to a string
basePath: 'C:',
separatorPath: '/',
// Paths, that will be displayed on the left side of the dialog
// This is a link to specified paths on the server
useKnownPaths: true,
knownPaths: [{text:'Desktop', image:'desktop.png', path:'C:/Users/All Users/Desktop'},
{text:'Documents', image:'documents.png', path:'C:/Users/All Users/Documents'}],
// Images for known extension (like 'png', 'exe', 'zip'), that will be displayed with its real names
// Images, that is not in this list will be referenced to 'unknown.png' image
// If list is empty - all images is known.
knownExt: [],
// Server path to this plugin handler
handlerUrl: 'browserDlg.txt',
// JQuery-ui dialog settings
title: 'Browse',
width: 300,
height: 300,
position: ['center', 'top'],
// Administrative parameters used to
// help programmer or system administrator
requestMethod: 'POST',
};
if (settings) $.extend(config, settings);
// Required configuration elements
// We need to set some configuration elements without user
// For example there should be 2 buttons on the bottom,
// And dialog should be opened after button is pressed, not when it created
// Also we need to know about dialog resizing
$.extend(config, {
autoOpen: false,
modal: true,
buttons: {
"Cancel": function() {
browserDlg.dialog("close");
},
"Open": function() {
doneOk();
},
},
resize: function(event, ui) {
recalculateSize(event, ui);
},
});
function systemImageUrl()
{
if (config.systemImageUrl.length == 0) {
return config.imageUrl;
} else{
return config.systemImageUrl;
}
}
var privateConfig = {
// This stack array will store history navigation data
// When user open new directory, old directory will be added to this list
// If user want, he will be able to move back by this history
browserHistory: [],
// This array contains all currently selected items
// When user select element, it will add associated path into this array
// When user deselect element - associated path will be removed
// Exception: if 'config.multiselect' is false, only one element will be stored in this array.
selectedItems: [],
}
// Main dialog div
// It will be converted into jQuery-ui dialog box using my configuration parameters
// It contains 3 divs
var browserDlg = $('<div title="' + config.title + '"></div>').css({'overflow': 'hidden'}).appendTo(document.body);
browserDlg.dialog(config);
// First div on the top
// It contains textbox field and buttons
// User can enter any paths he want to open in this textbox and press enter
// There is 3 buttons on the panel:
var enterPathDiv = $('<div></div>').addClass('ui-widget-content').appendTo(browserDlg).css({'height': '30px', 'width': '100%', 'padding-top': '7px'});
var enterButton = $('<div></div>').css({'float': 'left', 'vertical-align': 'middle', 'margin-left': '6px'}).addClass('ui-corner-all').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
var enterLabel = $('<span></span>').text('Look in: ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
var enterText = $('<input type="text">').keypress(function(e) {
if (e.keyCode == '13') {
e.preventDefault();
loadPath(enterText.val());
}
}).appendTo(enterButton.clone(false).appendTo(enterPathDiv));
// Back button.
// When user click on it, 2 last elements of the history pop from the list, and reload second of them.
var enterBack = $('<div></div>').addClass('ui-corner-all ui-icon ui-icon-circle-arrow-w').click(function(){
privateConfig.browserHistory.pop(); // Remove current element. It is not required now.
var backPath = config.basePath;
if(privateConfig.browserHistory.length > 0){
backPath = privateConfig.browserHistory.pop();
}
loadPath(backPath);
}).appendTo(enterButton.clone(true).appendTo(enterPathDiv));
// Level Up Button
// When user click on it, last element of the history will be taken, and '..' will be applied to the end of the array.
var enterUp = $('<div></div>').addClass('ui-corner-all ui-icon ui-icon-arrowreturnthick-1-n').click(function(){
backPath = privateConfig.browserHistory[privateConfig.browserHistory.length - 1];
if(backPath != config.basePath){
loadPath(backPath + config.separatorPath + '..');
}
}).appendTo(enterButton.clone(true).appendTo(enterPathDiv));
// Second div is on the left
// It contains images and texts for pre-defined paths
// User just click on them and it will open pre-defined path
var knownPathDiv = $('<div></div>').addClass('ui-widget-content').css({'text-align':'center', 'overflow': 'auto', 'float': 'left', 'width': '100px'});
if(config.useKnownPaths){
knownPathDiv.appendTo(browserDlg);
$.each(config.knownPaths, function(index, path) {
var knownDiv = $('<div></div>').css({'margin':'10px'}).hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
).click(function() {
loadPath(path.path);
}).appendTo(knownPathDiv);
$('<img />').attr({ src: systemImageUrl() + config.separatorPath + path.image }).css({ width: '32px', margin: '5px 10px 5px 5px' }).appendTo(knownDiv);
$('<br/>').appendTo(knownDiv);
$('<span></span>').text(path.text).appendTo(knownDiv);
});
}
// Third div is everywhere :)
// It show files and folders in the current path
// User can click on path to select or deselect it
// Doubleclick on path will open it
// Also doubleclick on file will select this file and close dialog
var browserPathDiv = $('<div></div>').addClass('ui-widget-content').css({'float': 'right', 'overflow': 'auto'}).appendTo(browserDlg);
// Now everything is done
// When user will be ready - he just click on the area you select for this plugin and dialog will appear
$(this).click(function() {
privateConfig.browserHistory = [];
var startpath = removeBackPath(config.onLoad());
startpath = startpath.split(config.separatorPath);
startpath.pop();
startpath = startpath.join(config.separatorPath);
if(!checkBasePath(startpath)){
startpath = config.basePath;
}
loadPath(startpath);
browserDlg.dialog('open');
recalculateSize();
});
// Function check if specified path is a child path of a 'config.basePath'
// If it is not - user should see message, that path invalid, or path should be changed to valid.
function checkBasePath(path){
if(config.basePath == '')
return true;
var confPath = config.basePath.split(config.separatorPath);
var curPath = path.split(config.separatorPath);
if(confPath.length > curPath.length)
return false;
var result = true;
$.each(confPath, function(index, partConfPath) {
if(partConfPath != curPath[index]){
result = false;
}
});
return result;
}
// Function remove '..' parts of the path
// Process depend on config.separatorPath option
// On the server side you need to check / or \ separators
function removeBackPath(path){
var confPath = config.basePath.split(config.separatorPath);
var curPath = path.split(config.separatorPath);
var newcurPath = [];
$.each(curPath, function(index, partCurPath) {
if(partCurPath == ".."){
newcurPath.pop();
}else{
newcurPath.push(partCurPath);
}
});
return newcurPath.join(config.separatorPath);
}
// This function will be called when user click 'Open'
// It check if any path is selected, and call config.onSelect function with path list
function doneOk(){
var newCurPath = [];
$.each(privateConfig.selectedItems, function(index, item) {
newCurPath.push($.data(item, 'path'));
});
if(newCurPath.length == 0) {
newCurPath.push(privateConfig.browserHistory.pop());
}
if(config.multiselect)
config.onSelect(newCurPath);
else {
if(newCurPath.length == 1) {
config.onSelect(newCurPath[0]);
} else if(newCurPath.length > 1){
alert('Plugin work incorrectly. If error repeat, please add issue into http://code.google.com/p/jq-serverbrowse/issues/list with steps to reproduce.');
return;
}
}
browserDlg.dialog("close");
}
// Function recalculate and set new width and height for left and right div elements
// height have '-2' because of the borders
// width have '-4' because of a border an 2 pixels space between divs
function recalculateSize(event, ui){
knownPathDiv.css({'height' : browserDlg.height() - enterPathDiv.outerHeight(true) - 2});
browserPathDiv.css({'height' : browserDlg.height() - enterPathDiv.outerHeight(true) - 2,
'width' : browserDlg.width() - knownPathDiv.outerWidth(true) - 4});
}
// Function adds new element into browserPathDiv element depends on file parameters
// If file.isError is set, error message will be displayed instead of clickable area
// Clickable div contain image from extension and text from file parameter
function addElement(file){
var itemDiv = $('<div></div>').css({ margin: '2px' }).appendTo(browserPathDiv);
if(file.isError)
{
itemDiv.addClass('ui-state-error ui-corner-all').css({padding: '0pt 0.7em'});
var p = $('<p></p>').appendTo(itemDiv);
$('<span></span>').addClass('ui-icon ui-icon-alert').css({'float': 'left', 'margin-right': '0.3em'}).appendTo(p);
$('<span></span>').text(file.name).appendTo(p);
}else
{
var fullPath = file.path + config.separatorPath + file.name;
itemDiv.hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
var itemImage = $('<img />').css({ width: '16px', margin: '0 5px 0 0' }).appendTo(itemDiv);
var itemText = $('<span></span>').text(file.name).appendTo(itemDiv);
if (file.isFolder)
itemImage.attr({ src: systemImageUrl() + 'folder.png' });
else {
ext = file.name.split('.').pop();
var res = '';
if (ext == '' || ext == file.name || (config.knownExt.length > 0 && $.inArray(ext, config.knownExt) < 0))
itemImage.attr({ src: systemImageUrl() + 'unknown.png' });
else
itemImage.attr({ src: config.imageUrl + ext + '.png' });
}
$.data(itemDiv, 'path', fullPath);
itemDiv.unbind('click').bind('click', function(e) {
if(!$(this).hasClass('ui-state-active')) {
if(!config.multiselect && privateConfig.selectedItems.length > 0) {
$(privateConfig.selectedItems[0]).click();
}
privateConfig.selectedItems.push(itemDiv);
}else{
var newCurPath = [];
$.each(privateConfig.selectedItems, function(index, item) {
if($.data(item, 'path') != fullPath)
newCurPath.push(item);
});
privateConfig.selectedItems = newCurPath;
}
$(this).toggleClass('ui-state-active');
});
itemDiv.unbind('dblclick').bind('dblclick', function(e) {
if (file.isFolder){
loadPath(fullPath);
} else {
privateConfig.selectedItems = [itemDiv];
doneOk();
}
});
}
}
// Main plugin function
// When user enter path manually, select it from pre-defined path, or doubleclick in browser this function will call
// It send a request on the server to retrieve child directories and files of the specified path
// If path is not under 'config.basePath', alert will be shown and nothing will be opened
function loadPath(path) {
privateConfig.selectedItems = [];
// First we need to remove all '..' parts of the path
path = removeBackPath(path);
// Then we need to check, if path based on 'config.basePath'
if(!checkBasePath(path)) {
alert('Path should be based from ' + config.basePath);
return;
}
// Then we can put this path into history
privateConfig.browserHistory.push(path);
// Show it to user
enterText.val(path);
// And load
$.ajax({
url: config.handlerUrl,
type: config.requestMethod,
data: {
action: 'browse',
path: path,
time: new Date().getTime()
},
beforeSend: function() {
browserPathDiv.empty().css({ 'text-align': 'center' });
$('<img />').attr({ src: systemImageUrl() + 'loading.gif' }).css({ width: '32px' }).appendTo(browserPathDiv);
},
success: function(files) {
browserPathDiv.empty().css({ 'text-align': 'left' });
if(path != config.basePath && config.showUpInList){
addElement({name: '..', isFolder: true, isError: false, path: path});
}
$.each(files, function(index, file) {
addElement($.extend(file, {path: path}));
});
},
dataType: 'json'
});
}
});
return this;
};
})(jQuery);

View File

@ -149,6 +149,15 @@ class AirtimeInstall
$success = chmod($rp, 02777);
$CC_CONFIG['storageDir'] = $rp;
AirtimeInstall::DbConnect(true);
//add stor directory to MusiDirs
$sql = "INSERT INTO cc_music_dirs (directory, type) VALUES ('$rp', 'stor')";
$result = $CC_DBC->query($sql);
if (PEAR::isError($result)) {
echo "* Failed inserting {$rp} in cc_music_dirs".PHP_EOL;
echo "* Message {$result->getMessage()}".PHP_EOL;
exit(1);
}
}
public static function CreateDatabaseUser()
@ -225,6 +234,7 @@ class AirtimeInstall
echo "* Creating database tables".PHP_EOL;
// Put Propel sql files in Database
//$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql";
$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql 2>/dev/null";
@exec($command, $output, $results);
}

View File

@ -203,6 +203,7 @@ class AirtimeNotifier(Notifier):
self.md_manager = MetadataExtractor()
self.import_processes = {}
self.watched_folders = []
self.watches_to_remove = []
def handle_message(self, body, message):
# ACK the message to take it off the queue
@ -222,6 +223,9 @@ class AirtimeNotifier(Notifier):
self.import_processes[m['directory']] = p
#add this new folder to our list of watched folders
self.watched_folders.append(m['directory'])
elif m['event_type'] == "remove_watch":
self.watches_to_remove.append(m['directory'])
def update_airtime(self, d):
@ -444,9 +448,13 @@ class MediaMonitor(ProcessEvent):
#this file is new, md5 does not exist in Airtime.
if(response['airtime_status'] == 0):
filepath = self.create_file_path(event.pathname)
self.move_file(event.pathname, filepath)
self.file_events.append({'mode': MODE_CREATE, 'filepath': filepath})
global storage_directory
if self.is_parent_directory(event.pathname, storage_directory):
filepath = self.create_file_path(event.pathname)
self.move_file(event.pathname, filepath)
self.file_events.append({'mode': MODE_CREATE, 'filepath': filepath})
else:
self.file_events.append({'mode': MODE_CREATE, 'filepath': event.pathname})
else:
self.set_needed_file_permissions(event.pathname, event.dir)
@ -495,9 +503,13 @@ class MediaMonitor(ProcessEvent):
else:
#TODO need to pass in if md5 exists to this file creation function, identical files will just replace current files not have a (1) etc.
#file has been most likely dropped into stor folder from an unwatched location. (from gui, mv command not cp)
md_filepath = self.create_file_path(event.pathname)
self.move_file(event.pathname, md_filepath)
self.file_events.append({'mode': MODE_CREATE, 'filepath': md_filepath})
global storage_directory
if self.is_parent_directory(event.pathname, storage_directory):
md_filepath = self.create_file_path(event.pathname)
self.move_file(event.pathname, md_filepath)
self.file_events.append({'mode': MODE_CREATE, 'filepath': md_filepath})
else:
self.file_events.append({'mode': MODE_CREATE, 'filepath': event.pathname})
def process_IN_DELETE(self, event):
if not event.dir:
@ -509,6 +521,15 @@ class MediaMonitor(ProcessEvent):
def notifier_loop_callback(self, notifier):
#recursively unwatch any directories.
for watched_directory in notifier.watches_to_remove:
wd = self.wm.get_wd(watched_directory)
self.logger.info("Removing watch on: %s wdd %s", watched_directory, wd)
self.wm.rm_watch(wd, rec=True)
notifier.watches_to_remove = []
for watched_directory in notifier.import_processes.keys():
process = notifier.import_processes[watched_directory]
if not process.is_alive():