Merge branch 'devel' into 2.3.x-saas
Conflicts: airtime_mvc/application/controllers/PreferenceController.php airtime_mvc/application/forms/AddShowWhen.php airtime_mvc/application/forms/GeneralPreferences.php airtime_mvc/application/forms/LiveStreamingPreferences.php airtime_mvc/application/forms/SoundcloudPreferences.php airtime_mvc/application/forms/SupportSettings.php airtime_mvc/application/views/scripts/form/preferences.phtml airtime_mvc/application/views/scripts/form/preferences_email_server.phtml airtime_mvc/application/views/scripts/form/preferences_general.phtml airtime_mvc/application/views/scripts/form/preferences_livestream.phtml airtime_mvc/application/views/scripts/form/support-setting.phtml airtime_mvc/application/views/scripts/schedule/add- show-form.phtml airtime_mvc/public/js/airtime/preferences/preferences.js python_apps/api_clients/api_client.py python_apps/pypo/listenerstat.py
This commit is contained in:
commit
8cd6bd9aa4
346 changed files with 48955 additions and 11856 deletions
|
@ -30,10 +30,10 @@ class Application_Model_Auth
|
|||
$e_link_port = $_SERVER['SERVER_PORT'];
|
||||
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
|
||||
|
||||
$message = "Hi {$user->getDbLogin()}, \n\nClick this link to reset your password: ";
|
||||
$message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
|
||||
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
|
||||
|
||||
$success = Application_Model_Email::send('Airtime Password Reset', $message, $user->getDbEmail());
|
||||
$success = Application_Model_Email::send(_('Airtime Password Reset'), $message, $user->getDbEmail());
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
|
|
@ -395,12 +395,13 @@ SQL;
|
|||
{
|
||||
$file = CcFilesQuery::create()->findPK($p_item, $this->con);
|
||||
|
||||
if (isset($file) && $file->getDbFileExists()) {
|
||||
if (isset($file) && $file->visible()) {
|
||||
$entry = $this->blockItem;
|
||||
$entry["id"] = $file->getDbId();
|
||||
$entry["pos"] = $pos;
|
||||
$entry["cliplength"] = $file->getDbLength();
|
||||
$entry["cueout"] = $file->getDbLength();
|
||||
$entry["cueout"] = $file->getDbCueout();
|
||||
$entry["cuein"] = $file->getDbCuein();
|
||||
|
||||
return $entry;
|
||||
} else {
|
||||
|
@ -410,11 +411,7 @@ SQL;
|
|||
|
||||
public function isStatic()
|
||||
{
|
||||
if ($this->block->getDbType() == "static") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return $this->block->getDbType() == "static";
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -760,7 +757,7 @@ SQL;
|
|||
|
||||
try {
|
||||
if (is_null($cueIn) && is_null($cueOut)) {
|
||||
$errArray["error"] = "Cue in and cue out are null.";
|
||||
$errArray["error"] = _("Cue in and cue out are null.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -795,7 +792,7 @@ SQL;
|
|||
);
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||
if ($result) {
|
||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
||||
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
|
@ -806,7 +803,7 @@ SQL;
|
|||
);
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||
if ($result) {
|
||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
||||
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
|
@ -827,7 +824,7 @@ SQL;
|
|||
);
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||
if ($result) {
|
||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
||||
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
|
@ -851,7 +848,7 @@ SQL;
|
|||
);
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||
if ($result) {
|
||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
||||
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
|
@ -862,7 +859,7 @@ SQL;
|
|||
);
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
|
||||
if ($result) {
|
||||
$errArray["error"] = "Can't set cue out to be smaller than cue in.";
|
||||
$errArray["error"] = _("Can't set cue out to be smaller than cue in.");
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
|
@ -943,9 +940,8 @@ SQL;
|
|||
|
||||
public static function getBlockCount()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = 'SELECT count(*) as cnt FROM '.$CC_CONFIG["playListTable"];
|
||||
$sql = 'SELECT count(*) as cnt FROM cc_playlist';
|
||||
|
||||
return $con->query($sql)->fetchColumn(0);
|
||||
}
|
||||
|
@ -1210,32 +1206,32 @@ SQL;
|
|||
public function getCriteria()
|
||||
{
|
||||
$criteriaOptions = array(
|
||||
0 => "Select criteria",
|
||||
"album_title" => "Album",
|
||||
"bit_rate" => "Bit Rate (Kbps)",
|
||||
"bpm" => "BPM",
|
||||
"composer" => "Composer",
|
||||
"conductor" => "Conductor",
|
||||
"copyright" => "Copyright",
|
||||
"artist_name" => "Creator",
|
||||
"encoded_by" => "Encoded By",
|
||||
"genre" => "Genre",
|
||||
"isrc_number" => "ISRC",
|
||||
"label" => "Label",
|
||||
"language" => "Language",
|
||||
"mtime" => "Last Modified",
|
||||
"lptime" => "Last Played",
|
||||
"length" => "Length",
|
||||
"mime" => "Mime",
|
||||
"mood" => "Mood",
|
||||
"owner_id" => "Owner",
|
||||
"replay_gain" => "Replay Gain",
|
||||
"sample_rate" => "Sample Rate (kHz)",
|
||||
"track_title" => "Title",
|
||||
"track_number" => "Track Number",
|
||||
"utime" => "Uploaded",
|
||||
"info_url" => "Website",
|
||||
"year" => "Year"
|
||||
0 => _("Select criteria"),
|
||||
"album_title" => _("Album"),
|
||||
"bit_rate" => _("Bit Rate (Kbps)"),
|
||||
"bpm" => _("BPM"),
|
||||
"composer" => _("Composer"),
|
||||
"conductor" => _("Conductor"),
|
||||
"copyright" => _("Copyright"),
|
||||
"artist_name" => _("Creator"),
|
||||
"encoded_by" => _("Encoded By"),
|
||||
"genre" => _("Genre"),
|
||||
"isrc_number" => _("ISRC"),
|
||||
"label" => _("Label"),
|
||||
"language" => _("Language"),
|
||||
"mtime" => _("Last Modified"),
|
||||
"lptime" => _("Last Played"),
|
||||
"length" => _("Length"),
|
||||
"mime" => _("Mime"),
|
||||
"mood" => _("Mood"),
|
||||
"owner_id" => _("Owner"),
|
||||
"replay_gain" => _("Replay Gain"),
|
||||
"sample_rate" => _("Sample Rate (kHz)"),
|
||||
"track_title" => _("Title"),
|
||||
"track_number" => _("Track Number"),
|
||||
"utime" => _("Uploaded"),
|
||||
"info_url" => _("Website"),
|
||||
"year" => _("Year")
|
||||
);
|
||||
|
||||
// Load criteria from db
|
||||
|
@ -1363,6 +1359,7 @@ SQL;
|
|||
|
||||
// check if file exists
|
||||
$qry->add("file_exists", "true", Criteria::EQUAL);
|
||||
$qry->add("hidden", "false", Criteria::EQUAL);
|
||||
$qry->addAscendingOrderByColumn('random()');
|
||||
}
|
||||
// construct limit restriction
|
||||
|
|
35
airtime_mvc/application/models/Locale.php
Normal file
35
airtime_mvc/application/models/Locale.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
class Application_Model_Locale
|
||||
{
|
||||
public static function getLocales()
|
||||
{
|
||||
$con = Propel::getConnection();
|
||||
$sql = "SELECT * FROM cc_locale";
|
||||
$res = $con->query($sql)->fetchAll();
|
||||
$out = array();
|
||||
foreach ($res as $r) {
|
||||
$out[$r["locale_code"]] = $r["locale_lang"];
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
public static function configureLocalization($locale = null)
|
||||
{
|
||||
$codeset = 'UTF-8';
|
||||
if (is_null($locale)) {
|
||||
$lang = Application_Model_Preference::GetLocale().'.'.$codeset;
|
||||
} else {
|
||||
$lang = $locale.'.'.$codeset;
|
||||
}
|
||||
putenv("LC_ALL=$lang");
|
||||
putenv("LANG=$lang");
|
||||
$res = setlocale(LC_MESSAGES, $lang);
|
||||
|
||||
$domain = 'airtime';
|
||||
bindtextdomain($domain, '/usr/share/airtime/locale');
|
||||
textdomain($domain);
|
||||
bind_textdomain_codeset($domain, $codeset);
|
||||
}
|
||||
}
|
|
@ -157,15 +157,15 @@ SQL;
|
|||
$diff = strlen($dir) - strlen($p_path);
|
||||
if ($diff == 0) {
|
||||
if ($dir == $p_path) {
|
||||
throw new NestedDirectoryException("'$p_path' is already watched.");
|
||||
throw new NestedDirectoryException(sprintf(_("%s is already watched."), $p_path));
|
||||
}
|
||||
} elseif ($diff > 0) {
|
||||
if (self::isAncestorDir($p_path, $dir)) {
|
||||
throw new NestedDirectoryException("'$p_path' contains nested watched directory: '$dir'");
|
||||
throw new NestedDirectoryException(sprintf(_("%s contains nested watched directory: %s"), $p_path, $dir));
|
||||
}
|
||||
} else { /* diff < 0*/
|
||||
if (self::isAncestorDir($dir, $p_path)) {
|
||||
throw new NestedDirectoryException("'$p_path' is nested within existing watched directory: '$dir'");
|
||||
throw new NestedDirectoryException(sprintf(_("%s is nested within existing watched directory: %s"), $p_path, $dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ SQL;
|
|||
public static function addDir($p_path, $p_type, $userAddedWatchedDir=true, $nestedWatch=false)
|
||||
{
|
||||
if (!is_dir($p_path)) {
|
||||
return array("code"=>2, "error"=>"'$p_path' is not a valid directory.");
|
||||
return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_path));
|
||||
}
|
||||
$real_path = Application_Common_OsPath::normpath($p_path)."/";
|
||||
if ($real_path != "/") {
|
||||
|
@ -227,7 +227,8 @@ SQL;
|
|||
|
||||
return array("code"=>1, "error"=>"$msg");
|
||||
} catch (Exception $e) {
|
||||
return array("code"=>1, "error"=>"'$p_path' is already set as the current storage dir or in the watched folders list");
|
||||
return array("code"=>1,
|
||||
"error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list"), $p_path));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -246,50 +247,49 @@ SQL;
|
|||
{
|
||||
$res = self::addDir($p_path, "watched", $userAddedWatchedDir, $nestedWatch);
|
||||
|
||||
if ($res['code'] == 0) {
|
||||
if ($res['code'] != 0) { return $res; }
|
||||
|
||||
//convert "linked" files (Airtime <= 1.8.2) to watched files.
|
||||
$propel_link_dir = CcMusicDirsQuery::create()
|
||||
->filterByType('link')
|
||||
//convert "linked" files (Airtime <= 1.8.2) to watched files.
|
||||
$propel_link_dir = CcMusicDirsQuery::create()
|
||||
->filterByType('link')
|
||||
->findOne();
|
||||
|
||||
//see if any linked files exist.
|
||||
if (isset($propel_link_dir)) {
|
||||
|
||||
//newly added watched directory object
|
||||
$propel_new_watch = CcMusicDirsQuery::create()
|
||||
->filterByDirectory(Application_Common_OsPath::normpath($p_path)."/")
|
||||
->findOne();
|
||||
|
||||
//see if any linked files exist.
|
||||
if (isset($propel_link_dir)) {
|
||||
//any files of the deprecated "link" type.
|
||||
$link_files = CcFilesQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->filterByDbDirectory($propel_link_dir->getId())
|
||||
->find();
|
||||
|
||||
//newly added watched directory object
|
||||
$propel_new_watch = CcMusicDirsQuery::create()
|
||||
->filterByDirectory(Application_Common_OsPath::normpath($p_path)."/")
|
||||
->findOne();
|
||||
$newly_watched_dir = $propel_new_watch->getDirectory();
|
||||
|
||||
//any files of the deprecated "link" type.
|
||||
$link_files = CcFilesQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->filterByDbDirectory($propel_link_dir->getId())
|
||||
->find();
|
||||
foreach ($link_files as $link_file) {
|
||||
$link_filepath = $link_file->getDbFilepath();
|
||||
|
||||
$newly_watched_dir = $propel_new_watch->getDirectory();
|
||||
//convert "link" file into a watched file.
|
||||
if ((strlen($newly_watched_dir) < strlen($link_filepath)) && (substr($link_filepath, 0, strlen($newly_watched_dir)) === $newly_watched_dir)) {
|
||||
|
||||
foreach ($link_files as $link_file) {
|
||||
$link_filepath = $link_file->getDbFilepath();
|
||||
//get the filepath path not including the watched directory.
|
||||
$sub_link_filepath = substr($link_filepath, strlen($newly_watched_dir));
|
||||
|
||||
//convert "link" file into a watched file.
|
||||
if ((strlen($newly_watched_dir) < strlen($link_filepath)) && (substr($link_filepath, 0, strlen($newly_watched_dir)) === $newly_watched_dir)) {
|
||||
|
||||
//get the filepath path not including the watched directory.
|
||||
$sub_link_filepath = substr($link_filepath, strlen($newly_watched_dir));
|
||||
|
||||
$link_file->setDbDirectory($propel_new_watch->getId());
|
||||
$link_file->setDbFilepath($sub_link_filepath);
|
||||
$link_file->save();
|
||||
}
|
||||
$link_file->setDbDirectory($propel_new_watch->getId());
|
||||
$link_file->setDbFilepath($sub_link_filepath);
|
||||
$link_file->save();
|
||||
}
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data["directory"] = $p_path;
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data["directory"] = $p_path;
|
||||
Application_Model_RabbitMq::SendMessageToMediaMonitor("new_watch", $data);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ SQL;
|
|||
// path should always ends with trailing '/'
|
||||
$p_dir = Application_Common_OsPath::normpath($p_dir)."/";
|
||||
if (!is_dir($p_dir)) {
|
||||
return array("code"=>2, "error"=>"'$p_dir' is not a valid directory.");
|
||||
return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_dir));
|
||||
} elseif (Application_Model_Preference::GetImportTimestamp()+10 > time()) {
|
||||
return array("code"=>3, "error"=>"Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
|
||||
}
|
||||
|
@ -377,7 +377,8 @@ SQL;
|
|||
|
||||
return array("code"=>0);
|
||||
} else {
|
||||
return array("code"=>1, "error"=>"'$p_dir' is already set as the current storage dir or in the watched folders list.");
|
||||
return array("code"=>1,
|
||||
"error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list."), $p_dir));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -420,7 +421,7 @@ SQL;
|
|||
}
|
||||
$dir = Application_Model_MusicDir::getDirByPath($p_dir);
|
||||
if (is_null($dir)) {
|
||||
return array("code"=>1, "error"=>"'$p_dir' doesn't exist in the watched list.");
|
||||
return array("code"=>1, "error"=>sprintf(_("%s doesn't exist in the watched list."), $p_dir));
|
||||
} else {
|
||||
$dir->remove($userAddedWatchedDir);
|
||||
$data = array();
|
||||
|
@ -445,4 +446,16 @@ SQL;
|
|||
return array($mus_dir->getDirectory(), trim($fp));
|
||||
}
|
||||
|
||||
|
||||
public function unhideFiles()
|
||||
{
|
||||
$files = $this->_dir->getCcFiless();
|
||||
$hid = 0;
|
||||
foreach ($files as $file) {
|
||||
$hid++;
|
||||
$file->setDbHidden(false);
|
||||
$file->save();
|
||||
}
|
||||
Logging::info("unhide '$hid' files");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -387,13 +387,19 @@ SQL;
|
|||
}
|
||||
|
||||
if (isset($obj)) {
|
||||
if (($obj instanceof CcFiles && $obj->getDbFileExists()) || $obj instanceof CcWebstream || $obj instanceof CcBlock) {
|
||||
$entry = $this->plItem;
|
||||
$entry["id"] = $obj->getDbId();
|
||||
$entry["pos"] = $pos;
|
||||
if (($obj instanceof CcFiles && $obj->visible())
|
||||
|| $obj instanceof CcWebstream ||
|
||||
$obj instanceof CcBlock) {
|
||||
|
||||
$entry = $this->plItem;
|
||||
$entry["id"] = $obj->getDbId();
|
||||
$entry["pos"] = $pos;
|
||||
$entry["cliplength"] = $obj->getDbLength();
|
||||
$entry["cueout"] = $obj->getDbLength();
|
||||
$entry["ftype"] = $objType;
|
||||
if ($obj instanceof CcFiles && $obj) {
|
||||
$entry["cuein"] = $obj->getDbCuein();
|
||||
$entry["cueout"] = $obj->getDbCueout();
|
||||
}
|
||||
$entry["ftype"] = $objType;
|
||||
}
|
||||
|
||||
return $entry;
|
||||
|
@ -632,7 +638,7 @@ SQL;
|
|||
//setting it to nonNull for checks down below
|
||||
$fadeIn = $fadeIn?'00:00:'.$fadeIn:$fadeIn;
|
||||
$fadeOut = $fadeOut?'00:00:'.$fadeOut:$fadeOut;
|
||||
|
||||
|
||||
$this->con->beginTransaction();
|
||||
|
||||
try {
|
||||
|
@ -643,7 +649,6 @@ SQL;
|
|||
}
|
||||
|
||||
$clipLength = $row->getDbCliplength();
|
||||
|
||||
if (!is_null($fadeIn)) {
|
||||
|
||||
$sql = "SELECT :fadein::INTERVAL > INTERVAL '{$clipLength}'";
|
||||
|
@ -662,11 +667,9 @@ SQL;
|
|||
}
|
||||
$row->setDbFadeout($fadeOut);
|
||||
}
|
||||
|
||||
$row->save($this->con);
|
||||
$this->pl->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
|
||||
$this->pl->save($this->con);
|
||||
|
||||
|
||||
$this->con->commit();
|
||||
} catch (Exception $e) {
|
||||
$this->con->rollback();
|
||||
|
@ -687,7 +690,6 @@ SQL;
|
|||
|
||||
$this->changeFadeInfo($row->getDbId(), $fadein, null);
|
||||
}
|
||||
|
||||
if (isset($fadeout)) {
|
||||
Logging::info("Setting playlist fade out {$fadeout}");
|
||||
$row = CcPlaylistcontentsQuery::create()
|
||||
|
@ -718,7 +720,7 @@ SQL;
|
|||
|
||||
try {
|
||||
if (is_null($cueIn) && is_null($cueOut)) {
|
||||
$errArray["error"] = "Cue in and cue out are null.";
|
||||
$errArray["error"] = _("Cue in and cue out are null.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -748,14 +750,14 @@ SQL;
|
|||
|
||||
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
|
||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
||||
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
||||
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -771,7 +773,7 @@ SQL;
|
|||
|
||||
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
|
||||
$errArray["error"] = "Can't set cue in to be larger than cue out.";
|
||||
$errArray["error"] = _("Can't set cue in to be larger than cue out.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -789,14 +791,14 @@ SQL;
|
|||
|
||||
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
|
||||
$errArray["error"] = "Can't set cue out to be smaller than cue in.";
|
||||
$errArray["error"] = _("Can't set cue out to be smaller than cue in.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
||||
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
|
||||
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
|
||||
$errArray["error"] = "Can't set cue out to be greater than file length.";
|
||||
$errArray["error"] = _("Can't set cue out to be greater than file length.");
|
||||
|
||||
return $errArray;
|
||||
}
|
||||
|
@ -867,9 +869,8 @@ SQL;
|
|||
|
||||
public static function getPlaylistCount()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = 'SELECT count(*) as cnt FROM '.$CC_CONFIG["playListTable"];
|
||||
$sql = 'SELECT count(*) as cnt FROM cc_playlist';
|
||||
|
||||
return $con->query($sql)->fetchColumn(0);
|
||||
}
|
||||
|
@ -930,6 +931,29 @@ SQL;
|
|||
{
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
}
|
||||
|
||||
public function shuffle()
|
||||
{
|
||||
$sql = <<<SQL
|
||||
SELECT max(position) from cc_playlistcontents WHERE playlist_id=:p1
|
||||
SQL;
|
||||
$out = Application_Common_Database::prepareAndExecute($sql, array("p1"=>$this->id));
|
||||
$maxPosition = $out[0]['max'];
|
||||
|
||||
$map = range(0, $maxPosition);
|
||||
shuffle($map);
|
||||
|
||||
$currentPos = implode(',', array_keys($map));
|
||||
$sql = "UPDATE cc_playlistcontents SET position = CASE position ";
|
||||
foreach ($map as $current => $after) {
|
||||
$sql .= sprintf("WHEN %d THEN %d ", $current, $after);
|
||||
}
|
||||
$sql .= "END WHERE position IN ($currentPos) and playlist_id=:p1";
|
||||
|
||||
Application_Common_Database::prepareAndExecute($sql, array("p1"=>$this->id));
|
||||
$result['result'] = 0;
|
||||
return $result;
|
||||
}
|
||||
|
||||
} // class Playlist
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@
|
|||
class Application_Model_Preference
|
||||
{
|
||||
|
||||
private static function setValue($key, $value, $isUserValue = false)
|
||||
/**
|
||||
*
|
||||
* @param integer $userId is not null when we are setting a locale for a specific user
|
||||
* @param boolean $isUserValue is true when we are setting a value for the current user
|
||||
*/
|
||||
private static function setValue($key, $value, $isUserValue = false, $userId = null)
|
||||
{
|
||||
try {
|
||||
//called from a daemon process
|
||||
|
@ -22,9 +27,12 @@ class Application_Model_Preference
|
|||
$paramMap[':key'] = $key;
|
||||
|
||||
//For user specific preference, check if id matches as well
|
||||
if ($isUserValue) {
|
||||
if ($isUserValue && is_null($userId)) {
|
||||
$sql .= " AND subjid = :id";
|
||||
$paramMap[':id'] = $id;
|
||||
} else if (!is_null($userId)) {
|
||||
$sql .= " AND subjid= :id";
|
||||
$paramMap[':id'] = $userId;
|
||||
}
|
||||
|
||||
$result = Application_Common_Database::prepareAndExecute($sql, $paramMap, 'column');
|
||||
|
@ -42,7 +50,11 @@ class Application_Model_Preference
|
|||
$sql = "UPDATE cc_pref"
|
||||
. " SET valstr = :value"
|
||||
. " WHERE keystr = :key AND subjid = :id";
|
||||
$paramMap[':id'] = $id;
|
||||
if (is_null($userId)) {
|
||||
$paramMap[':id'] = $id;
|
||||
} else {
|
||||
$paramMap[':id'] = $userId;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// result not found
|
||||
|
@ -54,7 +66,11 @@ class Application_Model_Preference
|
|||
// user pref
|
||||
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr)"
|
||||
." VALUES (:id, :key, :value)";
|
||||
$paramMap[':id'] = $id;
|
||||
if (is_null($userId)) {
|
||||
$paramMap[':id'] = $id;
|
||||
} else {
|
||||
$paramMap[':id'] = $userId;
|
||||
}
|
||||
}
|
||||
}
|
||||
$paramMap[':key'] = $key;
|
||||
|
@ -418,17 +434,80 @@ class Application_Model_Preference
|
|||
return self::getValue("description");
|
||||
}
|
||||
|
||||
public static function SetTimezone($timezone)
|
||||
public static function SetDefaultTimezone($timezone)
|
||||
{
|
||||
self::setValue("timezone", $timezone);
|
||||
date_default_timezone_set($timezone);
|
||||
}
|
||||
|
||||
public static function GetTimezone()
|
||||
public static function GetDefaultTimezone()
|
||||
{
|
||||
return self::getValue("timezone");
|
||||
}
|
||||
|
||||
public static function SetUserTimezone($userId, $timezone = null)
|
||||
{
|
||||
// When a new user is created they will get the default timezone
|
||||
// setting which the admin sets on preferences page
|
||||
if (is_null($timezone)) {
|
||||
$timezone = self::GetDefaultTimezone();
|
||||
}
|
||||
self::setValue("user_timezone", $timezone, true, $userId);
|
||||
}
|
||||
|
||||
public static function GetUserTimezone($id)
|
||||
{
|
||||
return self::getValue("user_timezone", true);
|
||||
}
|
||||
|
||||
public static function GetTimezone()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$id = $auth->getIdentity()->id;
|
||||
return self::GetUserTimezone($id);
|
||||
} else {
|
||||
return self::GetDefaultTimezone();
|
||||
}
|
||||
}
|
||||
|
||||
// This is the language setting on preferences page
|
||||
public static function SetDefaultLocale($locale)
|
||||
{
|
||||
self::setValue("locale", $locale);
|
||||
}
|
||||
|
||||
public static function GetDefaultLocale()
|
||||
{
|
||||
return self::getValue("locale");
|
||||
}
|
||||
|
||||
public static function GetUserLocale($id)
|
||||
{
|
||||
return self::getValue("user_locale", true);
|
||||
}
|
||||
|
||||
public static function SetUserLocale($userId, $locale = null)
|
||||
{
|
||||
// When a new user is created they will get the default locale
|
||||
// setting which the admin sets on preferences page
|
||||
if (is_null($locale)) {
|
||||
$locale = self::GetDefaultLocale();
|
||||
}
|
||||
self::setValue("user_locale", $locale, true, $userId);
|
||||
}
|
||||
|
||||
public static function GetLocale()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$id = $auth->getIdentity()->id;
|
||||
return self::GetUserLocale($id);
|
||||
} else {
|
||||
return self::GetDefaultLocale();
|
||||
}
|
||||
}
|
||||
|
||||
public static function SetStationLogo($imagePath)
|
||||
{
|
||||
if (!empty($imagePath)) {
|
||||
|
@ -456,7 +535,7 @@ class Application_Model_Preference
|
|||
$sql = "SELECT * FROM cc_country";
|
||||
$res = $con->query($sql)->fetchAll();
|
||||
$out = array();
|
||||
$out[""] = "Select Country";
|
||||
$out[""] = _("Select Country");
|
||||
foreach ($res as $r) {
|
||||
$out[$r["isocode"]] = $r["name"];
|
||||
}
|
||||
|
@ -500,6 +579,7 @@ class Application_Model_Preference
|
|||
} else {
|
||||
$outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL;
|
||||
}
|
||||
|
||||
$outputArray['STATION_NAME'] = self::GetStationName();
|
||||
$outputArray['PHONE'] = self::GetPhone();
|
||||
$outputArray['EMAIL'] = self::GetEmail();
|
||||
|
@ -513,7 +593,7 @@ class Application_Model_Preference
|
|||
$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];
|
||||
}
|
||||
|
@ -1166,4 +1246,27 @@ class Application_Model_Preference
|
|||
$data = self::getValue("nowplaying_screen", true);
|
||||
return ($data != "") ? unserialize($data) : null;
|
||||
}
|
||||
|
||||
public static function SetEnableReplayGain($value) {
|
||||
self::setValue("enable_replay_gain", $value, false);
|
||||
}
|
||||
|
||||
public static function GetEnableReplayGain() {
|
||||
return self::getValue("enable_replay_gain", false);
|
||||
}
|
||||
|
||||
public static function getReplayGainModifier(){
|
||||
$rg_modifier = self::getValue("replay_gain_modifier");
|
||||
|
||||
if ($rg_modifier === "") {
|
||||
return "0";
|
||||
}
|
||||
|
||||
return $rg_modifier;
|
||||
}
|
||||
|
||||
public static function setReplayGainModifier($rg_modifier)
|
||||
{
|
||||
self::setValue("replay_gain_modifier", $rg_modifier, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class Application_Model_RabbitMq
|
|||
|
||||
private static function sendMessage($exchange, $data)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
|
||||
$CC_CONFIG["rabbitmq"]["port"],
|
||||
|
|
|
@ -181,15 +181,14 @@ SQL;
|
|||
|
||||
public static function GetLastScheduleItem($p_timeNow)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$sql = <<<SQL
|
||||
SELECT ft.artist_name,
|
||||
ft.track_title,
|
||||
st.starts AS starts,
|
||||
st.ends AS ends
|
||||
FROM cc_schedule st
|
||||
LEFT JOIN $CC_CONFIG[filesTable] ft ON st.file_id = ft.id
|
||||
LEFT JOIN $CC_CONFIG[showInstances] sit ON st.instance_id = sit.id
|
||||
LEFT JOIN cc_files ft ON st.file_id = ft.id
|
||||
LEFT JOIN cc_show_instances sit ON st.instance_id = sit.id
|
||||
-- this and the next line are necessary since we can overbook shows.
|
||||
WHERE st.ends < TIMESTAMP :timeNow
|
||||
|
||||
|
@ -204,7 +203,6 @@ SQL;
|
|||
|
||||
public static function GetCurrentScheduleItem($p_timeNow, $p_instanceId)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
/* Note that usually there will be one result returned. In some
|
||||
* rare cases two songs are returned. This happens when a track
|
||||
* that was overbooked from a previous show appears as if it
|
||||
|
@ -213,8 +211,8 @@ SQL;
|
|||
* this is the *real* track that is currently playing. So this
|
||||
* is why we are ordering by track start time. */
|
||||
$sql = "SELECT *"
|
||||
." FROM $CC_CONFIG[scheduleTable] st"
|
||||
." LEFT JOIN $CC_CONFIG[filesTable] ft"
|
||||
." FROM cc_schedule st"
|
||||
." LEFT JOIN cc_files ft"
|
||||
." ON st.file_id = ft.id"
|
||||
." WHERE st.starts <= TIMESTAMP :timeNow1"
|
||||
." AND st.instance_id = :instanceId"
|
||||
|
@ -229,14 +227,13 @@ SQL;
|
|||
|
||||
public static function GetNextScheduleItem($p_timeNow)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$sql = "SELECT"
|
||||
." ft.artist_name, ft.track_title,"
|
||||
." st.starts as starts, st.ends as ends"
|
||||
." FROM $CC_CONFIG[scheduleTable] st"
|
||||
." LEFT JOIN $CC_CONFIG[filesTable] ft"
|
||||
." FROM cc_schedule st"
|
||||
." LEFT JOIN cc_files ft"
|
||||
." ON st.file_id = ft.id"
|
||||
." LEFT JOIN $CC_CONFIG[showInstances] sit"
|
||||
." LEFT JOIN cc_show_instances sit"
|
||||
." ON st.instance_id = sit.id"
|
||||
." WHERE st.starts > TIMESTAMP :timeNow"
|
||||
." AND st.starts >= sit.starts" //this and the next line are necessary since we can overbook shows.
|
||||
|
@ -260,7 +257,6 @@ SQL;
|
|||
*/
|
||||
public static function GetScheduleDetailItems($p_start, $p_end, $p_shows)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
|
||||
$p_start_str = $p_start->format("Y-m-d H:i:s");
|
||||
|
@ -386,9 +382,8 @@ SQL;
|
|||
|
||||
public static function UpdateMediaPlayedStatus($p_id)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = "UPDATE ".$CC_CONFIG['scheduleTable']
|
||||
$sql = "UPDATE cc_schedule"
|
||||
." SET media_item_played=TRUE";
|
||||
// we need to update 'broadcasted' column as well
|
||||
// check the current switch status
|
||||
|
@ -427,9 +422,8 @@ SQL;
|
|||
|
||||
public static function getSchduledPlaylistCount()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = "SELECT count(*) as cnt FROM ".$CC_CONFIG['scheduleTable'];
|
||||
$sql = "SELECT count(*) as cnt FROM cc_schedule";
|
||||
|
||||
return $con->query($sql)->fetchColumn(0);
|
||||
}
|
||||
|
@ -680,6 +674,13 @@ SQL;
|
|||
$same_hour = $start_hour == $end_hour;
|
||||
$independent_event = !$same_hour;
|
||||
|
||||
$replay_gain = is_null($item["replay_gain"]) ? "0": $item["replay_gain"];
|
||||
$replay_gain += Application_Model_Preference::getReplayGainModifier();
|
||||
|
||||
if ( !Application_Model_Preference::GetEnableReplayGain() ) {
|
||||
$replay_gain = 0;
|
||||
}
|
||||
|
||||
$schedule_item = array(
|
||||
'id' => $media_id,
|
||||
'type' => 'file',
|
||||
|
@ -692,8 +693,8 @@ SQL;
|
|||
'start' => $start,
|
||||
'end' => $end,
|
||||
'show_name' => $item["show_name"],
|
||||
'replay_gain' => is_null($item["replay_gain"]) ? "0": $item["replay_gain"],
|
||||
'independent_event' => $independent_event,
|
||||
'replay_gain' => $replay_gain,
|
||||
'independent_event' => $independent_event,
|
||||
);
|
||||
self::appendScheduleItem($data, $start, $schedule_item);
|
||||
}
|
||||
|
@ -762,7 +763,7 @@ SQL;
|
|||
|
||||
private static function getRangeStartAndEnd($p_fromDateTime, $p_toDateTime)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
/* if $p_fromDateTime and $p_toDateTime function parameters are null,
|
||||
then set range * from "now" to "now + 24 hours". */
|
||||
|
@ -837,8 +838,8 @@ SQL;
|
|||
/* Check if two events are less than or equal to 1 second apart
|
||||
*/
|
||||
public static function areEventsLinked($event1, $event2) {
|
||||
$dt1 = DateTime::createFromFormat("Y-m-d-H-i-s", $event1['start']);
|
||||
$dt2 = DateTime::createFromFormat("Y-m-d-H-i-s", $event2['start']);
|
||||
$dt1 = DateTime::createFromFormat("Y-m-d-H-i-s", $event1['start']);
|
||||
$dt2 = DateTime::createFromFormat("Y-m-d-H-i-s", $event2['start']);
|
||||
|
||||
$seconds = $dt2->getTimestamp() - $dt1->getTimestamp();
|
||||
return $seconds <= 1;
|
||||
|
@ -858,7 +859,7 @@ SQL;
|
|||
*
|
||||
* There's a special case here is well. When the back-to-back streams are the same, we
|
||||
* can collapse the instructions 1,2,(3,4,1,2),3,4 to 1,2,3,4. We basically cut out the
|
||||
* middle part. This function handles this.
|
||||
* middle part. This function handles this.
|
||||
*/
|
||||
private static function foldData(&$data)
|
||||
{
|
||||
|
@ -911,15 +912,13 @@ SQL;
|
|||
|
||||
public static function deleteAll()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$con->exec("TRUNCATE TABLE ".$CC_CONFIG["scheduleTable"]);
|
||||
$con->exec("TRUNCATE TABLE cc_schedule");
|
||||
}
|
||||
|
||||
public static function deleteWithFileId($fileId)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]." WHERE file_id=:file_id";
|
||||
$sql = "DELETE FROM cc_schedule WHERE file_id=:file_id";
|
||||
Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute');
|
||||
}
|
||||
|
||||
|
|
|
@ -79,12 +79,12 @@ class Application_Model_Scheduler
|
|||
|
||||
//an item has been deleted
|
||||
if (count($schedIds) !== count($schedItems)) {
|
||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date! (sched mismatch)");
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (sched mismatch)"));
|
||||
}
|
||||
|
||||
//a show has been deleted
|
||||
if (count($instanceIds) !== count($showInstances)) {
|
||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date! (instance mismatch)");
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (instance mismatch)"));
|
||||
}
|
||||
|
||||
foreach ($schedItems as $schedItem) {
|
||||
|
@ -92,7 +92,7 @@ class Application_Model_Scheduler
|
|||
$instance = $schedItem->getCcShowInstances($this->con);
|
||||
|
||||
if (intval($schedInfo[$id]) !== $instance->getDbId()) {
|
||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,24 +102,24 @@ class Application_Model_Scheduler
|
|||
$show = $instance->getCcShow($this->con);
|
||||
|
||||
if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
|
||||
throw new Exception("You are not allowed to schedule show {$show->getDbName()}.");
|
||||
throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName()));
|
||||
}
|
||||
|
||||
if ($instance->getDbRecord()) {
|
||||
throw new Exception("You cannot add files to recording shows.");
|
||||
throw new Exception(_("You cannot add files to recording shows."));
|
||||
}
|
||||
|
||||
$showEndEpoch = floatval($instance->getDbEnds("U.u"));
|
||||
|
||||
if ($showEndEpoch < $nowEpoch) {
|
||||
throw new OutDatedScheduleException("The show {$show->getDbName()} is over and cannot be scheduled.");
|
||||
throw new OutDatedScheduleException(sprintf(_("The show %s is over and cannot be scheduled."), $show->getDbName()));
|
||||
}
|
||||
|
||||
$ts = intval($instanceInfo[$id]);
|
||||
$lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0;
|
||||
if ($ts < $lastSchedTs) {
|
||||
Logging::info("ts {$ts} last sched {$lastSchedTs}");
|
||||
throw new OutDatedScheduleException("The show {$show->getDbName()} has been previously updated!");
|
||||
throw new OutDatedScheduleException(sprintf(_("The show %s has been previously updated!"), $show->getDbName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,13 +137,14 @@ class Application_Model_Scheduler
|
|||
if ($type === "audioclip") {
|
||||
$file = CcFilesQuery::create()->findPK($id, $this->con);
|
||||
|
||||
if (is_null($file) || !$file->getDbFileExists()) {
|
||||
throw new Exception("A selected File does not exist!");
|
||||
if (is_null($file) || !$file->visible()) {
|
||||
throw new Exception(_("A selected File does not exist!"));
|
||||
} else {
|
||||
$data = $this->fileInfo;
|
||||
$data["id"] = $id;
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cueout"] = $file->getDbLength();
|
||||
$data["cuein"] = $file->getDbCuein();
|
||||
$data["cueout"] = $file->getDbCueout();
|
||||
|
||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||
if (isset($defaultFade)) {
|
||||
|
@ -196,7 +197,7 @@ class Application_Model_Scheduler
|
|||
foreach ($dynamicFiles as $f) {
|
||||
$fileId = $f['id'];
|
||||
$file = CcFilesQuery::create()->findPk($fileId);
|
||||
if (isset($file) && $file->getDbFileExists()) {
|
||||
if (isset($file) && $file->visible()) {
|
||||
$data["id"] = $file->getDbId();
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cuein"] = "00:00:00";
|
||||
|
@ -218,8 +219,8 @@ class Application_Model_Scheduler
|
|||
//need to return
|
||||
$stream = CcWebstreamQuery::create()->findPK($id, $this->con);
|
||||
|
||||
if (is_null($stream) /* || !$file->getDbFileExists() */) {
|
||||
throw new Exception("A selected File does not exist!");
|
||||
if (is_null($stream) /* || !$file->visible() */) {
|
||||
throw new Exception(_("A selected File does not exist!"));
|
||||
} else {
|
||||
$data = $this->fileInfo;
|
||||
$data["id"] = $id;
|
||||
|
@ -254,7 +255,7 @@ class Application_Model_Scheduler
|
|||
foreach ($dynamicFiles as $f) {
|
||||
$fileId = $f['id'];
|
||||
$file = CcFilesQuery::create()->findPk($fileId);
|
||||
if (isset($file) && $file->getDbFileExists()) {
|
||||
if (isset($file) && $file->visible()) {
|
||||
$data["id"] = $file->getDbId();
|
||||
$data["cliplength"] = $file->getDbLength();
|
||||
$data["cuein"] = "00:00:00";
|
||||
|
@ -343,7 +344,7 @@ class Application_Model_Scheduler
|
|||
|
||||
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
||||
if (is_null($instance)) {
|
||||
throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||
}
|
||||
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
|
|
|
@ -177,7 +177,7 @@ SQL;
|
|||
$con = Propel::getConnection();
|
||||
|
||||
if ($deltaDay > 0) {
|
||||
return "Shows can have a max length of 24 hours.";
|
||||
return _("Shows can have a max length of 24 hours.");
|
||||
}
|
||||
|
||||
$utc = new DateTimeZone("UTC");
|
||||
|
@ -189,7 +189,7 @@ SQL;
|
|||
->find($con);
|
||||
|
||||
/* Check two things:
|
||||
1. If the show being resized and any of its repeats end in the past
|
||||
1. If the show being resized and any of its repeats end in the past
|
||||
2. If the show being resized and any of its repeats overlap
|
||||
with other scheduled shows */
|
||||
|
||||
|
@ -208,7 +208,7 @@ SQL;
|
|||
$newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin);
|
||||
|
||||
if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
|
||||
return "End date/time cannot be in the past";
|
||||
return _("End date/time cannot be in the past");
|
||||
}
|
||||
|
||||
//convert our new starts/ends to UTC.
|
||||
|
@ -219,8 +219,8 @@ SQL;
|
|||
$newStartsDateTime, $newEndsDateTime, true, $si->getDbId());
|
||||
|
||||
if ($overlapping) {
|
||||
return "Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
|
||||
"affects all of its repeats.";
|
||||
return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
|
||||
"affects all of its repeats.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ SQL;
|
|||
} catch (Exception $e) {
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Application_Model_RabbitMq::PushSchedule();
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ SQL;
|
|||
$startDateTime = new DateTime($show["starts"], $utc);
|
||||
$startDateTime->setTimezone($dtz);
|
||||
|
||||
$rebroadcastsLocal[$i]["start_date"] =
|
||||
$rebroadcastsLocal[$i]["start_date"] =
|
||||
$startDateTime->format("Y-m-d");
|
||||
$rebroadcastsLocal[$i]["start_time"] =
|
||||
$startDateTime->format("H:i");
|
||||
|
@ -533,7 +533,7 @@ SQL;
|
|||
->filterByDbShowId($this->_showId)
|
||||
->findOne();
|
||||
|
||||
if (!is_null($showDaysRow))
|
||||
if (!is_null($showDaysRow))
|
||||
return $showDaysRow->getDbRepeatType();
|
||||
else
|
||||
return -1;
|
||||
|
@ -582,7 +582,7 @@ WHERE starts > :timestamp::TIMESTAMP
|
|||
AND show_id = :showId
|
||||
SQL;
|
||||
Application_Common_Database::prepareAndExecute( $sql,
|
||||
array( ':timestamp' => gmdate("Y-m-d H:i:s"),
|
||||
array( ':timestamp' => gmdate("Y-m-d H:i:s"),
|
||||
':showId' => $this->getId()), 'execute');
|
||||
}
|
||||
|
||||
|
@ -838,7 +838,7 @@ WHERE show_id = :show_id
|
|||
AND ends > :timestamp::TIMESTAMP
|
||||
SQL;
|
||||
|
||||
Application_Common_Database::prepareAndExecute( $sql, array(
|
||||
Application_Common_Database::prepareAndExecute( $sql, array(
|
||||
':add_show_duration' => $p_data['add_show_duration'],
|
||||
':show_id' => $p_data['add_show_id'],
|
||||
':timestamp' => $timestamp), "execute");
|
||||
|
@ -1222,12 +1222,12 @@ SQL;
|
|||
SELECT :rebroadcast::date - :start::date
|
||||
SQL;
|
||||
|
||||
$offset_days =
|
||||
$offset_days =
|
||||
Application_Common_Database::prepareAndExecute($sql,
|
||||
array(
|
||||
'rebroadcast' =>
|
||||
'rebroadcast' =>
|
||||
$data["add_show_rebroadcast_date_absolute_$i"],
|
||||
'start' =>
|
||||
'start' =>
|
||||
$data['add_show_start_date']), "column" );
|
||||
|
||||
//$r = $con->query($sql);
|
||||
|
@ -1770,7 +1770,7 @@ SQL;
|
|||
$parentStartsEpoch = intval($parentStartsDT->format("U"));
|
||||
}
|
||||
|
||||
$startsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$startsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$show["starts"],$utc);
|
||||
$endsDT = DateTime::createFromFormat("Y-m-d G:i:s",
|
||||
$show["ends"], $utc);
|
||||
|
@ -1801,6 +1801,8 @@ SQL;
|
|||
|
||||
$options["show_empty"] = (array_key_exists($show['instance_id'],
|
||||
$content_count)) ? 0 : 1;
|
||||
|
||||
$options["show_partial_filled"] = $showInstance->showPartialFilled();
|
||||
|
||||
$events[] = &self::makeFullCalendarEvent($show, $options,
|
||||
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
||||
|
@ -1905,7 +1907,7 @@ SQL;
|
|||
*/
|
||||
public static function getCurrentShow($timeNow=null)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$con = Propel::getConnection();
|
||||
if ($timeNow == null) {
|
||||
$date = new Application_Common_DateHelper;
|
||||
|
@ -1951,7 +1953,7 @@ SQL;
|
|||
*/
|
||||
public static function getPrevCurrentNext($p_timeNow)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$con = Propel::getConnection();
|
||||
//
|
||||
//TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin
|
||||
|
|
|
@ -195,7 +195,7 @@ class Application_Model_ShowBuilder
|
|||
$dt->setTimezone(new DateTimeZone($this->timezone));
|
||||
$time = $dt->format("Y-m-d H:i");
|
||||
|
||||
$row["rebroadcast_title"] = "Rebroadcast of {$name} from {$time}";
|
||||
$row["rebroadcast_title"] = sprintf(_("Rebroadcast of %s from %s"), $name, $time);
|
||||
} elseif (intval($p_item["si_record"]) === 1) {
|
||||
$row["record"] = true;
|
||||
|
||||
|
@ -269,6 +269,7 @@ class Application_Model_ShowBuilder
|
|||
|
||||
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
|
||||
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
|
||||
|
||||
$run_time = $cue_out-$cue_in;
|
||||
|
||||
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
|
||||
|
|
|
@ -242,7 +242,7 @@ SQL;
|
|||
public function moveShow($deltaDay, $deltaMin)
|
||||
{
|
||||
if ($this->getShow()->isRepeating()) {
|
||||
return "Can't drag and drop repeating shows";
|
||||
return _("Can't drag and drop repeating shows");
|
||||
}
|
||||
|
||||
$today_timestamp = time();
|
||||
|
@ -250,7 +250,7 @@ SQL;
|
|||
$endsDateTime = new DateTime($this->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
||||
|
||||
if ($today_timestamp > $startsDateTime->getTimestamp()) {
|
||||
return "Can't move a past show";
|
||||
return _("Can't move a past show");
|
||||
}
|
||||
|
||||
//the user is moving the show on the calendar from the perspective of local time.
|
||||
|
@ -267,13 +267,13 @@ SQL;
|
|||
$newEndsDateTime->setTimezone(new DateTimeZone("UTC"));
|
||||
|
||||
if ($today_timestamp > $newStartsDateTime->getTimestamp()) {
|
||||
return "Can't move show into past";
|
||||
return _("Can't move show into past");
|
||||
}
|
||||
|
||||
//check if show is overlapping
|
||||
$overlapping = Application_Model_Schedule::checkOverlappingShows($newStartsDateTime, $newEndsDateTime, true, $this->getShowInstanceId());
|
||||
if ($overlapping) {
|
||||
return "Cannot schedule overlapping shows";
|
||||
return _("Cannot schedule overlapping shows");
|
||||
}
|
||||
|
||||
if ($this->isRecorded()) {
|
||||
|
@ -287,7 +287,7 @@ SQL;
|
|||
->find();
|
||||
|
||||
if (count($rebroadcasts) > 0) {
|
||||
return "Can't move a recorded show less than 1 hour before its rebroadcasts.";
|
||||
return _("Can't move a recorded show less than 1 hour before its rebroadcasts.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,14 +300,14 @@ SQL;
|
|||
catch (Exception $e) {
|
||||
$this->_showInstance->delete();
|
||||
|
||||
return "Show was deleted because recorded show does not exist!";
|
||||
return _("Show was deleted because recorded show does not exist!");
|
||||
}
|
||||
|
||||
$recordEndDateTime = new DateTime($recordedShow->getShowInstanceEnd(), new DateTimeZone("UTC"));
|
||||
$newRecordEndDateTime = self::addDeltas($recordEndDateTime, 0, 60);
|
||||
|
||||
if ($newStartsDateTime->getTimestamp() < $newRecordEndDateTime->getTimestamp()) {
|
||||
return "Must wait 1 hour to rebroadcast.";
|
||||
return _("Must wait 1 hour to rebroadcast.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ SQL;
|
|||
$ends = $this->getShowInstanceEnd();
|
||||
|
||||
if (strtotime($today_timestamp) > strtotime($starts)) {
|
||||
return "can't resize a past show";
|
||||
return _("can't resize a past show");
|
||||
}
|
||||
|
||||
//$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
|
||||
|
@ -361,7 +361,7 @@ SQL;
|
|||
|
||||
if (count($overlap) > 0) {
|
||||
// TODO : fix ghetto error handling -- RG
|
||||
return "Should not overlap shows";
|
||||
return _("Should not overlap shows");
|
||||
}
|
||||
}
|
||||
//with overbooking no longer need to check already scheduled content still fits.
|
||||
|
@ -687,6 +687,22 @@ SQL;
|
|||
|
||||
}
|
||||
|
||||
public function showPartialFilled()
|
||||
{
|
||||
$sql = <<<SQL
|
||||
SELECT time_filled > '00:00:00'
|
||||
AND time_filled < ends - starts
|
||||
AND file_id IS null AS partial_filled
|
||||
FROM cc_show_instances
|
||||
WHERE id = :instance_id
|
||||
SQL;
|
||||
|
||||
$res = Application_Common_Database::prepareAndExecute($sql,
|
||||
array(':instance_id' => $this->_instanceId), 'all');
|
||||
|
||||
return $res[0]["partial_filled"];
|
||||
}
|
||||
|
||||
public function showEmpty()
|
||||
{
|
||||
$sql = <<<SQL
|
||||
|
@ -730,7 +746,8 @@ FROM (
|
|||
LEFT JOIN cc_files AS f ON f.id = s.file_id
|
||||
WHERE s.instance_id = :instance_id1
|
||||
AND s.playout_status >= 0
|
||||
AND s.file_id IS NOT NULL)
|
||||
AND s.file_id IS NOT NULL
|
||||
AND f.hidden = 'false')
|
||||
UNION
|
||||
(SELECT s.starts,
|
||||
1::INTEGER as type,
|
||||
|
|
|
@ -7,7 +7,7 @@ class Application_Model_Soundcloud
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$this->_soundcloud = new Services_Soundcloud(
|
||||
$CC_CONFIG['soundcloud-client-id'],
|
||||
$CC_CONFIG['soundcloud-client-secret']);
|
||||
|
@ -25,11 +25,11 @@ class Application_Model_Soundcloud
|
|||
|
||||
public function uploadTrack($filepath, $filename, $description,
|
||||
$tags=array(), $release=null, $genre=null)
|
||||
{
|
||||
{
|
||||
|
||||
if (!$this->getToken()) {
|
||||
throw new NoSoundCloundToken();
|
||||
}
|
||||
}
|
||||
if (count($tags)) {
|
||||
$tags = join(" ", $tags);
|
||||
$tags = $tags." ".Application_Model_Preference::GetSoundCloudTags();
|
||||
|
@ -88,7 +88,7 @@ class Application_Model_Soundcloud
|
|||
|
||||
}
|
||||
|
||||
public static function uploadSoundcloud($id)
|
||||
public static function uploadSoundcloud($id)
|
||||
{
|
||||
$cmd = "/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &";
|
||||
Logging::info("Uploading soundcloud with command: $cmd");
|
||||
|
|
|
@ -48,7 +48,9 @@ class Application_Model_StoredFile
|
|||
"language" => "DbLanguage",
|
||||
"replay_gain" => "DbReplayGain",
|
||||
"directory" => "DbDirectory",
|
||||
"owner_id" => "DbOwnerId"
|
||||
"owner_id" => "DbOwnerId",
|
||||
"cuein" => "DbCueIn",
|
||||
"cueout" => "DbCueOut",
|
||||
);
|
||||
|
||||
public function getId()
|
||||
|
@ -127,9 +129,15 @@ class Application_Model_StoredFile
|
|||
|
||||
# Translate metadata attributes from media monitor (MDATA_KEY_*)
|
||||
# to their counterparts in constants.php (usually the column names)
|
||||
$track_length = $p_md['MDATA_KEY_DURATION'];
|
||||
$track_length_in_sec = Application_Common_DateHelper::calculateLengthInSeconds($track_length);
|
||||
foreach ($p_md as $mdConst => $mdValue) {
|
||||
if (defined($mdConst)) {
|
||||
if ($mdConst == "MDATA_KEY_CUE_OUT" && $mdValue == '0.0') {
|
||||
$mdValue = $track_length_in_sec;
|
||||
}
|
||||
$dbMd[constant($mdConst)] = $mdValue;
|
||||
|
||||
} else {
|
||||
Logging::warn("using metadata that is not defined.
|
||||
[$mdConst] => [$mdValue]");
|
||||
|
@ -177,7 +185,7 @@ class Application_Model_StoredFile
|
|||
$this->_file->setDbOwnerId( $owner->getDbId() );
|
||||
} else {
|
||||
Logging::info("Could not find suitable owner for file
|
||||
'".$p_md['MDATA_KEY_FILEPATH']."'");
|
||||
'".$p_md['filepath']."'");
|
||||
}
|
||||
}
|
||||
# We don't want to process owner_id in bulk because we already
|
||||
|
@ -359,8 +367,9 @@ SQL;
|
|||
Application_Model_RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||
}
|
||||
|
||||
// set file_exists flag to false
|
||||
$this->_file->setDbFileExists(false);
|
||||
|
||||
// set hidden flag to true
|
||||
$this->_file->setDbHidden(true);
|
||||
$this->_file->save();
|
||||
|
||||
// need to explicitly update any playlist's and block's length
|
||||
|
@ -437,7 +446,7 @@ SQL;
|
|||
return "flac";
|
||||
} elseif ($mime == "audio/mp4") {
|
||||
return "mp4";
|
||||
} else {
|
||||
} else {
|
||||
throw new Exception("Unknown $mime");
|
||||
}
|
||||
}
|
||||
|
@ -495,7 +504,7 @@ SQL;
|
|||
*/
|
||||
public function getFileUrlUsingConfigAddress()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
if (isset($CC_CONFIG['baseUrl'])) {
|
||||
$serverName = $CC_CONFIG['baseUrl'];
|
||||
|
@ -523,7 +532,7 @@ SQL;
|
|||
*/
|
||||
public function getRelativeFileUrl($baseUrl)
|
||||
{
|
||||
return $baseUrl."/api/get-media/file/".$this->getId().".".$this->getFileExtension();
|
||||
return $baseUrl."api/get-media/file/".$this->getId().".".$this->getFileExtension();
|
||||
}
|
||||
|
||||
public static function Insert($md)
|
||||
|
@ -558,10 +567,10 @@ SQL;
|
|||
|
||||
public static function Recall($p_id=null, $p_gunid=null, $p_md5sum=null,
|
||||
$p_filepath=null) {
|
||||
if( isset($p_id ) ) {
|
||||
if( isset($p_id ) ) {
|
||||
$f = CcFilesQuery::create()->findPK(intval($p_id));
|
||||
return is_null($f) ? null : self::createWithFile($f);
|
||||
} elseif ( isset($p_gunid) ) {
|
||||
} elseif ( isset($p_gunid) ) {
|
||||
throw new Exception("You should never use gunid ($gunid) anymore");
|
||||
} elseif ( isset($p_md5sum) ) {
|
||||
throw new Exception("Searching by md5($p_md5sum) is disabled");
|
||||
|
@ -624,6 +633,7 @@ SQL;
|
|||
return $res;
|
||||
}
|
||||
|
||||
|
||||
public static function getLibraryColumns()
|
||||
{
|
||||
return array("id", "track_title", "artist_name", "album_title",
|
||||
|
@ -634,9 +644,10 @@ SQL;
|
|||
"conductor", "replay_gain", "lptime" );
|
||||
}
|
||||
|
||||
|
||||
public static function searchLibraryFiles($datatables)
|
||||
{
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME);
|
||||
|
||||
$displayColumns = self::getLibraryColumns();
|
||||
|
@ -706,6 +717,11 @@ SQL;
|
|||
$blSelect[] = "NULL::VARCHAR AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "url AS ".$key;
|
||||
} else if ($key == "mime") {
|
||||
$plSelect[] = "NULL::VARCHAR AS ".$key;
|
||||
$blSelect[] = "NULL::VARCHAR AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = $key;
|
||||
} else {
|
||||
$plSelect[] = "NULL::text AS ".$key;
|
||||
$blSelect[] = "NULL::text AS ".$key;
|
||||
|
@ -723,7 +739,7 @@ SQL;
|
|||
|
||||
$plTable = "({$plSelect} FROM cc_playlist AS PL LEFT JOIN cc_subjs AS sub ON (sub.id = PL.creator_id))";
|
||||
$blTable = "({$blSelect} FROM cc_block AS BL LEFT JOIN cc_subjs AS sub ON (sub.id = BL.creator_id))";
|
||||
$fileTable = "({$fileSelect} FROM cc_files AS FILES LEFT JOIN cc_subjs AS sub ON (sub.id = FILES.owner_id) WHERE file_exists = 'TRUE')";
|
||||
$fileTable = "({$fileSelect} FROM cc_files AS FILES LEFT JOIN cc_subjs AS sub ON (sub.id = FILES.owner_id) WHERE file_exists = 'TRUE' AND hidden='FALSE')";
|
||||
//$fileTable = "({$fileSelect} FROM cc_files AS FILES WHERE file_exists = 'TRUE')";
|
||||
$streamTable = "({$streamSelect} FROM cc_webstream AS ws LEFT JOIN cc_subjs AS sub ON (sub.id = ws.creator_id))";
|
||||
$unionTable = "({$plTable} UNION {$blTable} UNION {$fileTable} UNION {$streamTable}) AS RESULTS";
|
||||
|
@ -787,18 +803,18 @@ SQL;
|
|||
//generalized within the project access to zend view methods
|
||||
//to access url helpers is needed.
|
||||
|
||||
// TODO : why is there inline html here? breaks abstraction and is
|
||||
// TODO : why is there inline html here? breaks abstraction and is
|
||||
// ugly
|
||||
if ($type == "au") {
|
||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
$row['image'] = '<img title="Track preview" src="/css/images/icon_audioclip.png">';
|
||||
$row['image'] = '<img title="'._("Track preview").'" src="'.$baseUrl.'css/images/icon_audioclip.png">';
|
||||
} elseif ($type == "pl") {
|
||||
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
|
||||
$row['image'] = '<img title="'._("Playlist preview").'" src="'.$baseUrl.'css/images/icon_playlist.png">';
|
||||
} elseif ($type == "st") {
|
||||
$row['audioFile'] = $row['id'];
|
||||
$row['image'] = '<img title="Webstream preview" src="/css/images/icon_webstream.png">';
|
||||
$row['image'] = '<img title="'._("Webstream preview").'" src="'.$baseUrl.'css/images/icon_webstream.png">';
|
||||
} elseif ($type == "bl") {
|
||||
$row['image'] = '<img title="Smart Block" src="/css/images/icon_smart-block.png">';
|
||||
$row['image'] = '<img title="'._("Smart Block").'" src="'.$baseUrl.'css/images/icon_smart-block.png">';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -850,7 +866,7 @@ SQL;
|
|||
|
||||
closedir($dir);
|
||||
} else
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": _("Failed to open temp directory.")}, "id" : "id"}');
|
||||
|
||||
// Look for the content type header
|
||||
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
|
||||
|
@ -877,14 +893,14 @@ SQL;
|
|||
while ($buff = fread($in, 4096))
|
||||
fwrite($out, $buff);
|
||||
} else
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
|
||||
|
||||
fclose($out);
|
||||
unlink($_FILES['file']['tmp_name']);
|
||||
} else
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
|
||||
} else
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": _("Failed to move uploaded file.")}, "id" : "id"}');
|
||||
} else {
|
||||
// Open temp file
|
||||
$out = fopen($tempFilePath, $chunk == 0 ? "wb" : "ab");
|
||||
|
@ -896,11 +912,11 @@ SQL;
|
|||
while ($buff = fread($in, 4096))
|
||||
fwrite($out, $buff);
|
||||
} else
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
|
||||
|
||||
fclose($out);
|
||||
} else
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
|
||||
}
|
||||
|
||||
return $tempFilePath;
|
||||
|
@ -931,7 +947,7 @@ SQL;
|
|||
if (!mkdir($stor."/organize", 0777)) {
|
||||
return array(
|
||||
"code" => 109,
|
||||
"message" => "Failed to create 'organize' directory.");
|
||||
"message" => _("Failed to create 'organize' directory."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -944,17 +960,17 @@ SQL;
|
|||
$freeSpace = disk_free_space($stor);
|
||||
|
||||
return array("code" => 107,
|
||||
"message" => "The file was not uploaded, there is
|
||||
".$freeSpace."MB of disk space left and the file you are
|
||||
uploading has a size of ".$fileSize."MB.");
|
||||
"message" => sprintf(_("The file was not uploaded, there is "
|
||||
."%s MB of disk space left and the file you are "
|
||||
."uploading has a size of %s MB."), $freeSpace, $fileSize));
|
||||
}
|
||||
|
||||
// Check if liquidsoap can play this file
|
||||
if (!self::liquidsoapFilePlayabilityTest($audio_file)) {
|
||||
return array(
|
||||
"code" => 110,
|
||||
"message" => "This file appears to be corrupted and will not
|
||||
be added to media library.");
|
||||
"message" => _("This file appears to be corrupted and will not "
|
||||
."be added to media library."));
|
||||
}
|
||||
|
||||
// Did all the checks for real, now trying to copy
|
||||
|
@ -989,10 +1005,9 @@ SQL;
|
|||
|
||||
return array(
|
||||
"code" => 108,
|
||||
"message" => "
|
||||
The file was not uploaded, this error can occur if the computer
|
||||
hard drive does not have enough disk space or the stor
|
||||
directory does not have correct write permissions.");
|
||||
"message" => _("The file was not uploaded, this error can occur if the computer "
|
||||
."hard drive does not have enough disk space or the stor "
|
||||
."directory does not have correct write permissions."));
|
||||
}
|
||||
// Now that we successfully added this file, we will add another tag
|
||||
// file that will identify the user that owns it
|
||||
|
@ -1036,8 +1051,12 @@ SQL;
|
|||
$sql = <<<SQL
|
||||
SELECT filepath AS fp
|
||||
FROM CC_FILES AS f
|
||||
WHERE f.directory = :dir_id
|
||||
WHERE f.directory = :dir_id
|
||||
SQL;
|
||||
|
||||
# TODO : the option $all is deprecated now and is always true.
|
||||
# refactor code where it's still being passed
|
||||
$all = true;
|
||||
|
||||
if (!$all) {
|
||||
$sql .= " AND f.file_exists = 'TRUE'";
|
||||
|
@ -1171,16 +1190,25 @@ SQL;
|
|||
$this->_file->setDbFileExists($flag)
|
||||
->save();
|
||||
}
|
||||
public function setFileHiddenFlag($flag)
|
||||
{
|
||||
$this->_file->setDbHidden($flag)
|
||||
->save();
|
||||
}
|
||||
public function setSoundCloudUploadTime($time)
|
||||
{
|
||||
$this->_file->setDbSoundCloundUploadTime($time)
|
||||
->save();
|
||||
}
|
||||
|
||||
public function getFileExistsFlag()
|
||||
{
|
||||
return $this->_file->getDbFileExists();
|
||||
}
|
||||
|
||||
// This method seems to be unsued everywhere so I've commented it out
|
||||
// If it's absence does not have any effect then it will be completely
|
||||
// removed soon
|
||||
//public function getFileExistsFlag()
|
||||
//{
|
||||
//return $this->_file->getDbFileExists();
|
||||
//}
|
||||
|
||||
public function getFileOwnerId()
|
||||
{
|
||||
|
@ -1190,7 +1218,7 @@ SQL;
|
|||
// note: never call this method from controllers because it does a sleep
|
||||
public function uploadToSoundCloud()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$file = $this->_file;
|
||||
if (is_null($file)) {
|
||||
|
|
|
@ -163,7 +163,7 @@ class Application_Model_StreamSetting
|
|||
$con = Propel::getConnection();
|
||||
$sql = "SELECT *"
|
||||
." FROM cc_stream_setting"
|
||||
." WHERE keyname not like '%_error'";
|
||||
." WHERE keyname not like '%_error' AND keyname not like '%_admin_%'";
|
||||
|
||||
$rows = $con->query($sql)->fetchAll();
|
||||
|
||||
|
@ -433,4 +433,37 @@ class Application_Model_StreamSetting
|
|||
{
|
||||
return self::getValue("dj_live_stream_mp");
|
||||
}
|
||||
|
||||
public static function getAdminUser($stream){
|
||||
return self::getValue($stream."_admin_user");
|
||||
}
|
||||
|
||||
public static function setAdminUser($stream, $v){
|
||||
self::setValue($stream."_admin_user", $v, "string");
|
||||
}
|
||||
|
||||
public static function getAdminPass($stream){
|
||||
return self::getValue($stream."_admin_pass");
|
||||
}
|
||||
|
||||
public static function setAdminPass($stream, $v){
|
||||
self::setValue($stream."_admin_pass", $v, "string");
|
||||
}
|
||||
|
||||
public static function getOffAirMeta(){
|
||||
return self::getValue("off_air_meta");
|
||||
}
|
||||
|
||||
public static function setOffAirMeta($offAirMeta){
|
||||
self::setValue("off_air_meta", $offAirMeta, "string");
|
||||
}
|
||||
|
||||
public static function GetAllListenerStatErrors(){
|
||||
$sql = "SELECT * FROM cc_stream_setting WHERE keyname like :p1";
|
||||
return Application_Common_Database::prepareAndExecute($sql, array(':p1'=>'%_listener_stat_error'));
|
||||
}
|
||||
|
||||
public static function SetListenerStatError($key, $v) {
|
||||
self::setValue($key, $v, 'string');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,8 @@ class Application_Model_Subjects
|
|||
|
||||
public static function increaseLoginAttempts($login)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = "UPDATE ".$CC_CONFIG['subjTable']." SET login_attempts = login_attempts+1"
|
||||
$sql = "UPDATE cc_subjs SET login_attempts = login_attempts+1"
|
||||
." WHERE login='$login'";
|
||||
$res = $con->exec($sql);
|
||||
|
||||
|
@ -31,9 +30,8 @@ class Application_Model_Subjects
|
|||
|
||||
public static function resetLoginAttempts($login)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = "UPDATE ".$CC_CONFIG['subjTable']." SET login_attempts = '0'"
|
||||
$sql = "UPDATE cc_subjs SET login_attempts = '0'"
|
||||
." WHERE login='$login'";
|
||||
$res = $con->exec($sql);
|
||||
|
||||
|
@ -42,9 +40,8 @@ class Application_Model_Subjects
|
|||
|
||||
public static function getLoginAttempts($login)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$con = Propel::getConnection();
|
||||
$sql = "SELECT login_attempts FROM ".$CC_CONFIG['subjTable']." WHERE login='$login'";
|
||||
$sql = "SELECT login_attempts FROM cc_subjs WHERE login='$login'";
|
||||
$res = $con->query($sql)->fetchColumn(0);
|
||||
|
||||
return ($res !== false) ? $res : 0;
|
||||
|
|
|
@ -5,7 +5,7 @@ class Application_Model_Systemstatus
|
|||
|
||||
public static function GetMonitStatus($p_ip)
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$monit_user = $CC_CONFIG['monit_user'];
|
||||
$monit_password = $CC_CONFIG['monit_password'];
|
||||
|
||||
|
|
|
@ -154,12 +154,12 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
|
||||
if ($totalMinutes == 0) {
|
||||
$valid['length'][0] = false;
|
||||
$valid['length'][1] = 'Length needs to be greater than 0 minutes';
|
||||
$valid['length'][1] = _('Length needs to be greater than 0 minutes');
|
||||
}
|
||||
|
||||
} else {
|
||||
$valid['length'][0] = false;
|
||||
$valid['length'][1] = 'Length should be of form "00h 00m"';
|
||||
$valid['length'][1] = _('Length should be of form "00h 00m"');
|
||||
}
|
||||
|
||||
$url = $parameters["url"];
|
||||
|
@ -172,16 +172,16 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
$mediaUrl = null;
|
||||
if ($result == 0) {
|
||||
$valid['url'][0] = false;
|
||||
$valid['url'][1] = 'URL should be of form "http://domain"';
|
||||
$valid['url'][1] = _('URL should be of form "http://domain"');
|
||||
} elseif (strlen($url) > 512) {
|
||||
$valid['url'][0] = false;
|
||||
$valid['url'][1] = 'URL should be 512 characters or less';
|
||||
$valid['url'][1] = _('URL should be 512 characters or less');
|
||||
} else {
|
||||
|
||||
try {
|
||||
list($mime, $content_length_found) = self::discoverStreamMime($url);
|
||||
if (is_null($mime)) {
|
||||
throw new Exception("No MIME type found for webstream.");
|
||||
throw new Exception(_("No MIME type found for webstream."));
|
||||
}
|
||||
$mediaUrl = self::getMediaUrl($url, $mime, $content_length_found);
|
||||
|
||||
|
@ -197,7 +197,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
$name = $parameters["name"];
|
||||
if (strlen($name) == 0) {
|
||||
$valid['name'][0] = false;
|
||||
$valid['name'][1] = 'Webstream name cannot be empty';
|
||||
$valid['name'][1] = _('Webstream name cannot be empty');
|
||||
}
|
||||
|
||||
$id = $parameters["id"];
|
||||
|
@ -266,7 +266,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
}
|
||||
}
|
||||
|
||||
throw new Exception("Could not parse XSPF playlist");
|
||||
throw new Exception(_("Could not parse XSPF playlist"));
|
||||
}
|
||||
|
||||
private static function getPlsUrl($url)
|
||||
|
@ -278,7 +278,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
return $ini["playlist"]["File1"];
|
||||
}
|
||||
|
||||
throw new Exception("Could not parse PLS playlist");
|
||||
throw new Exception(_("Could not parse PLS playlist"));
|
||||
}
|
||||
|
||||
private static function getM3uUrl($url)
|
||||
|
@ -297,7 +297,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
return $lines[0];
|
||||
}
|
||||
|
||||
throw new Exception("Could not parse M3U playlist");
|
||||
throw new Exception(_("Could not parse M3U playlist"));
|
||||
}
|
||||
|
||||
private static function getMediaUrl($url, $mime, $content_length_found)
|
||||
|
@ -311,11 +311,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
|
|||
$media_url = self::getPlsUrl($url);
|
||||
} elseif (preg_match("/(mpeg|ogg|audio\/aacp)/", $mime)) {
|
||||
if ($content_length_found) {
|
||||
throw new Exception("Invalid webstream - This appears to be a file download.");
|
||||
throw new Exception(_("Invalid webstream - This appears to be a file download."));
|
||||
}
|
||||
$media_url = $url;
|
||||
} else {
|
||||
throw new Exception("Unrecognized stream type: $mime");
|
||||
throw new Exception(sprintf(_("Unrecognized stream type: %s"), $mime));
|
||||
}
|
||||
|
||||
return $media_url;
|
||||
|
|
|
@ -41,6 +41,11 @@ class CcFiles extends BaseCcFiles {
|
|||
return $this;
|
||||
}
|
||||
|
||||
// returns true if the file exists and is not hidden
|
||||
public function visible() {
|
||||
return $this->getDbFileExists() && !$this->getDbHidden();
|
||||
}
|
||||
|
||||
public function reassignTo($user)
|
||||
{
|
||||
$this->setDbOwnerId( $user->getDbId() );
|
||||
|
|
18
airtime_mvc/application/models/airtime/CcLocale.php
Normal file
18
airtime_mvc/application/models/airtime/CcLocale.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_locale' 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 CcLocale extends BaseCcLocale {
|
||||
|
||||
} // CcLocale
|
18
airtime_mvc/application/models/airtime/CcLocalePeer.php
Normal file
18
airtime_mvc/application/models/airtime/CcLocalePeer.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_locale' 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 CcLocalePeer extends BaseCcLocalePeer {
|
||||
|
||||
} // CcLocalePeer
|
18
airtime_mvc/application/models/airtime/CcLocaleQuery.php
Normal file
18
airtime_mvc/application/models/airtime/CcLocaleQuery.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_locale' 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 CcLocaleQuery extends BaseCcLocaleQuery {
|
||||
|
||||
} // CcLocaleQuery
|
|
@ -89,9 +89,9 @@ class CcPlaylist extends BaseCcPlaylist {
|
|||
{
|
||||
$sql = <<<SQL
|
||||
SELECT SUM(cliplength) FROM cc_playlistcontents as pc
|
||||
JOIN cc_files as f ON pc.file_id = f.id
|
||||
LEFT JOIN cc_files as f ON pc.file_id = f.id
|
||||
WHERE PLAYLIST_ID = :p1
|
||||
AND f.file_exists = true
|
||||
AND f.file_exists is NUll or f.file_exists = true
|
||||
SQL;
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p1', $this->getDbId());
|
||||
|
|
|
@ -68,7 +68,8 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
|||
$this->fadein = $dt->format('H:i:s').".".$microsecond;
|
||||
}
|
||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
||||
|
||||
$this->save();
|
||||
|
||||
return $this;
|
||||
} // setDbFadein()
|
||||
|
||||
|
@ -105,7 +106,8 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
|||
$this->fadeout = $dt->format('H:i:s').".".$microsecond;
|
||||
}
|
||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
||||
|
||||
$this->save();
|
||||
|
||||
return $this;
|
||||
} // setDbFadeout()
|
||||
|
||||
|
|
|
@ -102,6 +102,9 @@ class CcFilesTableMap extends TableMap {
|
|||
$this->addColumn('SOUNDCLOUD_UPLOAD_TIME', 'DbSoundCloundUploadTime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('REPLAY_GAIN', 'DbReplayGain', 'NUMERIC', false, null, null);
|
||||
$this->addForeignKey('OWNER_ID', 'DbOwnerId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||
$this->addColumn('CUEIN', 'DbCuein', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUEOUT', 'DbCueout', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('HIDDEN', 'DbHidden', 'BOOLEAN', false, null, false);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_locale' 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 CcLocaleTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcLocaleTableMap';
|
||||
|
||||
/**
|
||||
* 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_locale');
|
||||
$this->setPhpName('CcLocale');
|
||||
$this->setClassname('CcLocale');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_locale_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('LOCALE_CODE', 'DbLocaleCode', 'VARCHAR', true, 16, null);
|
||||
$this->addColumn('LOCALE_LANG', 'DbLocaleLang', 'VARCHAR', true, 128, null);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
} // buildRelations()
|
||||
|
||||
} // CcLocaleTableMap
|
|
@ -416,6 +416,27 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $owner_id;
|
||||
|
||||
/**
|
||||
* The value for the cuein field.
|
||||
* Note: this column has a database default value of: '00:00:00'
|
||||
* @var string
|
||||
*/
|
||||
protected $cuein;
|
||||
|
||||
/**
|
||||
* The value for the cueout field.
|
||||
* Note: this column has a database default value of: '00:00:00'
|
||||
* @var string
|
||||
*/
|
||||
protected $cueout;
|
||||
|
||||
/**
|
||||
* The value for the hidden field.
|
||||
* Note: this column has a database default value of: false
|
||||
* @var boolean
|
||||
*/
|
||||
protected $hidden;
|
||||
|
||||
/**
|
||||
* @var CcSubjs
|
||||
*/
|
||||
|
@ -481,6 +502,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->currentlyaccessing = 0;
|
||||
$this->length = '00:00:00';
|
||||
$this->file_exists = true;
|
||||
$this->cuein = '00:00:00';
|
||||
$this->cueout = '00:00:00';
|
||||
$this->hidden = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1225,6 +1249,36 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this->owner_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [cuein] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDbCuein()
|
||||
{
|
||||
return $this->cuein;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [cueout] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDbCueout()
|
||||
{
|
||||
return $this->cueout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [hidden] column value.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getDbHidden()
|
||||
{
|
||||
return $this->hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
|
@ -2633,6 +2687,66 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbOwnerId()
|
||||
|
||||
/**
|
||||
* Set the value of [cuein] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbCuein($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cuein !== $v || $this->isNew()) {
|
||||
$this->cuein = $v;
|
||||
$this->modifiedColumns[] = CcFilesPeer::CUEIN;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbCuein()
|
||||
|
||||
/**
|
||||
* Set the value of [cueout] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbCueout($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->cueout !== $v || $this->isNew()) {
|
||||
$this->cueout = $v;
|
||||
$this->modifiedColumns[] = CcFilesPeer::CUEOUT;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbCueout()
|
||||
|
||||
/**
|
||||
* Set the value of [hidden] column.
|
||||
*
|
||||
* @param boolean $v new value
|
||||
* @return CcFiles The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbHidden($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (boolean) $v;
|
||||
}
|
||||
|
||||
if ($this->hidden !== $v || $this->isNew()) {
|
||||
$this->hidden = $v;
|
||||
$this->modifiedColumns[] = CcFilesPeer::HIDDEN;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbHidden()
|
||||
|
||||
/**
|
||||
* Indicates whether the columns in this object are only set to default values.
|
||||
*
|
||||
|
@ -2675,6 +2789,18 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($this->cuein !== '00:00:00') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->cueout !== '00:00:00') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->hidden !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise, everything was equal, so return TRUE
|
||||
return true;
|
||||
} // hasOnlyDefaultValues()
|
||||
|
@ -2761,6 +2887,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->soundcloud_upload_time = ($row[$startcol + 61] !== null) ? (string) $row[$startcol + 61] : null;
|
||||
$this->replay_gain = ($row[$startcol + 62] !== null) ? (string) $row[$startcol + 62] : null;
|
||||
$this->owner_id = ($row[$startcol + 63] !== null) ? (int) $row[$startcol + 63] : null;
|
||||
$this->cuein = ($row[$startcol + 64] !== null) ? (string) $row[$startcol + 64] : null;
|
||||
$this->cueout = ($row[$startcol + 65] !== null) ? (string) $row[$startcol + 65] : null;
|
||||
$this->hidden = ($row[$startcol + 66] !== null) ? (boolean) $row[$startcol + 66] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -2769,7 +2898,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 64; // 64 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 67; // 67 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcFiles object", $e);
|
||||
|
@ -3394,6 +3523,15 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
case 63:
|
||||
return $this->getDbOwnerId();
|
||||
break;
|
||||
case 64:
|
||||
return $this->getDbCuein();
|
||||
break;
|
||||
case 65:
|
||||
return $this->getDbCueout();
|
||||
break;
|
||||
case 66:
|
||||
return $this->getDbHidden();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
|
@ -3482,6 +3620,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$keys[61] => $this->getDbSoundCloundUploadTime(),
|
||||
$keys[62] => $this->getDbReplayGain(),
|
||||
$keys[63] => $this->getDbOwnerId(),
|
||||
$keys[64] => $this->getDbCuein(),
|
||||
$keys[65] => $this->getDbCueout(),
|
||||
$keys[66] => $this->getDbHidden(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aFkOwner) {
|
||||
|
@ -3716,6 +3857,15 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
case 63:
|
||||
$this->setDbOwnerId($value);
|
||||
break;
|
||||
case 64:
|
||||
$this->setDbCuein($value);
|
||||
break;
|
||||
case 65:
|
||||
$this->setDbCueout($value);
|
||||
break;
|
||||
case 66:
|
||||
$this->setDbHidden($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
|
@ -3804,6 +3954,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[61], $arr)) $this->setDbSoundCloundUploadTime($arr[$keys[61]]);
|
||||
if (array_key_exists($keys[62], $arr)) $this->setDbReplayGain($arr[$keys[62]]);
|
||||
if (array_key_exists($keys[63], $arr)) $this->setDbOwnerId($arr[$keys[63]]);
|
||||
if (array_key_exists($keys[64], $arr)) $this->setDbCuein($arr[$keys[64]]);
|
||||
if (array_key_exists($keys[65], $arr)) $this->setDbCueout($arr[$keys[65]]);
|
||||
if (array_key_exists($keys[66], $arr)) $this->setDbHidden($arr[$keys[66]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3879,6 +4032,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME)) $criteria->add(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME, $this->soundcloud_upload_time);
|
||||
if ($this->isColumnModified(CcFilesPeer::REPLAY_GAIN)) $criteria->add(CcFilesPeer::REPLAY_GAIN, $this->replay_gain);
|
||||
if ($this->isColumnModified(CcFilesPeer::OWNER_ID)) $criteria->add(CcFilesPeer::OWNER_ID, $this->owner_id);
|
||||
if ($this->isColumnModified(CcFilesPeer::CUEIN)) $criteria->add(CcFilesPeer::CUEIN, $this->cuein);
|
||||
if ($this->isColumnModified(CcFilesPeer::CUEOUT)) $criteria->add(CcFilesPeer::CUEOUT, $this->cueout);
|
||||
if ($this->isColumnModified(CcFilesPeer::HIDDEN)) $criteria->add(CcFilesPeer::HIDDEN, $this->hidden);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
@ -4003,6 +4159,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$copyObj->setDbSoundCloundUploadTime($this->soundcloud_upload_time);
|
||||
$copyObj->setDbReplayGain($this->replay_gain);
|
||||
$copyObj->setDbOwnerId($this->owner_id);
|
||||
$copyObj->setDbCuein($this->cuein);
|
||||
$copyObj->setDbCueout($this->cueout);
|
||||
$copyObj->setDbHidden($this->hidden);
|
||||
|
||||
if ($deepCopy) {
|
||||
// important: temporarily setNew(false) because this affects the behavior of
|
||||
|
@ -4905,6 +5064,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$this->soundcloud_upload_time = null;
|
||||
$this->replay_gain = null;
|
||||
$this->owner_id = null;
|
||||
$this->cuein = null;
|
||||
$this->cueout = null;
|
||||
$this->hidden = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->alreadyInValidation = false;
|
||||
$this->clearAllReferences();
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcFilesPeer {
|
|||
const TM_CLASS = 'CcFilesTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 64;
|
||||
const NUM_COLUMNS = 67;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -223,6 +223,15 @@ abstract class BaseCcFilesPeer {
|
|||
/** the column name for the OWNER_ID field */
|
||||
const OWNER_ID = 'cc_files.OWNER_ID';
|
||||
|
||||
/** the column name for the CUEIN field */
|
||||
const CUEIN = 'cc_files.CUEIN';
|
||||
|
||||
/** the column name for the CUEOUT field */
|
||||
const CUEOUT = 'cc_files.CUEOUT';
|
||||
|
||||
/** the column name for the HIDDEN field */
|
||||
const HIDDEN = 'cc_files.HIDDEN';
|
||||
|
||||
/**
|
||||
* An identiy map to hold any loaded instances of CcFiles objects.
|
||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||
|
@ -239,12 +248,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, self::OWNER_ID, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbUtime', 'DbLPtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbFileExists', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', 'DbSoundCloundUploadTime', 'DbReplayGain', 'DbOwnerId', 'DbCuein', 'DbCueout', 'DbHidden', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbUtime', 'dbLPtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbFileExists', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', 'dbSoundCloundUploadTime', 'dbReplayGain', 'dbOwnerId', 'dbCuein', 'dbCueout', 'dbHidden', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::UTIME, self::LPTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::FILE_EXISTS, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, self::SOUNDCLOUD_UPLOAD_TIME, self::REPLAY_GAIN, self::OWNER_ID, self::CUEIN, self::CUEOUT, self::HIDDEN, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'UTIME', 'LPTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'FILE_EXISTS', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', 'SOUNDCLOUD_UPLOAD_TIME', 'REPLAY_GAIN', 'OWNER_ID', 'CUEIN', 'CUEOUT', 'HIDDEN', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'utime', 'lptime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'file_exists', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', 'soundcloud_upload_time', 'replay_gain', 'owner_id', 'cuein', 'cueout', 'hidden', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -254,12 +263,12 @@ abstract class BaseCcFilesPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, self::OWNER_ID => 63, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMime' => 2, 'DbFtype' => 3, 'DbDirectory' => 4, 'DbFilepath' => 5, 'DbState' => 6, 'DbCurrentlyaccessing' => 7, 'DbEditedby' => 8, 'DbMtime' => 9, 'DbUtime' => 10, 'DbLPtime' => 11, 'DbMd5' => 12, 'DbTrackTitle' => 13, 'DbArtistName' => 14, 'DbBitRate' => 15, 'DbSampleRate' => 16, 'DbFormat' => 17, 'DbLength' => 18, 'DbAlbumTitle' => 19, 'DbGenre' => 20, 'DbComments' => 21, 'DbYear' => 22, 'DbTrackNumber' => 23, 'DbChannels' => 24, 'DbUrl' => 25, 'DbBpm' => 26, 'DbRating' => 27, 'DbEncodedBy' => 28, 'DbDiscNumber' => 29, 'DbMood' => 30, 'DbLabel' => 31, 'DbComposer' => 32, 'DbEncoder' => 33, 'DbChecksum' => 34, 'DbLyrics' => 35, 'DbOrchestra' => 36, 'DbConductor' => 37, 'DbLyricist' => 38, 'DbOriginalLyricist' => 39, 'DbRadioStationName' => 40, 'DbInfoUrl' => 41, 'DbArtistUrl' => 42, 'DbAudioSourceUrl' => 43, 'DbRadioStationUrl' => 44, 'DbBuyThisUrl' => 45, 'DbIsrcNumber' => 46, 'DbCatalogNumber' => 47, 'DbOriginalArtist' => 48, 'DbCopyright' => 49, 'DbReportDatetime' => 50, 'DbReportLocation' => 51, 'DbReportOrganization' => 52, 'DbSubject' => 53, 'DbContributor' => 54, 'DbLanguage' => 55, 'DbFileExists' => 56, 'DbSoundcloudId' => 57, 'DbSoundcloudErrorCode' => 58, 'DbSoundcloudErrorMsg' => 59, 'DbSoundcloudLinkToFile' => 60, 'DbSoundCloundUploadTime' => 61, 'DbReplayGain' => 62, 'DbOwnerId' => 63, 'DbCuein' => 64, 'DbCueout' => 65, 'DbHidden' => 66, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMime' => 2, 'dbFtype' => 3, 'dbDirectory' => 4, 'dbFilepath' => 5, 'dbState' => 6, 'dbCurrentlyaccessing' => 7, 'dbEditedby' => 8, 'dbMtime' => 9, 'dbUtime' => 10, 'dbLPtime' => 11, 'dbMd5' => 12, 'dbTrackTitle' => 13, 'dbArtistName' => 14, 'dbBitRate' => 15, 'dbSampleRate' => 16, 'dbFormat' => 17, 'dbLength' => 18, 'dbAlbumTitle' => 19, 'dbGenre' => 20, 'dbComments' => 21, 'dbYear' => 22, 'dbTrackNumber' => 23, 'dbChannels' => 24, 'dbUrl' => 25, 'dbBpm' => 26, 'dbRating' => 27, 'dbEncodedBy' => 28, 'dbDiscNumber' => 29, 'dbMood' => 30, 'dbLabel' => 31, 'dbComposer' => 32, 'dbEncoder' => 33, 'dbChecksum' => 34, 'dbLyrics' => 35, 'dbOrchestra' => 36, 'dbConductor' => 37, 'dbLyricist' => 38, 'dbOriginalLyricist' => 39, 'dbRadioStationName' => 40, 'dbInfoUrl' => 41, 'dbArtistUrl' => 42, 'dbAudioSourceUrl' => 43, 'dbRadioStationUrl' => 44, 'dbBuyThisUrl' => 45, 'dbIsrcNumber' => 46, 'dbCatalogNumber' => 47, 'dbOriginalArtist' => 48, 'dbCopyright' => 49, 'dbReportDatetime' => 50, 'dbReportLocation' => 51, 'dbReportOrganization' => 52, 'dbSubject' => 53, 'dbContributor' => 54, 'dbLanguage' => 55, 'dbFileExists' => 56, 'dbSoundcloudId' => 57, 'dbSoundcloudErrorCode' => 58, 'dbSoundcloudErrorMsg' => 59, 'dbSoundcloudLinkToFile' => 60, 'dbSoundCloundUploadTime' => 61, 'dbReplayGain' => 62, 'dbOwnerId' => 63, 'dbCuein' => 64, 'dbCueout' => 65, 'dbHidden' => 66, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MIME => 2, self::FTYPE => 3, self::DIRECTORY => 4, self::FILEPATH => 5, self::STATE => 6, self::CURRENTLYACCESSING => 7, self::EDITEDBY => 8, self::MTIME => 9, self::UTIME => 10, self::LPTIME => 11, self::MD5 => 12, self::TRACK_TITLE => 13, self::ARTIST_NAME => 14, self::BIT_RATE => 15, self::SAMPLE_RATE => 16, self::FORMAT => 17, self::LENGTH => 18, self::ALBUM_TITLE => 19, self::GENRE => 20, self::COMMENTS => 21, self::YEAR => 22, self::TRACK_NUMBER => 23, self::CHANNELS => 24, self::URL => 25, self::BPM => 26, self::RATING => 27, self::ENCODED_BY => 28, self::DISC_NUMBER => 29, self::MOOD => 30, self::LABEL => 31, self::COMPOSER => 32, self::ENCODER => 33, self::CHECKSUM => 34, self::LYRICS => 35, self::ORCHESTRA => 36, self::CONDUCTOR => 37, self::LYRICIST => 38, self::ORIGINAL_LYRICIST => 39, self::RADIO_STATION_NAME => 40, self::INFO_URL => 41, self::ARTIST_URL => 42, self::AUDIO_SOURCE_URL => 43, self::RADIO_STATION_URL => 44, self::BUY_THIS_URL => 45, self::ISRC_NUMBER => 46, self::CATALOG_NUMBER => 47, self::ORIGINAL_ARTIST => 48, self::COPYRIGHT => 49, self::REPORT_DATETIME => 50, self::REPORT_LOCATION => 51, self::REPORT_ORGANIZATION => 52, self::SUBJECT => 53, self::CONTRIBUTOR => 54, self::LANGUAGE => 55, self::FILE_EXISTS => 56, self::SOUNDCLOUD_ID => 57, self::SOUNDCLOUD_ERROR_CODE => 58, self::SOUNDCLOUD_ERROR_MSG => 59, self::SOUNDCLOUD_LINK_TO_FILE => 60, self::SOUNDCLOUD_UPLOAD_TIME => 61, self::REPLAY_GAIN => 62, self::OWNER_ID => 63, self::CUEIN => 64, self::CUEOUT => 65, self::HIDDEN => 66, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MIME' => 2, 'FTYPE' => 3, 'DIRECTORY' => 4, 'FILEPATH' => 5, 'STATE' => 6, 'CURRENTLYACCESSING' => 7, 'EDITEDBY' => 8, 'MTIME' => 9, 'UTIME' => 10, 'LPTIME' => 11, 'MD5' => 12, 'TRACK_TITLE' => 13, 'ARTIST_NAME' => 14, 'BIT_RATE' => 15, 'SAMPLE_RATE' => 16, 'FORMAT' => 17, 'LENGTH' => 18, 'ALBUM_TITLE' => 19, 'GENRE' => 20, 'COMMENTS' => 21, 'YEAR' => 22, 'TRACK_NUMBER' => 23, 'CHANNELS' => 24, 'URL' => 25, 'BPM' => 26, 'RATING' => 27, 'ENCODED_BY' => 28, 'DISC_NUMBER' => 29, 'MOOD' => 30, 'LABEL' => 31, 'COMPOSER' => 32, 'ENCODER' => 33, 'CHECKSUM' => 34, 'LYRICS' => 35, 'ORCHESTRA' => 36, 'CONDUCTOR' => 37, 'LYRICIST' => 38, 'ORIGINAL_LYRICIST' => 39, 'RADIO_STATION_NAME' => 40, 'INFO_URL' => 41, 'ARTIST_URL' => 42, 'AUDIO_SOURCE_URL' => 43, 'RADIO_STATION_URL' => 44, 'BUY_THIS_URL' => 45, 'ISRC_NUMBER' => 46, 'CATALOG_NUMBER' => 47, 'ORIGINAL_ARTIST' => 48, 'COPYRIGHT' => 49, 'REPORT_DATETIME' => 50, 'REPORT_LOCATION' => 51, 'REPORT_ORGANIZATION' => 52, 'SUBJECT' => 53, 'CONTRIBUTOR' => 54, 'LANGUAGE' => 55, 'FILE_EXISTS' => 56, 'SOUNDCLOUD_ID' => 57, 'SOUNDCLOUD_ERROR_CODE' => 58, 'SOUNDCLOUD_ERROR_MSG' => 59, 'SOUNDCLOUD_LINK_TO_FILE' => 60, 'SOUNDCLOUD_UPLOAD_TIME' => 61, 'REPLAY_GAIN' => 62, 'OWNER_ID' => 63, 'CUEIN' => 64, 'CUEOUT' => 65, 'HIDDEN' => 66, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mime' => 2, 'ftype' => 3, 'directory' => 4, 'filepath' => 5, 'state' => 6, 'currentlyaccessing' => 7, 'editedby' => 8, 'mtime' => 9, 'utime' => 10, 'lptime' => 11, 'md5' => 12, 'track_title' => 13, 'artist_name' => 14, 'bit_rate' => 15, 'sample_rate' => 16, 'format' => 17, 'length' => 18, 'album_title' => 19, 'genre' => 20, 'comments' => 21, 'year' => 22, 'track_number' => 23, 'channels' => 24, 'url' => 25, 'bpm' => 26, 'rating' => 27, 'encoded_by' => 28, 'disc_number' => 29, 'mood' => 30, 'label' => 31, 'composer' => 32, 'encoder' => 33, 'checksum' => 34, 'lyrics' => 35, 'orchestra' => 36, 'conductor' => 37, 'lyricist' => 38, 'original_lyricist' => 39, 'radio_station_name' => 40, 'info_url' => 41, 'artist_url' => 42, 'audio_source_url' => 43, 'radio_station_url' => 44, 'buy_this_url' => 45, 'isrc_number' => 46, 'catalog_number' => 47, 'original_artist' => 48, 'copyright' => 49, 'report_datetime' => 50, 'report_location' => 51, 'report_organization' => 52, 'subject' => 53, 'contributor' => 54, 'language' => 55, 'file_exists' => 56, 'soundcloud_id' => 57, 'soundcloud_error_code' => 58, 'soundcloud_error_msg' => 59, 'soundcloud_link_to_file' => 60, 'soundcloud_upload_time' => 61, 'replay_gain' => 62, 'owner_id' => 63, 'cuein' => 64, 'cueout' => 65, 'hidden' => 66, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -395,6 +404,9 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_UPLOAD_TIME);
|
||||
$criteria->addSelectColumn(CcFilesPeer::REPLAY_GAIN);
|
||||
$criteria->addSelectColumn(CcFilesPeer::OWNER_ID);
|
||||
$criteria->addSelectColumn(CcFilesPeer::CUEIN);
|
||||
$criteria->addSelectColumn(CcFilesPeer::CUEOUT);
|
||||
$criteria->addSelectColumn(CcFilesPeer::HIDDEN);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.NAME');
|
||||
|
@ -460,6 +472,9 @@ abstract class BaseCcFilesPeer {
|
|||
$criteria->addSelectColumn($alias . '.SOUNDCLOUD_UPLOAD_TIME');
|
||||
$criteria->addSelectColumn($alias . '.REPLAY_GAIN');
|
||||
$criteria->addSelectColumn($alias . '.OWNER_ID');
|
||||
$criteria->addSelectColumn($alias . '.CUEIN');
|
||||
$criteria->addSelectColumn($alias . '.CUEOUT');
|
||||
$criteria->addSelectColumn($alias . '.HIDDEN');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,9 @@
|
|||
* @method CcFilesQuery orderByDbSoundCloundUploadTime($order = Criteria::ASC) Order by the soundcloud_upload_time column
|
||||
* @method CcFilesQuery orderByDbReplayGain($order = Criteria::ASC) Order by the replay_gain column
|
||||
* @method CcFilesQuery orderByDbOwnerId($order = Criteria::ASC) Order by the owner_id column
|
||||
* @method CcFilesQuery orderByDbCuein($order = Criteria::ASC) Order by the cuein column
|
||||
* @method CcFilesQuery orderByDbCueout($order = Criteria::ASC) Order by the cueout column
|
||||
* @method CcFilesQuery orderByDbHidden($order = Criteria::ASC) Order by the hidden column
|
||||
*
|
||||
* @method CcFilesQuery groupByDbId() Group by the id column
|
||||
* @method CcFilesQuery groupByDbName() Group by the name column
|
||||
|
@ -135,6 +138,9 @@
|
|||
* @method CcFilesQuery groupByDbSoundCloundUploadTime() Group by the soundcloud_upload_time column
|
||||
* @method CcFilesQuery groupByDbReplayGain() Group by the replay_gain column
|
||||
* @method CcFilesQuery groupByDbOwnerId() Group by the owner_id column
|
||||
* @method CcFilesQuery groupByDbCuein() Group by the cuein column
|
||||
* @method CcFilesQuery groupByDbCueout() Group by the cueout column
|
||||
* @method CcFilesQuery groupByDbHidden() Group by the hidden column
|
||||
*
|
||||
* @method CcFilesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcFilesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
|
@ -235,6 +241,9 @@
|
|||
* @method CcFiles findOneByDbSoundCloundUploadTime(string $soundcloud_upload_time) Return the first CcFiles filtered by the soundcloud_upload_time column
|
||||
* @method CcFiles findOneByDbReplayGain(string $replay_gain) Return the first CcFiles filtered by the replay_gain column
|
||||
* @method CcFiles findOneByDbOwnerId(int $owner_id) Return the first CcFiles filtered by the owner_id column
|
||||
* @method CcFiles findOneByDbCuein(string $cuein) Return the first CcFiles filtered by the cuein column
|
||||
* @method CcFiles findOneByDbCueout(string $cueout) Return the first CcFiles filtered by the cueout column
|
||||
* @method CcFiles findOneByDbHidden(boolean $hidden) Return the first CcFiles filtered by the hidden column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcFiles objects filtered by the id column
|
||||
* @method array findByDbName(string $name) Return CcFiles objects filtered by the name column
|
||||
|
@ -300,6 +309,9 @@
|
|||
* @method array findByDbSoundCloundUploadTime(string $soundcloud_upload_time) Return CcFiles objects filtered by the soundcloud_upload_time column
|
||||
* @method array findByDbReplayGain(string $replay_gain) Return CcFiles objects filtered by the replay_gain column
|
||||
* @method array findByDbOwnerId(int $owner_id) Return CcFiles objects filtered by the owner_id column
|
||||
* @method array findByDbCuein(string $cuein) Return CcFiles objects filtered by the cuein column
|
||||
* @method array findByDbCueout(string $cueout) Return CcFiles objects filtered by the cueout column
|
||||
* @method array findByDbHidden(boolean $hidden) Return CcFiles objects filtered by the hidden column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
|
@ -1951,6 +1963,67 @@ abstract class BaseCcFilesQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcFilesPeer::OWNER_ID, $dbOwnerId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the cuein column
|
||||
*
|
||||
* @param string $dbCuein The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCuein($dbCuein = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbCuein)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbCuein)) {
|
||||
$dbCuein = str_replace('*', '%', $dbCuein);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::CUEIN, $dbCuein, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the cueout column
|
||||
*
|
||||
* @param string $dbCueout The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCueout($dbCueout = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbCueout)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbCueout)) {
|
||||
$dbCueout = str_replace('*', '%', $dbCueout);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::CUEOUT, $dbCueout, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the hidden column
|
||||
*
|
||||
* @param boolean|string $dbHidden The value to use as filter.
|
||||
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbHidden($dbHidden = null, $comparison = null)
|
||||
{
|
||||
if (is_string($dbHidden)) {
|
||||
$hidden = in_array(strtolower($dbHidden), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
|
||||
}
|
||||
return $this->addUsingAlias(CcFilesPeer::HIDDEN, $dbHidden, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSubjs object
|
||||
*
|
||||
|
|
764
airtime_mvc/application/models/airtime/om/BaseCcLocale.php
Normal file
764
airtime_mvc/application/models/airtime/om/BaseCcLocale.php
Normal file
|
@ -0,0 +1,764 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a row from the 'cc_locale' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcLocale extends BaseObject implements Persistent
|
||||
{
|
||||
|
||||
/**
|
||||
* Peer class name
|
||||
*/
|
||||
const PEER = 'CcLocalePeer';
|
||||
|
||||
/**
|
||||
* 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 CcLocalePeer
|
||||
*/
|
||||
protected static $peer;
|
||||
|
||||
/**
|
||||
* The value for the id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* The value for the locale_code field.
|
||||
* @var string
|
||||
*/
|
||||
protected $locale_code;
|
||||
|
||||
/**
|
||||
* The value for the locale_lang field.
|
||||
* @var string
|
||||
*/
|
||||
protected $locale_lang;
|
||||
|
||||
/**
|
||||
* 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 getDbId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [locale_code] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDbLocaleCode()
|
||||
{
|
||||
return $this->locale_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [locale_lang] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDbLocaleLang()
|
||||
{
|
||||
return $this->locale_lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return CcLocale The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->id !== $v) {
|
||||
$this->id = $v;
|
||||
$this->modifiedColumns[] = CcLocalePeer::ID;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbId()
|
||||
|
||||
/**
|
||||
* Set the value of [locale_code] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return CcLocale The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbLocaleCode($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->locale_code !== $v) {
|
||||
$this->locale_code = $v;
|
||||
$this->modifiedColumns[] = CcLocalePeer::LOCALE_CODE;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbLocaleCode()
|
||||
|
||||
/**
|
||||
* Set the value of [locale_lang] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return CcLocale The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbLocaleLang($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->locale_lang !== $v) {
|
||||
$this->locale_lang = $v;
|
||||
$this->modifiedColumns[] = CcLocalePeer::LOCALE_LANG;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbLocaleLang()
|
||||
|
||||
/**
|
||||
* 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->locale_code = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
||||
$this->locale_lang = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
if ($rehydrate) {
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 3; // 3 = CcLocalePeer::NUM_COLUMNS - CcLocalePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcLocale 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(CcLocalePeer::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 = CcLocalePeer::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?
|
||||
|
||||
} // 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(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
$con->beginTransaction();
|
||||
try {
|
||||
$ret = $this->preDelete($con);
|
||||
if ($ret) {
|
||||
CcLocaleQuery::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(CcLocalePeer::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);
|
||||
CcLocalePeer::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[] = CcLocalePeer::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(CcLocalePeer::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcLocalePeer::ID.')');
|
||||
}
|
||||
|
||||
$pk = BasePeer::doInsert($criteria, $con);
|
||||
$affectedRows = 1;
|
||||
$this->setDbId($pk); //[IMV] update autoincrement primary key
|
||||
$this->setNew(false);
|
||||
} else {
|
||||
$affectedRows = CcLocalePeer::doUpdate($this, $con);
|
||||
}
|
||||
|
||||
$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
|
||||
}
|
||||
|
||||
$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 = CcLocalePeer::doValidate($this, $columns)) !== true) {
|
||||
$failureMap = array_merge($failureMap, $retval);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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 = CcLocalePeer::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->getDbId();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getDbLocaleCode();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getDbLocaleLang();
|
||||
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 = CcLocalePeer::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getDbId(),
|
||||
$keys[1] => $this->getDbLocaleCode(),
|
||||
$keys[2] => $this->getDbLocaleLang(),
|
||||
);
|
||||
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 = CcLocalePeer::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->setDbId($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setDbLocaleCode($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setDbLocaleLang($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 = CcLocalePeer::getFieldNames($keyType);
|
||||
|
||||
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setDbLocaleCode($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setDbLocaleLang($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(CcLocalePeer::DATABASE_NAME);
|
||||
|
||||
if ($this->isColumnModified(CcLocalePeer::ID)) $criteria->add(CcLocalePeer::ID, $this->id);
|
||||
if ($this->isColumnModified(CcLocalePeer::LOCALE_CODE)) $criteria->add(CcLocalePeer::LOCALE_CODE, $this->locale_code);
|
||||
if ($this->isColumnModified(CcLocalePeer::LOCALE_LANG)) $criteria->add(CcLocalePeer::LOCALE_LANG, $this->locale_lang);
|
||||
|
||||
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(CcLocalePeer::DATABASE_NAME);
|
||||
$criteria->add(CcLocalePeer::ID, $this->id);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary key for this object (row).
|
||||
* @return int
|
||||
*/
|
||||
public function getPrimaryKey()
|
||||
{
|
||||
return $this->getDbId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to set the primary key (id column).
|
||||
*
|
||||
* @param int $key Primary key.
|
||||
* @return void
|
||||
*/
|
||||
public function setPrimaryKey($key)
|
||||
{
|
||||
$this->setDbId($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the primary key for this object is null.
|
||||
* @return boolean
|
||||
*/
|
||||
public function isPrimaryKeyNull()
|
||||
{
|
||||
return null === $this->getDbId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 CcLocale (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->setDbLocaleCode($this->locale_code);
|
||||
$copyObj->setDbLocaleLang($this->locale_lang);
|
||||
|
||||
$copyObj->setNew(true);
|
||||
$copyObj->setDbId(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 CcLocale 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 CcLocalePeer
|
||||
*/
|
||||
public function getPeer()
|
||||
{
|
||||
if (self::$peer === null) {
|
||||
self::$peer = new CcLocalePeer();
|
||||
}
|
||||
return self::$peer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the current object and sets all attributes to their default values
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->id = null;
|
||||
$this->locale_code = null;
|
||||
$this->locale_lang = 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 ($deep)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
} // BaseCcLocale
|
744
airtime_mvc/application/models/airtime/om/BaseCcLocalePeer.php
Normal file
744
airtime_mvc/application/models/airtime/om/BaseCcLocalePeer.php
Normal file
|
@ -0,0 +1,744 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'cc_locale' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcLocalePeer {
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'airtime';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'cc_locale';
|
||||
|
||||
/** the related Propel class for this table */
|
||||
const OM_CLASS = 'CcLocale';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'airtime.CcLocale';
|
||||
|
||||
/** the related TableMap class for this table */
|
||||
const TM_CLASS = 'CcLocaleTableMap';
|
||||
|
||||
/** 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_locale.ID';
|
||||
|
||||
/** the column name for the LOCALE_CODE field */
|
||||
const LOCALE_CODE = 'cc_locale.LOCALE_CODE';
|
||||
|
||||
/** the column name for the LOCALE_LANG field */
|
||||
const LOCALE_LANG = 'cc_locale.LOCALE_LANG';
|
||||
|
||||
/**
|
||||
* An identiy map to hold any loaded instances of CcLocale objects.
|
||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||
* queries.
|
||||
* @var array CcLocale[]
|
||||
*/
|
||||
public static $instances = array();
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbLocaleCode', 'DbLocaleLang', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLocaleCode', 'dbLocaleLang', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::LOCALE_CODE, self::LOCALE_LANG, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOCALE_CODE', 'LOCALE_LANG', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'locale_code', 'locale_lang', ),
|
||||
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 ('DbId' => 0, 'DbLocaleCode' => 1, 'DbLocaleLang' => 2, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLocaleCode' => 1, 'dbLocaleLang' => 2, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOCALE_CODE => 1, self::LOCALE_LANG => 2, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOCALE_CODE' => 1, 'LOCALE_LANG' => 2, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'locale_code' => 1, 'locale_lang' => 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. CcLocalePeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(CcLocalePeer::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(CcLocalePeer::ID);
|
||||
$criteria->addSelectColumn(CcLocalePeer::LOCALE_CODE);
|
||||
$criteria->addSelectColumn(CcLocalePeer::LOCALE_LANG);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE_CODE');
|
||||
$criteria->addSelectColumn($alias . '.LOCALE_LANG');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(CcLocalePeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcLocalePeer::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(CcLocalePeer::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 CcLocale
|
||||
* @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 = CcLocalePeer::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 CcLocalePeer::populateObjects(CcLocalePeer::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(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
$criteria = clone $criteria;
|
||||
CcLocalePeer::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 CcLocale $value A CcLocale object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool(CcLocale $obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if ($key === null) {
|
||||
$key = (string) $obj->getDbId();
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A CcLocale object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && $value !== null) {
|
||||
if (is_object($value) && $value instanceof CcLocale) {
|
||||
$key = (string) $value->getDbId();
|
||||
} elseif (is_scalar($value)) {
|
||||
// assume we've been passed a primary key
|
||||
$key = (string) $value;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcLocale 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 CcLocale 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_locale
|
||||
* 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 = CcLocalePeer::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key = CcLocalePeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj = CcLocalePeer::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;
|
||||
CcLocalePeer::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 (CcLocale object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $startcol = 0)
|
||||
{
|
||||
$key = CcLocalePeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||
if (null !== ($obj = CcLocalePeer::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 + CcLocalePeer::NUM_COLUMNS;
|
||||
} else {
|
||||
$cls = CcLocalePeer::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $startcol);
|
||||
CcLocalePeer::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(BaseCcLocalePeer::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(BaseCcLocalePeer::TABLE_NAME))
|
||||
{
|
||||
$dbMap->addTableObject(new CcLocaleTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ? CcLocalePeer::CLASS_DEFAULT : CcLocalePeer::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a CcLocale or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or CcLocale 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(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from CcLocale object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(CcLocalePeer::ID) && $criteria->keyContainsValue(CcLocalePeer::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcLocalePeer::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 CcLocale or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or CcLocale 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(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(CcLocalePeer::ID);
|
||||
$value = $criteria->remove(CcLocalePeer::ID);
|
||||
if ($value) {
|
||||
$selectCriteria->add(CcLocalePeer::ID, $value, $comparison);
|
||||
} else {
|
||||
$selectCriteria->setPrimaryTableName(CcLocalePeer::TABLE_NAME);
|
||||
}
|
||||
|
||||
} else { // $values is CcLocale 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_locale 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(CcLocalePeer::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(CcLocalePeer::TABLE_NAME, $con, CcLocalePeer::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).
|
||||
CcLocalePeer::clearInstancePool();
|
||||
CcLocalePeer::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a CcLocale or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CcLocale 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(CcLocalePeer::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.
|
||||
CcLocalePeer::clearInstancePool();
|
||||
// rename for clarity
|
||||
$criteria = clone $values;
|
||||
} elseif ($values instanceof CcLocale) { // it's a model object
|
||||
// invalidate the cache for this single object
|
||||
CcLocalePeer::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(CcLocalePeer::ID, (array) $values, Criteria::IN);
|
||||
// invalidate the cache for this object(s)
|
||||
foreach ((array) $values as $singleval) {
|
||||
CcLocalePeer::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);
|
||||
CcLocalePeer::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given CcLocale 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 CcLocale $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(CcLocale $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(CcLocalePeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(CcLocalePeer::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(CcLocalePeer::DATABASE_NAME, CcLocalePeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param int $pk the primary key.
|
||||
* @param PropelPDO $con the connection to use
|
||||
* @return CcLocale
|
||||
*/
|
||||
public static function retrieveByPK($pk, PropelPDO $con = null)
|
||||
{
|
||||
|
||||
if (null !== ($obj = CcLocalePeer::getInstanceFromPool((string) $pk))) {
|
||||
return $obj;
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(CcLocalePeer::DATABASE_NAME);
|
||||
$criteria->add(CcLocalePeer::ID, $pk);
|
||||
|
||||
$v = CcLocalePeer::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(CcLocalePeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria(CcLocalePeer::DATABASE_NAME);
|
||||
$criteria->add(CcLocalePeer::ID, $pks, Criteria::IN);
|
||||
$objs = CcLocalePeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
|
||||
} // BaseCcLocalePeer
|
||||
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
BaseCcLocalePeer::buildTableMap();
|
||||
|
217
airtime_mvc/application/models/airtime/om/BaseCcLocaleQuery.php
Normal file
217
airtime_mvc/application/models/airtime/om/BaseCcLocaleQuery.php
Normal file
|
@ -0,0 +1,217 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'cc_locale' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method CcLocaleQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcLocaleQuery orderByDbLocaleCode($order = Criteria::ASC) Order by the locale_code column
|
||||
* @method CcLocaleQuery orderByDbLocaleLang($order = Criteria::ASC) Order by the locale_lang column
|
||||
*
|
||||
* @method CcLocaleQuery groupByDbId() Group by the id column
|
||||
* @method CcLocaleQuery groupByDbLocaleCode() Group by the locale_code column
|
||||
* @method CcLocaleQuery groupByDbLocaleLang() Group by the locale_lang column
|
||||
*
|
||||
* @method CcLocaleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcLocaleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcLocaleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcLocale findOne(PropelPDO $con = null) Return the first CcLocale matching the query
|
||||
* @method CcLocale findOneOrCreate(PropelPDO $con = null) Return the first CcLocale matching the query, or a new CcLocale object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcLocale findOneByDbId(int $id) Return the first CcLocale filtered by the id column
|
||||
* @method CcLocale findOneByDbLocaleCode(string $locale_code) Return the first CcLocale filtered by the locale_code column
|
||||
* @method CcLocale findOneByDbLocaleLang(string $locale_lang) Return the first CcLocale filtered by the locale_lang column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcLocale objects filtered by the id column
|
||||
* @method array findByDbLocaleCode(string $locale_code) Return CcLocale objects filtered by the locale_code column
|
||||
* @method array findByDbLocaleLang(string $locale_lang) Return CcLocale objects filtered by the locale_lang column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcLocaleQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCcLocaleQuery 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 = 'CcLocale', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CcLocaleQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CcLocaleQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CcLocaleQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CcLocaleQuery();
|
||||
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 CcLocale|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ((null !== ($obj = CcLocalePeer::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 CcLocaleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
return $this->addUsingAlias(CcLocalePeer::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 CcLocaleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
return $this->addUsingAlias(CcLocalePeer::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* @param int|array $dbId The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcLocaleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbId($dbId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbId) && null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
return $this->addUsingAlias(CcLocalePeer::ID, $dbId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale_code column
|
||||
*
|
||||
* @param string $dbLocaleCode 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 CcLocaleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbLocaleCode($dbLocaleCode = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbLocaleCode)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbLocaleCode)) {
|
||||
$dbLocaleCode = str_replace('*', '%', $dbLocaleCode);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcLocalePeer::LOCALE_CODE, $dbLocaleCode, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the locale_lang column
|
||||
*
|
||||
* @param string $dbLocaleLang 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 CcLocaleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbLocaleLang($dbLocaleLang = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbLocaleLang)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbLocaleLang)) {
|
||||
$dbLocaleLang = str_replace('*', '%', $dbLocaleLang);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcLocalePeer::LOCALE_LANG, $dbLocaleLang, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CcLocale $ccLocale Object to remove from the list of results
|
||||
*
|
||||
* @return CcLocaleQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($ccLocale = null)
|
||||
{
|
||||
if ($ccLocale) {
|
||||
$this->addUsingAlias(CcLocalePeer::ID, $ccLocale->getDbId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
} // BaseCcLocaleQuery
|
Loading…
Add table
Add a link
Reference in a new issue