CC-3098: Upgrade scripts don't work
-fixed
This commit is contained in:
parent
d71c2289ac
commit
49051b7fc2
155 changed files with 63297 additions and 10 deletions
|
@ -37,6 +37,11 @@ echo -e "\n******************************** Install Begin **********************
|
||||||
|
|
||||||
rm -rf "/usr/lib/airtime"
|
rm -rf "/usr/lib/airtime"
|
||||||
$AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh
|
$AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh
|
||||||
|
|
||||||
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
|
. ${virtualenv_bin}activate
|
||||||
|
|
||||||
|
|
||||||
python $AIRTIMEROOT/python_apps/create-pypo-user.py
|
python $AIRTIMEROOT/python_apps/create-pypo-user.py
|
||||||
|
|
||||||
if [ "$result" = "1" ]; then
|
if [ "$result" = "1" ]; then
|
||||||
|
@ -53,4 +58,7 @@ echo -e "\n*** Verifying your system environment, running airtime-check-system *
|
||||||
sleep 10
|
sleep 10
|
||||||
airtime-check-system
|
airtime-check-system
|
||||||
|
|
||||||
|
#deactivate virtualenv
|
||||||
|
deactivate
|
||||||
|
|
||||||
echo -e "\n******************************* Install Complete *******************************"
|
echo -e "\n******************************* Install Complete *******************************"
|
||||||
|
|
|
@ -13,6 +13,9 @@ SCRIPT=`readlink -f $0`
|
||||||
# Absolute path this script is in, thus /home/user/bin
|
# Absolute path this script is in, thus /home/user/bin
|
||||||
SCRIPTPATH=`dirname $SCRIPT`
|
SCRIPTPATH=`dirname $SCRIPT`
|
||||||
|
|
||||||
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
|
. ${virtualenv_bin}activate
|
||||||
|
|
||||||
#Uninitialize Airtime
|
#Uninitialize Airtime
|
||||||
$SCRIPTPATH/include/airtime-uninitialize.sh
|
$SCRIPTPATH/include/airtime-uninitialize.sh
|
||||||
|
|
||||||
|
@ -22,6 +25,9 @@ $SCRIPTPATH/include/airtime-remove-files.sh
|
||||||
#Remove pypo user
|
#Remove pypo user
|
||||||
python $SCRIPTPATH/../python_apps/remove-pypo-user.py
|
python $SCRIPTPATH/../python_apps/remove-pypo-user.py
|
||||||
|
|
||||||
|
#deactivate virtualenv
|
||||||
|
deactivate
|
||||||
|
|
||||||
echo -e "\n****************************** Uninstall Complete *******************************\n"
|
echo -e "\n****************************** Uninstall Complete *******************************\n"
|
||||||
echo "NOTE: To fully remove all Airtime files, you will also have to manually delete"
|
echo "NOTE: To fully remove all Airtime files, you will also have to manually delete"
|
||||||
echo " the directories '/srv/airtime'(default storage location of media files)"
|
echo " the directories '/srv/airtime'(default storage location of media files)"
|
||||||
|
|
|
@ -64,8 +64,8 @@ HOUR=$(($RANDOM%24))
|
||||||
MIN=$(($RANDOM%60))
|
MIN=$(($RANDOM%60))
|
||||||
echo "$MIN $HOUR * * * root /usr/lib/airtime/utils/phone_home_stat" > /etc/cron.d/airtime-crons
|
echo "$MIN $HOUR * * * root /usr/lib/airtime/utils/phone_home_stat" > /etc/cron.d/airtime-crons
|
||||||
|
|
||||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
. ${virtualenv_bin}activate
|
#. ${virtualenv_bin}activate
|
||||||
|
|
||||||
echo "* Creating /usr/lib/airtime"
|
echo "* Creating /usr/lib/airtime"
|
||||||
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_install.py
|
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_install.py
|
||||||
|
|
|
@ -14,8 +14,8 @@ SCRIPTPATH=`dirname $SCRIPT`
|
||||||
|
|
||||||
AIRTIMEROOT=$SCRIPTPATH/../../
|
AIRTIMEROOT=$SCRIPTPATH/../../
|
||||||
|
|
||||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
. ${virtualenv_bin}activate
|
#. ${virtualenv_bin}activate
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
php --php-ini ${SCRIPTPATH}/../airtime-php.ini ${SCRIPTPATH}/airtime-install.php $@
|
php --php-ini ${SCRIPTPATH}/../airtime-php.ini ${SCRIPTPATH}/airtime-install.php $@
|
||||||
|
|
|
@ -29,8 +29,8 @@ AIRTIMEROOT=$SCRIPTPATH/../../
|
||||||
|
|
||||||
rm -f /etc/cron.d/airtime-crons
|
rm -f /etc/cron.d/airtime-crons
|
||||||
|
|
||||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
. ${virtualenv_bin}activate
|
#. ${virtualenv_bin}activate
|
||||||
|
|
||||||
echo "* API Client"
|
echo "* API Client"
|
||||||
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_uninstall.py
|
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_uninstall.py
|
||||||
|
|
|
@ -23,8 +23,8 @@ monit unmonitor airtime-show-recorder >/dev/null 2>&1
|
||||||
#monit unmonitor rabbitmq-server
|
#monit unmonitor rabbitmq-server
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
. ${virtualenv_bin}activate
|
#. ${virtualenv_bin}activate
|
||||||
|
|
||||||
#uninitialize Airtime services
|
#uninitialize Airtime services
|
||||||
python $AIRTIMEROOT/python_apps/pypo/install/pypo-uninitialize.py
|
python $AIRTIMEROOT/python_apps/pypo/install/pypo-uninitialize.py
|
||||||
|
|
|
@ -8,12 +8,14 @@
|
||||||
|
|
||||||
set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||||
set_include_path(__DIR__.'/../../../airtime_mvc/library/pear' . PATH_SEPARATOR . get_include_path());
|
set_include_path(__DIR__.'/../../../airtime_mvc/library/pear' . PATH_SEPARATOR . get_include_path());
|
||||||
set_include_path(__DIR__.'/../../../airtime_mvc/application/models' . PATH_SEPARATOR . get_include_path());
|
|
||||||
require_once 'conf.php';
|
require_once 'conf.php';
|
||||||
require_once 'DB.php';
|
require_once 'DB.php';
|
||||||
|
|
||||||
require_once 'propel/runtime/lib/Propel.php';
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
Propel::init(__DIR__."/../../../airtime_mvc/application/configs/airtime-conf.php");
|
|
||||||
|
set_include_path(__DIR__.'/propel' . PATH_SEPARATOR . get_include_path());
|
||||||
|
Propel::init(__DIR__."/propel/airtime-conf.php");
|
||||||
|
|
||||||
|
|
||||||
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
const CONF_DIR_BINARIES = "/usr/lib/airtime";
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
// This file generated by Propel 1.5.2 convert-conf target
|
||||||
|
// from XML runtime conf file /home/naomiaro/dev-campcaster/campcaster/build/runtime-conf.xml
|
||||||
|
$conf = array (
|
||||||
|
'datasources' =>
|
||||||
|
array (
|
||||||
|
'airtime' =>
|
||||||
|
array (
|
||||||
|
'adapter' => 'pgsql',
|
||||||
|
'connection' =>
|
||||||
|
array (
|
||||||
|
'dsn' => 'pgsql:host=localhost;port=5432;dbname=airtime;user=airtime;password=airtime',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'default' => 'airtime',
|
||||||
|
),
|
||||||
|
'generator_version' => '1.5.2',
|
||||||
|
);
|
||||||
|
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php');
|
||||||
|
return $conf;
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_access' 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 CcAccess extends BaseCcAccess {
|
||||||
|
|
||||||
|
} // CcAccess
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_access' 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 CcAccessPeer extends BaseCcAccessPeer {
|
||||||
|
|
||||||
|
} // CcAccessPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_access' 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 CcAccessQuery extends BaseCcAccessQuery {
|
||||||
|
|
||||||
|
} // CcAccessQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_backup' 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 CcBackup extends BaseCcBackup {
|
||||||
|
|
||||||
|
} // CcBackup
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_backup' 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 CcBackupPeer extends BaseCcBackupPeer {
|
||||||
|
|
||||||
|
} // CcBackupPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_backup' 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 CcBackupQuery extends BaseCcBackupQuery {
|
||||||
|
|
||||||
|
} // CcBackupQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_country' 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 CcCountry extends BaseCcCountry {
|
||||||
|
|
||||||
|
} // CcCountry
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_country' 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 CcCountryPeer extends BaseCcCountryPeer {
|
||||||
|
|
||||||
|
} // CcCountryPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_country' 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 CcCountryQuery extends BaseCcCountryQuery {
|
||||||
|
|
||||||
|
} // CcCountryQuery
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('Common.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_files' 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.campcaster
|
||||||
|
*/
|
||||||
|
class CcFiles extends BaseCcFiles {
|
||||||
|
|
||||||
|
public function getDbLength()
|
||||||
|
{
|
||||||
|
return $this->length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDbLength($time)
|
||||||
|
{
|
||||||
|
$this->length = $time;
|
||||||
|
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH;
|
||||||
|
return Common::setTimeInSub($this, 'LENGTH', $time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // CcFiles
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_files' 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 CcFilesPeer extends BaseCcFilesPeer {
|
||||||
|
|
||||||
|
} // CcFilesPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_files' 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 CcFilesQuery extends BaseCcFilesQuery {
|
||||||
|
|
||||||
|
} // CcFilesQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_music_dirs' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* You should add additional methods to this class to meet the
|
||||||
|
* application requirements. This class will only be generated as
|
||||||
|
* long as it does not already exist in the output directory.
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime
|
||||||
|
*/
|
||||||
|
class CcMusicDirs extends BaseCcMusicDirs {
|
||||||
|
|
||||||
|
} // CcMusicDirs
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_music_dirs' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* You should add additional methods to this class to meet the
|
||||||
|
* application requirements. This class will only be generated as
|
||||||
|
* long as it does not already exist in the output directory.
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime
|
||||||
|
*/
|
||||||
|
class CcMusicDirsPeer extends BaseCcMusicDirsPeer {
|
||||||
|
|
||||||
|
} // CcMusicDirsPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_music_dirs' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* You should add additional methods to this class to meet the
|
||||||
|
* application requirements. This class will only be generated as
|
||||||
|
* long as it does not already exist in the output directory.
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime
|
||||||
|
*/
|
||||||
|
class CcMusicDirsQuery extends BaseCcMusicDirsQuery {
|
||||||
|
|
||||||
|
} // CcMusicDirsQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_perms' 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 CcPerms extends BaseCcPerms {
|
||||||
|
|
||||||
|
} // CcPerms
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_perms' 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 CcPermsPeer extends BaseCcPermsPeer {
|
||||||
|
|
||||||
|
} // CcPermsPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_perms' 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 CcPermsQuery extends BaseCcPermsQuery {
|
||||||
|
|
||||||
|
} // CcPermsQuery
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_playlist' 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.campcaster
|
||||||
|
*/
|
||||||
|
class CcPlaylist extends BaseCcPlaylist {
|
||||||
|
|
||||||
|
|
||||||
|
public function computeLastPosition()
|
||||||
|
{
|
||||||
|
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
$sql = 'SELECT MAX('.CcPlaylistcontentsPeer::POSITION.') AS pos'
|
||||||
|
. ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME
|
||||||
|
. ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1';
|
||||||
|
|
||||||
|
$stmt = $con->prepare($sql);
|
||||||
|
$stmt->bindValue(':p1', $this->getDbId());
|
||||||
|
$stmt->execute();
|
||||||
|
return $stmt->fetchColumn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function computeLength()
|
||||||
|
{
|
||||||
|
$con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
$sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length'
|
||||||
|
. ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME
|
||||||
|
. ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1';
|
||||||
|
|
||||||
|
$stmt = $con->prepare($sql);
|
||||||
|
$stmt->bindValue(':p1', $this->getDbId());
|
||||||
|
$stmt->execute();
|
||||||
|
return $stmt->fetchColumn();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // CcPlaylist
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_playlist' 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 CcPlaylistPeer extends BaseCcPlaylistPeer {
|
||||||
|
|
||||||
|
} // CcPlaylistPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_playlist' 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 CcPlaylistQuery extends BaseCcPlaylistQuery {
|
||||||
|
|
||||||
|
} // CcPlaylistQuery
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once('Common.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_playlistcontents' 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.campcaster
|
||||||
|
*/
|
||||||
|
class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
||||||
|
|
||||||
|
public function getDbFadein()
|
||||||
|
{
|
||||||
|
return $this->fadein;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDbFadein($time)
|
||||||
|
{
|
||||||
|
$this->fadein = $time;
|
||||||
|
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
||||||
|
Common::setTimeInSub($this, 'FADEIN', $time);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDbFadeout()
|
||||||
|
{
|
||||||
|
return $this->fadeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDbFadeout($time)
|
||||||
|
{
|
||||||
|
$this->fadeout = $time;
|
||||||
|
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
||||||
|
Common::setTimeInSub($this, 'FADEOUT', $time);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDbCuein()
|
||||||
|
{
|
||||||
|
return $this->cuein;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDbCuein($time)
|
||||||
|
{
|
||||||
|
$this->cuein = $time;
|
||||||
|
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN;
|
||||||
|
Common::setTimeInSub($this, 'CUEIN', $time);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDbCueout()
|
||||||
|
{
|
||||||
|
return $this->cueout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDbCueout($time)
|
||||||
|
{
|
||||||
|
$this->cueout = $time;
|
||||||
|
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT;
|
||||||
|
Common::setTimeInSub($this, 'CUEOUT', $time);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDbCliplength()
|
||||||
|
{
|
||||||
|
return $this->cliplength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDbCliplength($time)
|
||||||
|
{
|
||||||
|
$this->cliplength = $time;
|
||||||
|
//$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH;
|
||||||
|
Common::setTimeInSub($this, 'CLIPLENGTH', $time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // CcPlaylistcontents
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_playlistcontents' 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 CcPlaylistcontentsPeer extends BaseCcPlaylistcontentsPeer {
|
||||||
|
|
||||||
|
} // CcPlaylistcontentsPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_playlistcontents' 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 CcPlaylistcontentsQuery extends BaseCcPlaylistcontentsQuery {
|
||||||
|
|
||||||
|
} // CcPlaylistcontentsQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_pref' 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 CcPref extends BaseCcPref {
|
||||||
|
|
||||||
|
} // CcPref
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_pref' 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 CcPrefPeer extends BaseCcPrefPeer {
|
||||||
|
|
||||||
|
} // CcPrefPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_pref' 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 CcPrefQuery extends BaseCcPrefQuery {
|
||||||
|
|
||||||
|
} // CcPrefQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_schedule' 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 CcSchedule extends BaseCcSchedule {
|
||||||
|
|
||||||
|
} // CcSchedule
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_schedule' 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 CcSchedulePeer extends BaseCcSchedulePeer {
|
||||||
|
|
||||||
|
} // CcSchedulePeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_schedule' 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 CcScheduleQuery extends BaseCcScheduleQuery {
|
||||||
|
|
||||||
|
} // CcScheduleQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_sess' 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 CcSess extends BaseCcSess {
|
||||||
|
|
||||||
|
} // CcSess
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_sess' 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 CcSessPeer extends BaseCcSessPeer {
|
||||||
|
|
||||||
|
} // CcSessPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_sess' 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 CcSessQuery extends BaseCcSessQuery {
|
||||||
|
|
||||||
|
} // CcSessQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_show' 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 CcShow extends BaseCcShow {
|
||||||
|
|
||||||
|
} // CcShow
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_show_days' 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 CcShowDays extends BaseCcShowDays {
|
||||||
|
|
||||||
|
} // CcShowDays
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_days' 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 CcShowDaysPeer extends BaseCcShowDaysPeer {
|
||||||
|
|
||||||
|
} // CcShowDaysPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_days' 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 CcShowDaysQuery extends BaseCcShowDaysQuery {
|
||||||
|
|
||||||
|
} // CcShowDaysQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_show_hosts' 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 CcShowHosts extends BaseCcShowHosts {
|
||||||
|
|
||||||
|
} // CcShowHosts
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_hosts' 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 CcShowHostsPeer extends BaseCcShowHostsPeer {
|
||||||
|
|
||||||
|
} // CcShowHostsPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_hosts' 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 CcShowHostsQuery extends BaseCcShowHostsQuery {
|
||||||
|
|
||||||
|
} // CcShowHostsQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_show_instances' 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 CcShowInstances extends BaseCcShowInstances {
|
||||||
|
|
||||||
|
} // CcShowInstances
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_instances' 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 CcShowInstancesPeer extends BaseCcShowInstancesPeer {
|
||||||
|
|
||||||
|
} // CcShowInstancesPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_instances' 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 CcShowInstancesQuery extends BaseCcShowInstancesQuery {
|
||||||
|
|
||||||
|
} // CcShowInstancesQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show' 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 CcShowPeer extends BaseCcShowPeer {
|
||||||
|
|
||||||
|
} // CcShowPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show' 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 CcShowQuery extends BaseCcShowQuery {
|
||||||
|
|
||||||
|
} // CcShowQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_show_rebroadcast' 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 CcShowRebroadcast extends BaseCcShowRebroadcast {
|
||||||
|
|
||||||
|
} // CcShowRebroadcast
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_rebroadcast' 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 CcShowRebroadcastPeer extends BaseCcShowRebroadcastPeer {
|
||||||
|
|
||||||
|
} // CcShowRebroadcastPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_rebroadcast' 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 CcShowRebroadcastQuery extends BaseCcShowRebroadcastQuery {
|
||||||
|
|
||||||
|
} // CcShowRebroadcastQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_show_schedule' 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 CcShowSchedule extends BaseCcShowSchedule {
|
||||||
|
|
||||||
|
} // CcShowSchedule
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_schedule' 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 CcShowSchedulePeer extends BaseCcShowSchedulePeer {
|
||||||
|
|
||||||
|
} // CcShowSchedulePeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_show_schedule' 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 CcShowScheduleQuery extends BaseCcShowScheduleQuery {
|
||||||
|
|
||||||
|
} // CcShowScheduleQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_smemb' 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 CcSmemb extends BaseCcSmemb {
|
||||||
|
|
||||||
|
} // CcSmemb
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_smemb' 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 CcSmembPeer extends BaseCcSmembPeer {
|
||||||
|
|
||||||
|
} // CcSmembPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_smemb' 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 CcSmembQuery extends BaseCcSmembQuery {
|
||||||
|
|
||||||
|
} // CcSmembQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_subjs' 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 CcSubjs extends BaseCcSubjs {
|
||||||
|
|
||||||
|
} // CcSubjs
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_subjs' 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 CcSubjsPeer extends BaseCcSubjsPeer {
|
||||||
|
|
||||||
|
} // CcSubjsPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_subjs' 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 CcSubjsQuery extends BaseCcSubjsQuery {
|
||||||
|
|
||||||
|
} // CcSubjsQuery
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for representing a row from the 'cc_trans' 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 CcTrans extends BaseCcTrans {
|
||||||
|
|
||||||
|
} // CcTrans
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_trans' 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 CcTransPeer extends BaseCcTransPeer {
|
||||||
|
|
||||||
|
} // CcTransPeer
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skeleton subclass for performing query and update operations on the 'cc_trans' 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 CcTransQuery extends BaseCcTransQuery {
|
||||||
|
|
||||||
|
} // CcTransQuery
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Common {
|
||||||
|
|
||||||
|
public static function setTimeInSub($row, $col, $time)
|
||||||
|
{
|
||||||
|
$class = get_class($row).'Peer';
|
||||||
|
|
||||||
|
$con = Propel::getConnection($class::DATABASE_NAME);
|
||||||
|
|
||||||
|
$sql = 'UPDATE '.$class::TABLE_NAME
|
||||||
|
. ' SET '.$col.' = :f1'
|
||||||
|
. ' WHERE ' .$class::ID. ' = :p1';
|
||||||
|
$stmt = $con->prepare($sql);
|
||||||
|
$stmt->bindValue(':f1', $time);
|
||||||
|
$stmt->bindValue(':p1', $row->getDbId());
|
||||||
|
$stmt->execute();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_access' 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 CcAccessTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcAccessTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_access');
|
||||||
|
$this->setPhpName('CcAccess');
|
||||||
|
$this->setClassname('CcAccess');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_access_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('GUNID', 'Gunid', 'CHAR', false, 32, null);
|
||||||
|
$this->addColumn('TOKEN', 'Token', 'BIGINT', false, null, null);
|
||||||
|
$this->addColumn('CHSUM', 'Chsum', 'CHAR', true, 32, '');
|
||||||
|
$this->addColumn('EXT', 'Ext', 'VARCHAR', true, 128, '');
|
||||||
|
$this->addColumn('TYPE', 'Type', 'VARCHAR', true, 20, '');
|
||||||
|
$this->addColumn('PARENT', 'Parent', 'BIGINT', false, null, null);
|
||||||
|
$this->addForeignKey('OWNER', 'Owner', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), null, null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcAccessTableMap
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_backup' 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 CcBackupTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcBackupTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_backup');
|
||||||
|
$this->setPhpName('CcBackup');
|
||||||
|
$this->setClassname('CcBackup');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(false);
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('TOKEN', 'Token', 'VARCHAR', true, 64, null);
|
||||||
|
$this->addColumn('SESSIONID', 'Sessionid', 'VARCHAR', true, 64, null);
|
||||||
|
$this->addColumn('STATUS', 'Status', 'VARCHAR', true, 32, null);
|
||||||
|
$this->addColumn('FROMTIME', 'Fromtime', 'TIMESTAMP', true, null, null);
|
||||||
|
$this->addColumn('TOTIME', 'Totime', 'TIMESTAMP', true, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcBackupTableMap
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_country' 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 CcCountryTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcCountryTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_country');
|
||||||
|
$this->setPhpName('CcCountry');
|
||||||
|
$this->setClassname('CcCountry');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(false);
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ISOCODE', 'DbIsoCode', 'CHAR', true, 3, null);
|
||||||
|
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcCountryTableMap
|
|
@ -0,0 +1,111 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_files' 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 CcFilesTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcFilesTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_files');
|
||||||
|
$this->setPhpName('CcFiles');
|
||||||
|
$this->setClassname('CcFiles');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_files_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('GUNID', 'DbGunid', 'CHAR', true, 32, null);
|
||||||
|
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('MIME', 'DbMime', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('FTYPE', 'DbFtype', 'VARCHAR', true, 128, '');
|
||||||
|
$this->addForeignKey('DIRECTORY', 'DbDirectory', 'INTEGER', 'cc_music_dirs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('FILEPATH', 'DbFilepath', 'LONGVARCHAR', false, null, '');
|
||||||
|
$this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty');
|
||||||
|
$this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
|
||||||
|
$this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||||
|
$this->addColumn('MD5', 'DbMd5', 'CHAR', false, 32, null);
|
||||||
|
$this->addColumn('TRACK_TITLE', 'DbTrackTitle', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('ARTIST_NAME', 'DbArtistName', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('BIT_RATE', 'DbBitRate', 'VARCHAR', false, 32, null);
|
||||||
|
$this->addColumn('SAMPLE_RATE', 'DbSampleRate', 'VARCHAR', false, 32, null);
|
||||||
|
$this->addColumn('FORMAT', 'DbFormat', 'VARCHAR', false, 128, null);
|
||||||
|
$this->addColumn('LENGTH', 'DbLength', 'TIME', false, null, null);
|
||||||
|
$this->addColumn('ALBUM_TITLE', 'DbAlbumTitle', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 64, null);
|
||||||
|
$this->addColumn('COMMENTS', 'DbComments', 'LONGVARCHAR', false, null, null);
|
||||||
|
$this->addColumn('YEAR', 'DbYear', 'VARCHAR', false, 16, null);
|
||||||
|
$this->addColumn('TRACK_NUMBER', 'DbTrackNumber', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('CHANNELS', 'DbChannels', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 1024, null);
|
||||||
|
$this->addColumn('BPM', 'DbBpm', 'VARCHAR', false, 8, null);
|
||||||
|
$this->addColumn('RATING', 'DbRating', 'VARCHAR', false, 8, null);
|
||||||
|
$this->addColumn('ENCODED_BY', 'DbEncodedBy', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('DISC_NUMBER', 'DbDiscNumber', 'VARCHAR', false, 8, null);
|
||||||
|
$this->addColumn('MOOD', 'DbMood', 'VARCHAR', false, 64, null);
|
||||||
|
$this->addColumn('LABEL', 'DbLabel', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('COMPOSER', 'DbComposer', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('ENCODER', 'DbEncoder', 'VARCHAR', false, 64, null);
|
||||||
|
$this->addColumn('CHECKSUM', 'DbChecksum', 'VARCHAR', false, 256, null);
|
||||||
|
$this->addColumn('LYRICS', 'DbLyrics', 'LONGVARCHAR', false, null, null);
|
||||||
|
$this->addColumn('ORCHESTRA', 'DbOrchestra', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('CONDUCTOR', 'DbConductor', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('LYRICIST', 'DbLyricist', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('ORIGINAL_LYRICIST', 'DbOriginalLyricist', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('RADIO_STATION_NAME', 'DbRadioStationName', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('INFO_URL', 'DbInfoUrl', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('ARTIST_URL', 'DbArtistUrl', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('AUDIO_SOURCE_URL', 'DbAudioSourceUrl', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('RADIO_STATION_URL', 'DbRadioStationUrl', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('BUY_THIS_URL', 'DbBuyThisUrl', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('ISRC_NUMBER', 'DbIsrcNumber', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('CATALOG_NUMBER', 'DbCatalogNumber', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('ORIGINAL_ARTIST', 'DbOriginalArtist', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('COPYRIGHT', 'DbCopyright', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('REPORT_DATETIME', 'DbReportDatetime', 'VARCHAR', false, 32, null);
|
||||||
|
$this->addColumn('REPORT_LOCATION', 'DbReportLocation', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('REPORT_ORGANIZATION', 'DbReportOrganization', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('SUBJECT', 'DbSubject', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('CONTRIBUTOR', 'DbContributor', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('LANGUAGE', 'DbLanguage', 'VARCHAR', false, 512, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null);
|
||||||
|
$this->addRelation('CcMusicDirs', 'CcMusicDirs', RelationMap::MANY_TO_ONE, array('directory' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcFilesTableMap
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_music_dirs' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This map class is used by Propel to do runtime db structure discovery.
|
||||||
|
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||||
|
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||||
|
* (i.e. if it's a text column type).
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.map
|
||||||
|
*/
|
||||||
|
class CcMusicDirsTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcMusicDirsTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the table attributes, columns and validators
|
||||||
|
* Relations are not initialized by this method since they are lazy loaded
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws PropelException
|
||||||
|
*/
|
||||||
|
public function initialize()
|
||||||
|
{
|
||||||
|
// attributes
|
||||||
|
$this->setName('cc_music_dirs');
|
||||||
|
$this->setPhpName('CcMusicDirs');
|
||||||
|
$this->setClassname('CcMusicDirs');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_music_dirs_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('DIRECTORY', 'Directory', 'LONGVARCHAR', false, null, null);
|
||||||
|
$this->addColumn('TYPE', 'Type', 'VARCHAR', false, 255, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'directory', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcMusicDirsTableMap
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_perms' 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 CcPermsTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcPermsTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_perms');
|
||||||
|
$this->setPhpName('CcPerms');
|
||||||
|
$this->setClassname('CcPerms');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(false);
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('PERMID', 'Permid', 'INTEGER', true, null, null);
|
||||||
|
$this->addForeignKey('SUBJ', 'Subj', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('ACTION', 'Action', 'VARCHAR', false, 20, null);
|
||||||
|
$this->addColumn('OBJ', 'Obj', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('TYPE', 'Type', 'CHAR', false, 1, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subj' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcPermsTableMap
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_playlist' 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 CcPlaylistTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcPlaylistTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_playlist');
|
||||||
|
$this->setPhpName('CcPlaylist');
|
||||||
|
$this->setClassname('CcPlaylist');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_playlist_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty');
|
||||||
|
$this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0);
|
||||||
|
$this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||||
|
$this->addColumn('CREATOR', 'DbCreator', 'VARCHAR', false, 32, null);
|
||||||
|
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null);
|
||||||
|
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcPlaylistTableMap
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_playlistcontents' 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 CcPlaylistcontentsTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcPlaylistcontentsTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_playlistcontents');
|
||||||
|
$this->setPhpName('CcPlaylistcontents');
|
||||||
|
$this->setClassname('CcPlaylistcontents');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_playlistcontents_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null);
|
||||||
|
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||||
|
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('CLIPLENGTH', 'DbCliplength', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('CUEIN', 'DbCuein', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('CUEOUT', 'DbCueout', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('FADEIN', 'DbFadein', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('FADEOUT', 'DbFadeout', 'TIME', false, null, '00:00:00');
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcPlaylistcontentsTableMap
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_pref' 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 CcPrefTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcPrefTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_pref');
|
||||||
|
$this->setPhpName('CcPref');
|
||||||
|
$this->setClassname('CcPref');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_pref_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||||
|
$this->addForeignKey('SUBJID', 'Subjid', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('KEYSTR', 'Keystr', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('VALSTR', 'Valstr', 'LONGVARCHAR', false, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subjid' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcPrefTableMap
|
|
@ -0,0 +1,80 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_schedule' 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 CcScheduleTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcScheduleTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_schedule');
|
||||||
|
$this->setPhpName('CcSchedule');
|
||||||
|
$this->setClassname('CcSchedule');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_schedule_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null);
|
||||||
|
$this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null);
|
||||||
|
$this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', false, null, null);
|
||||||
|
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||||
|
$this->addColumn('CLIP_LENGTH', 'DbClipLength', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('FADE_IN', 'DbFadeIn', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('FADE_OUT', 'DbFadeOut', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('CUE_IN', 'DbCueIn', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('CUE_OUT', 'DbCueOut', 'TIME', false, null, '00:00:00');
|
||||||
|
$this->addColumn('SCHEDULE_GROUP_PLAYED', 'DbScheduleGroupPlayed', 'BOOLEAN', false, null, false);
|
||||||
|
$this->addColumn('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false);
|
||||||
|
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Gets the list of behaviors registered for this table
|
||||||
|
*
|
||||||
|
* @return array Associative array (name => parameters) of behaviors
|
||||||
|
*/
|
||||||
|
public function getBehaviors()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'aggregate_column_relation' => array('foreign_table' => 'cc_show_instances', 'update_method' => 'updateDbTimeFilled', ),
|
||||||
|
);
|
||||||
|
} // getBehaviors()
|
||||||
|
|
||||||
|
} // CcScheduleTableMap
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_sess' 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 CcSessTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcSessTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_sess');
|
||||||
|
$this->setPhpName('CcSess');
|
||||||
|
$this->setClassname('CcSess');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(false);
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('SESSID', 'Sessid', 'CHAR', true, 32, null);
|
||||||
|
$this->addForeignKey('USERID', 'Userid', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||||
|
$this->addColumn('LOGIN', 'Login', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('userid' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcSessTableMap
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_show_days' 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 CcShowDaysTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcShowDaysTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_show_days');
|
||||||
|
$this->setPhpName('CcShowDays');
|
||||||
|
$this->setClassname('CcShowDays');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_show_days_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('FIRST_SHOW', 'DbFirstShow', 'DATE', true, null, null);
|
||||||
|
$this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null);
|
||||||
|
$this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null);
|
||||||
|
$this->addColumn('DURATION', 'DbDuration', 'VARCHAR', true, 255, null);
|
||||||
|
$this->addColumn('DAY', 'DbDay', 'TINYINT', false, null, null);
|
||||||
|
$this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null);
|
||||||
|
$this->addColumn('NEXT_POP_DATE', 'DbNextPopDate', 'DATE', false, null, null);
|
||||||
|
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
|
||||||
|
$this->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcShowDaysTableMap
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_show_hosts' 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 CcShowHostsTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcShowHostsTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_show_hosts');
|
||||||
|
$this->setPhpName('CcShowHosts');
|
||||||
|
$this->setClassname('CcShowHosts');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_show_hosts_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addForeignKey('SHOW_ID', 'DbShow', 'INTEGER', 'cc_show', 'ID', true, null, null);
|
||||||
|
$this->addForeignKey('SUBJS_ID', 'DbHost', 'INTEGER', 'cc_subjs', 'ID', true, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subjs_id' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcShowHostsTableMap
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_show_instances' 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 CcShowInstancesTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcShowInstancesTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_show_instances');
|
||||||
|
$this->setPhpName('CcShowInstances');
|
||||||
|
$this->setClassname('CcShowInstances');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_show_instances_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null);
|
||||||
|
$this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null);
|
||||||
|
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
|
||||||
|
$this->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0);
|
||||||
|
$this->addColumn('REBROADCAST', 'DbRebroadcast', 'TINYINT', false, null, 0);
|
||||||
|
$this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null);
|
||||||
|
$this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||||
|
$this->addColumn('SOUNDCLOUD_ID', 'DbSoundCloudId', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowInstancesRelatedByDbOriginalShow', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowInstancesRelatedByDbId', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Gets the list of behaviors registered for this table
|
||||||
|
*
|
||||||
|
* @return array Associative array (name => parameters) of behaviors
|
||||||
|
*/
|
||||||
|
public function getBehaviors()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'aggregate_column' => array('name' => 'time_filled', 'expression' => 'SUM(clip_length)', 'foreign_table' => 'cc_schedule', ),
|
||||||
|
);
|
||||||
|
} // getBehaviors()
|
||||||
|
|
||||||
|
} // CcShowInstancesTableMap
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_show_rebroadcast' 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 CcShowRebroadcastTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcShowRebroadcastTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_show_rebroadcast');
|
||||||
|
$this->setPhpName('CcShowRebroadcast');
|
||||||
|
$this->setClassname('CcShowRebroadcast');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_show_rebroadcast_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('DAY_OFFSET', 'DbDayOffset', 'VARCHAR', true, 255, null);
|
||||||
|
$this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null);
|
||||||
|
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcShowRebroadcastTableMap
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_show_schedule' 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 CcShowScheduleTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcShowScheduleTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_show_schedule');
|
||||||
|
$this->setPhpName('CcShowSchedule');
|
||||||
|
$this->setClassname('CcShowSchedule');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_show_schedule_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null);
|
||||||
|
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', true, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcShowScheduleTableMap
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_show' 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 CcShowTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcShowTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_show');
|
||||||
|
$this->setPhpName('CcShow');
|
||||||
|
$this->setClassname('CcShow');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_show_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 255, '');
|
||||||
|
$this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 255, '');
|
||||||
|
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
||||||
|
$this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null);
|
||||||
|
$this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowDays', 'CcShowDays', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowRebroadcast', 'CcShowRebroadcast', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcShowTableMap
|
|
@ -0,0 +1,55 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_smemb' 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 CcSmembTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcSmembTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_smemb');
|
||||||
|
$this->setPhpName('CcSmemb');
|
||||||
|
$this->setClassname('CcSmemb');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(false);
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('UID', 'Uid', 'INTEGER', true, null, 0);
|
||||||
|
$this->addColumn('GID', 'Gid', 'INTEGER', true, null, 0);
|
||||||
|
$this->addColumn('LEVEL', 'Level', 'INTEGER', true, null, 0);
|
||||||
|
$this->addColumn('MID', 'Mid', 'INTEGER', false, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcSmembTableMap
|
|
@ -0,0 +1,69 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_subjs' 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 CcSubjsTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcSubjsTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_subjs');
|
||||||
|
$this->setPhpName('CcSubjs');
|
||||||
|
$this->setClassname('CcSubjs');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_subjs_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('LOGIN', 'DbLogin', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('PASS', 'DbPass', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('TYPE', 'DbType', 'CHAR', true, 1, 'U');
|
||||||
|
$this->addColumn('FIRST_NAME', 'DbFirstName', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('LAST_NAME', 'DbLastName', 'VARCHAR', true, 255, '');
|
||||||
|
$this->addColumn('LASTLOGIN', 'DbLastlogin', 'TIMESTAMP', false, null, null);
|
||||||
|
$this->addColumn('LASTFAIL', 'DbLastfail', 'TIMESTAMP', false, null, null);
|
||||||
|
$this->addColumn('SKYPE_CONTACT', 'DbSkypeContact', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('JABBER_CONTACT', 'DbJabberContact', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('EMAIL', 'DbEmail', 'VARCHAR', false, 255, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
$this->addRelation('CcAccess', 'CcAccess', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), null, null);
|
||||||
|
$this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null);
|
||||||
|
$this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null);
|
||||||
|
$this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null);
|
||||||
|
$this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null);
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcSubjsTableMap
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class defines the structure of the 'cc_trans' 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 CcTransTableMap extends TableMap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The (dot-path) name of this class
|
||||||
|
*/
|
||||||
|
const CLASS_NAME = 'airtime.map.CcTransTableMap';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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_trans');
|
||||||
|
$this->setPhpName('CcTrans');
|
||||||
|
$this->setClassname('CcTrans');
|
||||||
|
$this->setPackage('airtime');
|
||||||
|
$this->setUseIdGenerator(true);
|
||||||
|
$this->setPrimaryKeyMethodInfo('cc_trans_id_seq');
|
||||||
|
// columns
|
||||||
|
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||||
|
$this->addColumn('TRTOK', 'Trtok', 'CHAR', true, 16, null);
|
||||||
|
$this->addColumn('DIRECTION', 'Direction', 'VARCHAR', true, 128, null);
|
||||||
|
$this->addColumn('STATE', 'State', 'VARCHAR', true, 128, null);
|
||||||
|
$this->addColumn('TRTYPE', 'Trtype', 'VARCHAR', true, 128, null);
|
||||||
|
$this->addColumn('LOCK', 'Lock', 'CHAR', true, 1, 'N');
|
||||||
|
$this->addColumn('TARGET', 'Target', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('RTRTOK', 'Rtrtok', 'CHAR', false, 16, null);
|
||||||
|
$this->addColumn('MDTRTOK', 'Mdtrtok', 'CHAR', false, 16, null);
|
||||||
|
$this->addColumn('GUNID', 'Gunid', 'CHAR', false, 32, null);
|
||||||
|
$this->addColumn('PDTOKEN', 'Pdtoken', 'BIGINT', false, null, null);
|
||||||
|
$this->addColumn('URL', 'Url', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('LOCALFILE', 'Localfile', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('FNAME', 'Fname', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('EXPECTEDSUM', 'Expectedsum', 'CHAR', false, 32, null);
|
||||||
|
$this->addColumn('REALSUM', 'Realsum', 'CHAR', false, 32, null);
|
||||||
|
$this->addColumn('EXPECTEDSIZE', 'Expectedsize', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('REALSIZE', 'Realsize', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('UID', 'Uid', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('ERRMSG', 'Errmsg', 'VARCHAR', false, 255, null);
|
||||||
|
$this->addColumn('JOBPID', 'Jobpid', 'INTEGER', false, null, null);
|
||||||
|
$this->addColumn('START', 'Start', 'TIMESTAMP', false, null, null);
|
||||||
|
$this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null);
|
||||||
|
// validators
|
||||||
|
} // initialize()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the RelationMap objects for this table relationships
|
||||||
|
*/
|
||||||
|
public function buildRelations()
|
||||||
|
{
|
||||||
|
} // buildRelations()
|
||||||
|
|
||||||
|
} // CcTransTableMap
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,477 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a query for the 'cc_access' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @method CcAccessQuery orderById($order = Criteria::ASC) Order by the id column
|
||||||
|
* @method CcAccessQuery orderByGunid($order = Criteria::ASC) Order by the gunid column
|
||||||
|
* @method CcAccessQuery orderByToken($order = Criteria::ASC) Order by the token column
|
||||||
|
* @method CcAccessQuery orderByChsum($order = Criteria::ASC) Order by the chsum column
|
||||||
|
* @method CcAccessQuery orderByExt($order = Criteria::ASC) Order by the ext column
|
||||||
|
* @method CcAccessQuery orderByType($order = Criteria::ASC) Order by the type column
|
||||||
|
* @method CcAccessQuery orderByParent($order = Criteria::ASC) Order by the parent column
|
||||||
|
* @method CcAccessQuery orderByOwner($order = Criteria::ASC) Order by the owner column
|
||||||
|
* @method CcAccessQuery orderByTs($order = Criteria::ASC) Order by the ts column
|
||||||
|
*
|
||||||
|
* @method CcAccessQuery groupById() Group by the id column
|
||||||
|
* @method CcAccessQuery groupByGunid() Group by the gunid column
|
||||||
|
* @method CcAccessQuery groupByToken() Group by the token column
|
||||||
|
* @method CcAccessQuery groupByChsum() Group by the chsum column
|
||||||
|
* @method CcAccessQuery groupByExt() Group by the ext column
|
||||||
|
* @method CcAccessQuery groupByType() Group by the type column
|
||||||
|
* @method CcAccessQuery groupByParent() Group by the parent column
|
||||||
|
* @method CcAccessQuery groupByOwner() Group by the owner column
|
||||||
|
* @method CcAccessQuery groupByTs() Group by the ts column
|
||||||
|
*
|
||||||
|
* @method CcAccessQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
|
* @method CcAccessQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
* @method CcAccessQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||||
|
*
|
||||||
|
* @method CcAccessQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
|
||||||
|
* @method CcAccessQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
|
||||||
|
* @method CcAccessQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
|
||||||
|
*
|
||||||
|
* @method CcAccess findOne(PropelPDO $con = null) Return the first CcAccess matching the query
|
||||||
|
* @method CcAccess findOneOrCreate(PropelPDO $con = null) Return the first CcAccess matching the query, or a new CcAccess object populated from the query conditions when no match is found
|
||||||
|
*
|
||||||
|
* @method CcAccess findOneById(int $id) Return the first CcAccess filtered by the id column
|
||||||
|
* @method CcAccess findOneByGunid(string $gunid) Return the first CcAccess filtered by the gunid column
|
||||||
|
* @method CcAccess findOneByToken(string $token) Return the first CcAccess filtered by the token column
|
||||||
|
* @method CcAccess findOneByChsum(string $chsum) Return the first CcAccess filtered by the chsum column
|
||||||
|
* @method CcAccess findOneByExt(string $ext) Return the first CcAccess filtered by the ext column
|
||||||
|
* @method CcAccess findOneByType(string $type) Return the first CcAccess filtered by the type column
|
||||||
|
* @method CcAccess findOneByParent(string $parent) Return the first CcAccess filtered by the parent column
|
||||||
|
* @method CcAccess findOneByOwner(int $owner) Return the first CcAccess filtered by the owner column
|
||||||
|
* @method CcAccess findOneByTs(string $ts) Return the first CcAccess filtered by the ts column
|
||||||
|
*
|
||||||
|
* @method array findById(int $id) Return CcAccess objects filtered by the id column
|
||||||
|
* @method array findByGunid(string $gunid) Return CcAccess objects filtered by the gunid column
|
||||||
|
* @method array findByToken(string $token) Return CcAccess objects filtered by the token column
|
||||||
|
* @method array findByChsum(string $chsum) Return CcAccess objects filtered by the chsum column
|
||||||
|
* @method array findByExt(string $ext) Return CcAccess objects filtered by the ext column
|
||||||
|
* @method array findByType(string $type) Return CcAccess objects filtered by the type column
|
||||||
|
* @method array findByParent(string $parent) Return CcAccess objects filtered by the parent column
|
||||||
|
* @method array findByOwner(int $owner) Return CcAccess objects filtered by the owner column
|
||||||
|
* @method array findByTs(string $ts) Return CcAccess objects filtered by the ts column
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcAccessQuery extends ModelCriteria
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes internal state of BaseCcAccessQuery 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 = 'CcAccess', $modelAlias = null)
|
||||||
|
{
|
||||||
|
parent::__construct($dbName, $modelName, $modelAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new CcAccessQuery object.
|
||||||
|
*
|
||||||
|
* @param string $modelAlias The alias of a model in the query
|
||||||
|
* @param Criteria $criteria Optional Criteria to build the query from
|
||||||
|
*
|
||||||
|
* @return CcAccessQuery
|
||||||
|
*/
|
||||||
|
public static function create($modelAlias = null, $criteria = null)
|
||||||
|
{
|
||||||
|
if ($criteria instanceof CcAccessQuery) {
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
$query = new CcAccessQuery();
|
||||||
|
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 CcAccess|array|mixed the result, formatted by the current formatter
|
||||||
|
*/
|
||||||
|
public function findPk($key, $con = null)
|
||||||
|
{
|
||||||
|
if ((null !== ($obj = CcAccessPeer::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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKey($key)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKeys($keys)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::ID, $keys, Criteria::IN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the id column
|
||||||
|
*
|
||||||
|
* @param int|array $id The value to use as filter.
|
||||||
|
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterById($id = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($id) && null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::ID, $id, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the gunid column
|
||||||
|
*
|
||||||
|
* @param string $gunid 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByGunid($gunid = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($gunid)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $gunid)) {
|
||||||
|
$gunid = str_replace('*', '%', $gunid);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::GUNID, $gunid, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the token column
|
||||||
|
*
|
||||||
|
* @param string|array $token 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByToken($token = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($token)) {
|
||||||
|
$useMinMax = false;
|
||||||
|
if (isset($token['min'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::TOKEN, $token['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($token['max'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::TOKEN, $token['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::TOKEN, $token, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the chsum column
|
||||||
|
*
|
||||||
|
* @param string $chsum 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByChsum($chsum = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($chsum)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $chsum)) {
|
||||||
|
$chsum = str_replace('*', '%', $chsum);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::CHSUM, $chsum, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the ext column
|
||||||
|
*
|
||||||
|
* @param string $ext 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByExt($ext = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($ext)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $ext)) {
|
||||||
|
$ext = str_replace('*', '%', $ext);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::EXT, $ext, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the type column
|
||||||
|
*
|
||||||
|
* @param string $type The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByType($type = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($type)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $type)) {
|
||||||
|
$type = str_replace('*', '%', $type);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::TYPE, $type, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the parent column
|
||||||
|
*
|
||||||
|
* @param string|array $parent 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByParent($parent = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($parent)) {
|
||||||
|
$useMinMax = false;
|
||||||
|
if (isset($parent['min'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::PARENT, $parent['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($parent['max'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::PARENT, $parent['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::PARENT, $parent, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the owner column
|
||||||
|
*
|
||||||
|
* @param int|array $owner 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByOwner($owner = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($owner)) {
|
||||||
|
$useMinMax = false;
|
||||||
|
if (isset($owner['min'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::OWNER, $owner['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($owner['max'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::OWNER, $owner['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::OWNER, $owner, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the ts column
|
||||||
|
*
|
||||||
|
* @param string|array $ts 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 CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByTs($ts = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($ts)) {
|
||||||
|
$useMinMax = false;
|
||||||
|
if (isset($ts['min'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($ts['max'])) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::TS, $ts['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcAccessPeer::TS, $ts, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query by a related CcSubjs object
|
||||||
|
*
|
||||||
|
* @param CcSubjs $ccSubjs the related object to use as filter
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByCcSubjs($ccSubjs, $comparison = null)
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->addUsingAlias(CcAccessPeer::OWNER, $ccSubjs->getDbId(), $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a JOIN clause to the query using the CcSubjs relation
|
||||||
|
*
|
||||||
|
* @param string $relationAlias optional alias for the relation
|
||||||
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||||
|
*
|
||||||
|
* @return CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||||
|
{
|
||||||
|
$tableMap = $this->getTableMap();
|
||||||
|
$relationMap = $tableMap->getRelation('CcSubjs');
|
||||||
|
|
||||||
|
// create a ModelJoin object for this join
|
||||||
|
$join = new ModelJoin();
|
||||||
|
$join->setJoinType($joinType);
|
||||||
|
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
|
||||||
|
if ($previousJoin = $this->getPreviousJoin()) {
|
||||||
|
$join->setPreviousJoin($previousJoin);
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the ModelJoin to the current object
|
||||||
|
if($relationAlias) {
|
||||||
|
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
|
||||||
|
$this->addJoinObject($join, $relationAlias);
|
||||||
|
} else {
|
||||||
|
$this->addJoinObject($join, 'CcSubjs');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use the CcSubjs relation CcSubjs object
|
||||||
|
*
|
||||||
|
* @see useQuery()
|
||||||
|
*
|
||||||
|
* @param string $relationAlias optional alias for the relation,
|
||||||
|
* to be used as main alias in the secondary query
|
||||||
|
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||||
|
*
|
||||||
|
* @return CcSubjsQuery A secondary query class using the current class as primary query
|
||||||
|
*/
|
||||||
|
public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->joinCcSubjs($relationAlias, $joinType)
|
||||||
|
->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exclude object from result
|
||||||
|
*
|
||||||
|
* @param CcAccess $ccAccess Object to remove from the list of results
|
||||||
|
*
|
||||||
|
* @return CcAccessQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function prune($ccAccess = null)
|
||||||
|
{
|
||||||
|
if ($ccAccess) {
|
||||||
|
$this->addUsingAlias(CcAccessPeer::ID, $ccAccess->getId(), Criteria::NOT_EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcAccessQuery
|
|
@ -0,0 +1,956 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a row from the 'cc_backup' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcBackup extends BaseObject implements Persistent
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Peer class name
|
||||||
|
*/
|
||||||
|
const PEER = 'CcBackupPeer';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 CcBackupPeer
|
||||||
|
*/
|
||||||
|
protected static $peer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the token field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $token;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the sessionid field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $sessionid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the status field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the fromtime field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $fromtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the totime field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $totime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 [token] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getToken()
|
||||||
|
{
|
||||||
|
return $this->token;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [sessionid] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSessionid()
|
||||||
|
{
|
||||||
|
return $this->sessionid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [status] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getStatus()
|
||||||
|
{
|
||||||
|
return $this->status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [optionally formatted] temporal [fromtime] column value.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||||
|
* If format is NULL, then the raw DateTime object will be returned.
|
||||||
|
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
||||||
|
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||||
|
*/
|
||||||
|
public function getFromtime($format = 'Y-m-d H:i:s')
|
||||||
|
{
|
||||||
|
if ($this->fromtime === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
$dt = new DateTime($this->fromtime);
|
||||||
|
} catch (Exception $x) {
|
||||||
|
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fromtime, true), $x);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($format === null) {
|
||||||
|
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
|
||||||
|
return $dt;
|
||||||
|
} elseif (strpos($format, '%') !== false) {
|
||||||
|
return strftime($format, $dt->format('U'));
|
||||||
|
} else {
|
||||||
|
return $dt->format($format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [optionally formatted] temporal [totime] column value.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||||
|
* If format is NULL, then the raw DateTime object will be returned.
|
||||||
|
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
|
||||||
|
* @throws PropelException - if unable to parse/validate the date/time value.
|
||||||
|
*/
|
||||||
|
public function getTotime($format = 'Y-m-d H:i:s')
|
||||||
|
{
|
||||||
|
if ($this->totime === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
$dt = new DateTime($this->totime);
|
||||||
|
} catch (Exception $x) {
|
||||||
|
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->totime, true), $x);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($format === null) {
|
||||||
|
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
|
||||||
|
return $dt;
|
||||||
|
} elseif (strpos($format, '%') !== false) {
|
||||||
|
return strftime($format, $dt->format('U'));
|
||||||
|
} else {
|
||||||
|
return $dt->format($format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [token] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcBackup The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setToken($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->token !== $v) {
|
||||||
|
$this->token = $v;
|
||||||
|
$this->modifiedColumns[] = CcBackupPeer::TOKEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setToken()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [sessionid] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcBackup The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setSessionid($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->sessionid !== $v) {
|
||||||
|
$this->sessionid = $v;
|
||||||
|
$this->modifiedColumns[] = CcBackupPeer::SESSIONID;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setSessionid()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [status] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcBackup The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setStatus($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->status !== $v) {
|
||||||
|
$this->status = $v;
|
||||||
|
$this->modifiedColumns[] = CcBackupPeer::STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setStatus()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of [fromtime] column to a normalized version of the date/time value specified.
|
||||||
|
*
|
||||||
|
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
|
||||||
|
* be treated as NULL for temporal objects.
|
||||||
|
* @return CcBackup The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setFromtime($v)
|
||||||
|
{
|
||||||
|
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
|
||||||
|
// -- which is unexpected, to say the least.
|
||||||
|
if ($v === null || $v === '') {
|
||||||
|
$dt = null;
|
||||||
|
} elseif ($v instanceof DateTime) {
|
||||||
|
$dt = $v;
|
||||||
|
} else {
|
||||||
|
// some string/numeric value passed; we normalize that so that we can
|
||||||
|
// validate it.
|
||||||
|
try {
|
||||||
|
if (is_numeric($v)) { // if it's a unix timestamp
|
||||||
|
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
|
||||||
|
// We have to explicitly specify and then change the time zone because of a
|
||||||
|
// DateTime bug: http://bugs.php.net/bug.php?id=43003
|
||||||
|
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||||
|
} else {
|
||||||
|
$dt = new DateTime($v);
|
||||||
|
}
|
||||||
|
} catch (Exception $x) {
|
||||||
|
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $this->fromtime !== null || $dt !== null ) {
|
||||||
|
// (nested ifs are a little easier to read in this case)
|
||||||
|
|
||||||
|
$currNorm = ($this->fromtime !== null && $tmpDt = new DateTime($this->fromtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
|
||||||
|
$newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
|
||||||
|
|
||||||
|
if ( ($currNorm !== $newNorm) // normalized values don't match
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$this->fromtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
|
||||||
|
$this->modifiedColumns[] = CcBackupPeer::FROMTIME;
|
||||||
|
}
|
||||||
|
} // if either are not null
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setFromtime()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of [totime] column to a normalized version of the date/time value specified.
|
||||||
|
*
|
||||||
|
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
|
||||||
|
* be treated as NULL for temporal objects.
|
||||||
|
* @return CcBackup The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setTotime($v)
|
||||||
|
{
|
||||||
|
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
|
||||||
|
// -- which is unexpected, to say the least.
|
||||||
|
if ($v === null || $v === '') {
|
||||||
|
$dt = null;
|
||||||
|
} elseif ($v instanceof DateTime) {
|
||||||
|
$dt = $v;
|
||||||
|
} else {
|
||||||
|
// some string/numeric value passed; we normalize that so that we can
|
||||||
|
// validate it.
|
||||||
|
try {
|
||||||
|
if (is_numeric($v)) { // if it's a unix timestamp
|
||||||
|
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
|
||||||
|
// We have to explicitly specify and then change the time zone because of a
|
||||||
|
// DateTime bug: http://bugs.php.net/bug.php?id=43003
|
||||||
|
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
|
||||||
|
} else {
|
||||||
|
$dt = new DateTime($v);
|
||||||
|
}
|
||||||
|
} catch (Exception $x) {
|
||||||
|
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $this->totime !== null || $dt !== null ) {
|
||||||
|
// (nested ifs are a little easier to read in this case)
|
||||||
|
|
||||||
|
$currNorm = ($this->totime !== null && $tmpDt = new DateTime($this->totime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null;
|
||||||
|
$newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null;
|
||||||
|
|
||||||
|
if ( ($currNorm !== $newNorm) // normalized values don't match
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$this->totime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
|
||||||
|
$this->modifiedColumns[] = CcBackupPeer::TOTIME;
|
||||||
|
}
|
||||||
|
} // if either are not null
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setTotime()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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->token = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
|
||||||
|
$this->sessionid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
||||||
|
$this->status = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
|
||||||
|
$this->fromtime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
|
||||||
|
$this->totime = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
|
||||||
|
$this->resetModified();
|
||||||
|
|
||||||
|
$this->setNew(false);
|
||||||
|
|
||||||
|
if ($rehydrate) {
|
||||||
|
$this->ensureConsistency();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $startcol + 5; // 5 = CcBackupPeer::NUM_COLUMNS - CcBackupPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
throw new PropelException("Error populating CcBackup 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(CcBackupPeer::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 = CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$con->beginTransaction();
|
||||||
|
try {
|
||||||
|
$ret = $this->preDelete($con);
|
||||||
|
if ($ret) {
|
||||||
|
CcBackupQuery::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(CcBackupPeer::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);
|
||||||
|
CcBackupPeer::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 object has been modified, then save it to the database.
|
||||||
|
if ($this->isModified()) {
|
||||||
|
if ($this->isNew()) {
|
||||||
|
$criteria = $this->buildCriteria();
|
||||||
|
$pk = BasePeer::doInsert($criteria, $con);
|
||||||
|
$affectedRows = 1;
|
||||||
|
$this->setNew(false);
|
||||||
|
} else {
|
||||||
|
$affectedRows = CcBackupPeer::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 = CcBackupPeer::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 = CcBackupPeer::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->getToken();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return $this->getSessionid();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return $this->getStatus();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return $this->getFromtime();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
return $this->getTotime();
|
||||||
|
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 = CcBackupPeer::getFieldNames($keyType);
|
||||||
|
$result = array(
|
||||||
|
$keys[0] => $this->getToken(),
|
||||||
|
$keys[1] => $this->getSessionid(),
|
||||||
|
$keys[2] => $this->getStatus(),
|
||||||
|
$keys[3] => $this->getFromtime(),
|
||||||
|
$keys[4] => $this->getTotime(),
|
||||||
|
);
|
||||||
|
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 = CcBackupPeer::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->setToken($value);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$this->setSessionid($value);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$this->setStatus($value);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$this->setFromtime($value);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$this->setTotime($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 = CcBackupPeer::getFieldNames($keyType);
|
||||||
|
|
||||||
|
if (array_key_exists($keys[0], $arr)) $this->setToken($arr[$keys[0]]);
|
||||||
|
if (array_key_exists($keys[1], $arr)) $this->setSessionid($arr[$keys[1]]);
|
||||||
|
if (array_key_exists($keys[2], $arr)) $this->setStatus($arr[$keys[2]]);
|
||||||
|
if (array_key_exists($keys[3], $arr)) $this->setFromtime($arr[$keys[3]]);
|
||||||
|
if (array_key_exists($keys[4], $arr)) $this->setTotime($arr[$keys[4]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(CcBackupPeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($this->isColumnModified(CcBackupPeer::TOKEN)) $criteria->add(CcBackupPeer::TOKEN, $this->token);
|
||||||
|
if ($this->isColumnModified(CcBackupPeer::SESSIONID)) $criteria->add(CcBackupPeer::SESSIONID, $this->sessionid);
|
||||||
|
if ($this->isColumnModified(CcBackupPeer::STATUS)) $criteria->add(CcBackupPeer::STATUS, $this->status);
|
||||||
|
if ($this->isColumnModified(CcBackupPeer::FROMTIME)) $criteria->add(CcBackupPeer::FROMTIME, $this->fromtime);
|
||||||
|
if ($this->isColumnModified(CcBackupPeer::TOTIME)) $criteria->add(CcBackupPeer::TOTIME, $this->totime);
|
||||||
|
|
||||||
|
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(CcBackupPeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcBackupPeer::TOKEN, $this->token);
|
||||||
|
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primary key for this object (row).
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getPrimaryKey()
|
||||||
|
{
|
||||||
|
return $this->getToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic method to set the primary key (token column).
|
||||||
|
*
|
||||||
|
* @param string $key Primary key.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPrimaryKey($key)
|
||||||
|
{
|
||||||
|
$this->setToken($key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the primary key for this object is null.
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isPrimaryKeyNull()
|
||||||
|
{
|
||||||
|
return null === $this->getToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 CcBackup (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->setToken($this->token);
|
||||||
|
$copyObj->setSessionid($this->sessionid);
|
||||||
|
$copyObj->setStatus($this->status);
|
||||||
|
$copyObj->setFromtime($this->fromtime);
|
||||||
|
$copyObj->setTotime($this->totime);
|
||||||
|
|
||||||
|
$copyObj->setNew(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 CcBackup 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 CcBackupPeer
|
||||||
|
*/
|
||||||
|
public function getPeer()
|
||||||
|
{
|
||||||
|
if (self::$peer === null) {
|
||||||
|
self::$peer = new CcBackupPeer();
|
||||||
|
}
|
||||||
|
return self::$peer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the current object and sets all attributes to their default values
|
||||||
|
*/
|
||||||
|
public function clear()
|
||||||
|
{
|
||||||
|
$this->token = null;
|
||||||
|
$this->sessionid = null;
|
||||||
|
$this->status = null;
|
||||||
|
$this->fromtime = null;
|
||||||
|
$this->totime = 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcBackup
|
|
@ -0,0 +1,750 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base static class for performing query and update operations on the 'cc_backup' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcBackupPeer {
|
||||||
|
|
||||||
|
/** the default database name for this class */
|
||||||
|
const DATABASE_NAME = 'airtime';
|
||||||
|
|
||||||
|
/** the table name for this class */
|
||||||
|
const TABLE_NAME = 'cc_backup';
|
||||||
|
|
||||||
|
/** the related Propel class for this table */
|
||||||
|
const OM_CLASS = 'CcBackup';
|
||||||
|
|
||||||
|
/** A class that can be returned by this peer. */
|
||||||
|
const CLASS_DEFAULT = 'airtime.CcBackup';
|
||||||
|
|
||||||
|
/** the related TableMap class for this table */
|
||||||
|
const TM_CLASS = 'CcBackupTableMap';
|
||||||
|
|
||||||
|
/** The total number of columns. */
|
||||||
|
const NUM_COLUMNS = 5;
|
||||||
|
|
||||||
|
/** The number of lazy-loaded columns. */
|
||||||
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
|
||||||
|
/** the column name for the TOKEN field */
|
||||||
|
const TOKEN = 'cc_backup.TOKEN';
|
||||||
|
|
||||||
|
/** the column name for the SESSIONID field */
|
||||||
|
const SESSIONID = 'cc_backup.SESSIONID';
|
||||||
|
|
||||||
|
/** the column name for the STATUS field */
|
||||||
|
const STATUS = 'cc_backup.STATUS';
|
||||||
|
|
||||||
|
/** the column name for the FROMTIME field */
|
||||||
|
const FROMTIME = 'cc_backup.FROMTIME';
|
||||||
|
|
||||||
|
/** the column name for the TOTIME field */
|
||||||
|
const TOTIME = 'cc_backup.TOTIME';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An identiy map to hold any loaded instances of CcBackup objects.
|
||||||
|
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||||
|
* queries.
|
||||||
|
* @var array CcBackup[]
|
||||||
|
*/
|
||||||
|
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 ('Token', 'Sessionid', 'Status', 'Fromtime', 'Totime', ),
|
||||||
|
BasePeer::TYPE_STUDLYPHPNAME => array ('token', 'sessionid', 'status', 'fromtime', 'totime', ),
|
||||||
|
BasePeer::TYPE_COLNAME => array (self::TOKEN, self::SESSIONID, self::STATUS, self::FROMTIME, self::TOTIME, ),
|
||||||
|
BasePeer::TYPE_RAW_COLNAME => array ('TOKEN', 'SESSIONID', 'STATUS', 'FROMTIME', 'TOTIME', ),
|
||||||
|
BasePeer::TYPE_FIELDNAME => array ('token', 'sessionid', 'status', 'fromtime', 'totime', ),
|
||||||
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 ('Token' => 0, 'Sessionid' => 1, 'Status' => 2, 'Fromtime' => 3, 'Totime' => 4, ),
|
||||||
|
BasePeer::TYPE_STUDLYPHPNAME => array ('token' => 0, 'sessionid' => 1, 'status' => 2, 'fromtime' => 3, 'totime' => 4, ),
|
||||||
|
BasePeer::TYPE_COLNAME => array (self::TOKEN => 0, self::SESSIONID => 1, self::STATUS => 2, self::FROMTIME => 3, self::TOTIME => 4, ),
|
||||||
|
BasePeer::TYPE_RAW_COLNAME => array ('TOKEN' => 0, 'SESSIONID' => 1, 'STATUS' => 2, 'FROMTIME' => 3, 'TOTIME' => 4, ),
|
||||||
|
BasePeer::TYPE_FIELDNAME => array ('token' => 0, 'sessionid' => 1, 'status' => 2, 'fromtime' => 3, 'totime' => 4, ),
|
||||||
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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. CcBackupPeer::COLUMN_NAME).
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function alias($alias, $column)
|
||||||
|
{
|
||||||
|
return str_replace(CcBackupPeer::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(CcBackupPeer::TOKEN);
|
||||||
|
$criteria->addSelectColumn(CcBackupPeer::SESSIONID);
|
||||||
|
$criteria->addSelectColumn(CcBackupPeer::STATUS);
|
||||||
|
$criteria->addSelectColumn(CcBackupPeer::FROMTIME);
|
||||||
|
$criteria->addSelectColumn(CcBackupPeer::TOTIME);
|
||||||
|
} else {
|
||||||
|
$criteria->addSelectColumn($alias . '.TOKEN');
|
||||||
|
$criteria->addSelectColumn($alias . '.SESSIONID');
|
||||||
|
$criteria->addSelectColumn($alias . '.STATUS');
|
||||||
|
$criteria->addSelectColumn($alias . '.FROMTIME');
|
||||||
|
$criteria->addSelectColumn($alias . '.TOTIME');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(CcBackupPeer::TABLE_NAME);
|
||||||
|
|
||||||
|
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||||
|
$criteria->setDistinct();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$criteria->hasSelectClause()) {
|
||||||
|
CcBackupPeer::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(CcBackupPeer::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 CcBackup
|
||||||
|
* @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 = CcBackupPeer::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 CcBackupPeer::populateObjects(CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$criteria->hasSelectClause()) {
|
||||||
|
$criteria = clone $criteria;
|
||||||
|
CcBackupPeer::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 CcBackup $value A CcBackup object.
|
||||||
|
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||||
|
*/
|
||||||
|
public static function addInstanceToPool(CcBackup $obj, $key = null)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled()) {
|
||||||
|
if ($key === null) {
|
||||||
|
$key = (string) $obj->getToken();
|
||||||
|
} // 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 CcBackup object or a primary key value.
|
||||||
|
*/
|
||||||
|
public static function removeInstanceFromPool($value)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled() && $value !== null) {
|
||||||
|
if (is_object($value) && $value instanceof CcBackup) {
|
||||||
|
$key = (string) $value->getToken();
|
||||||
|
} 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 CcBackup 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 CcBackup 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_backup
|
||||||
|
* 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 (string) $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 = CcBackupPeer::getOMClass(false);
|
||||||
|
// populate the object(s)
|
||||||
|
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||||
|
$key = CcBackupPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||||
|
if (null !== ($obj = CcBackupPeer::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;
|
||||||
|
CcBackupPeer::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 (CcBackup object, last column rank)
|
||||||
|
*/
|
||||||
|
public static function populateObject($row, $startcol = 0)
|
||||||
|
{
|
||||||
|
$key = CcBackupPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||||
|
if (null !== ($obj = CcBackupPeer::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 + CcBackupPeer::NUM_COLUMNS;
|
||||||
|
} else {
|
||||||
|
$cls = CcBackupPeer::OM_CLASS;
|
||||||
|
$obj = new $cls();
|
||||||
|
$col = $obj->hydrate($row, $startcol);
|
||||||
|
CcBackupPeer::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(BaseCcBackupPeer::DATABASE_NAME);
|
||||||
|
if (!$dbMap->hasTable(BaseCcBackupPeer::TABLE_NAME))
|
||||||
|
{
|
||||||
|
$dbMap->addTableObject(new CcBackupTableMap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 ? CcBackupPeer::CLASS_DEFAULT : CcBackupPeer::OM_CLASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform an INSERT on the database, given a CcBackup or Criteria object.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcBackup 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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
$criteria = clone $values; // rename for clarity
|
||||||
|
} else {
|
||||||
|
$criteria = $values->buildCriteria(); // build Criteria from CcBackup object
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 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 CcBackup or Criteria object.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcBackup 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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
$criteria = clone $values; // rename for clarity
|
||||||
|
|
||||||
|
$comparison = $criteria->getComparison(CcBackupPeer::TOKEN);
|
||||||
|
$value = $criteria->remove(CcBackupPeer::TOKEN);
|
||||||
|
if ($value) {
|
||||||
|
$selectCriteria->add(CcBackupPeer::TOKEN, $value, $comparison);
|
||||||
|
} else {
|
||||||
|
$selectCriteria->setPrimaryTableName(CcBackupPeer::TABLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else { // $values is CcBackup 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_backup 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(CcBackupPeer::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(CcBackupPeer::TABLE_NAME, $con, CcBackupPeer::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).
|
||||||
|
CcBackupPeer::clearInstancePool();
|
||||||
|
CcBackupPeer::clearRelatedInstancePool();
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform a DELETE on the database, given a CcBackup or Criteria object OR a primary key value.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcBackup 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(CcBackupPeer::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.
|
||||||
|
CcBackupPeer::clearInstancePool();
|
||||||
|
// rename for clarity
|
||||||
|
$criteria = clone $values;
|
||||||
|
} elseif ($values instanceof CcBackup) { // it's a model object
|
||||||
|
// invalidate the cache for this single object
|
||||||
|
CcBackupPeer::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(CcBackupPeer::TOKEN, (array) $values, Criteria::IN);
|
||||||
|
// invalidate the cache for this object(s)
|
||||||
|
foreach ((array) $values as $singleval) {
|
||||||
|
CcBackupPeer::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);
|
||||||
|
CcBackupPeer::clearRelatedInstancePool();
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates all modified columns of given CcBackup 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 CcBackup $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(CcBackup $obj, $cols = null)
|
||||||
|
{
|
||||||
|
$columns = array();
|
||||||
|
|
||||||
|
if ($cols) {
|
||||||
|
$dbMap = Propel::getDatabaseMap(CcBackupPeer::DATABASE_NAME);
|
||||||
|
$tableMap = $dbMap->getTable(CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, CcBackupPeer::TABLE_NAME, $columns);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a single object by pkey.
|
||||||
|
*
|
||||||
|
* @param string $pk the primary key.
|
||||||
|
* @param PropelPDO $con the connection to use
|
||||||
|
* @return CcBackup
|
||||||
|
*/
|
||||||
|
public static function retrieveByPK($pk, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (null !== ($obj = CcBackupPeer::getInstanceFromPool((string) $pk))) {
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria = new Criteria(CcBackupPeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcBackupPeer::TOKEN, $pk);
|
||||||
|
|
||||||
|
$v = CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
$objs = null;
|
||||||
|
if (empty($pks)) {
|
||||||
|
$objs = array();
|
||||||
|
} else {
|
||||||
|
$criteria = new Criteria(CcBackupPeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcBackupPeer::TOKEN, $pks, Criteria::IN);
|
||||||
|
$objs = CcBackupPeer::doSelect($criteria, $con);
|
||||||
|
}
|
||||||
|
return $objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcBackupPeer
|
||||||
|
|
||||||
|
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||||
|
//
|
||||||
|
BaseCcBackupPeer::buildTableMap();
|
||||||
|
|
|
@ -0,0 +1,292 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a query for the 'cc_backup' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @method CcBackupQuery orderByToken($order = Criteria::ASC) Order by the token column
|
||||||
|
* @method CcBackupQuery orderBySessionid($order = Criteria::ASC) Order by the sessionid column
|
||||||
|
* @method CcBackupQuery orderByStatus($order = Criteria::ASC) Order by the status column
|
||||||
|
* @method CcBackupQuery orderByFromtime($order = Criteria::ASC) Order by the fromtime column
|
||||||
|
* @method CcBackupQuery orderByTotime($order = Criteria::ASC) Order by the totime column
|
||||||
|
*
|
||||||
|
* @method CcBackupQuery groupByToken() Group by the token column
|
||||||
|
* @method CcBackupQuery groupBySessionid() Group by the sessionid column
|
||||||
|
* @method CcBackupQuery groupByStatus() Group by the status column
|
||||||
|
* @method CcBackupQuery groupByFromtime() Group by the fromtime column
|
||||||
|
* @method CcBackupQuery groupByTotime() Group by the totime column
|
||||||
|
*
|
||||||
|
* @method CcBackupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
|
* @method CcBackupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
* @method CcBackupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||||
|
*
|
||||||
|
* @method CcBackup findOne(PropelPDO $con = null) Return the first CcBackup matching the query
|
||||||
|
* @method CcBackup findOneOrCreate(PropelPDO $con = null) Return the first CcBackup matching the query, or a new CcBackup object populated from the query conditions when no match is found
|
||||||
|
*
|
||||||
|
* @method CcBackup findOneByToken(string $token) Return the first CcBackup filtered by the token column
|
||||||
|
* @method CcBackup findOneBySessionid(string $sessionid) Return the first CcBackup filtered by the sessionid column
|
||||||
|
* @method CcBackup findOneByStatus(string $status) Return the first CcBackup filtered by the status column
|
||||||
|
* @method CcBackup findOneByFromtime(string $fromtime) Return the first CcBackup filtered by the fromtime column
|
||||||
|
* @method CcBackup findOneByTotime(string $totime) Return the first CcBackup filtered by the totime column
|
||||||
|
*
|
||||||
|
* @method array findByToken(string $token) Return CcBackup objects filtered by the token column
|
||||||
|
* @method array findBySessionid(string $sessionid) Return CcBackup objects filtered by the sessionid column
|
||||||
|
* @method array findByStatus(string $status) Return CcBackup objects filtered by the status column
|
||||||
|
* @method array findByFromtime(string $fromtime) Return CcBackup objects filtered by the fromtime column
|
||||||
|
* @method array findByTotime(string $totime) Return CcBackup objects filtered by the totime column
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcBackupQuery extends ModelCriteria
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes internal state of BaseCcBackupQuery 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 = 'CcBackup', $modelAlias = null)
|
||||||
|
{
|
||||||
|
parent::__construct($dbName, $modelName, $modelAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new CcBackupQuery object.
|
||||||
|
*
|
||||||
|
* @param string $modelAlias The alias of a model in the query
|
||||||
|
* @param Criteria $criteria Optional Criteria to build the query from
|
||||||
|
*
|
||||||
|
* @return CcBackupQuery
|
||||||
|
*/
|
||||||
|
public static function create($modelAlias = null, $criteria = null)
|
||||||
|
{
|
||||||
|
if ($criteria instanceof CcBackupQuery) {
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
$query = new CcBackupQuery();
|
||||||
|
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 CcBackup|array|mixed the result, formatted by the current formatter
|
||||||
|
*/
|
||||||
|
public function findPk($key, $con = null)
|
||||||
|
{
|
||||||
|
if ((null !== ($obj = CcBackupPeer::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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKey($key)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::TOKEN, $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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKeys($keys)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::TOKEN, $keys, Criteria::IN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the token column
|
||||||
|
*
|
||||||
|
* @param string $token 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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByToken($token = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($token)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $token)) {
|
||||||
|
$token = str_replace('*', '%', $token);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::TOKEN, $token, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the sessionid column
|
||||||
|
*
|
||||||
|
* @param string $sessionid 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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterBySessionid($sessionid = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($sessionid)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $sessionid)) {
|
||||||
|
$sessionid = str_replace('*', '%', $sessionid);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::SESSIONID, $sessionid, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the status column
|
||||||
|
*
|
||||||
|
* @param string $status 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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByStatus($status = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($status)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $status)) {
|
||||||
|
$status = str_replace('*', '%', $status);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::STATUS, $status, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the fromtime column
|
||||||
|
*
|
||||||
|
* @param string|array $fromtime 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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByFromtime($fromtime = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($fromtime)) {
|
||||||
|
$useMinMax = false;
|
||||||
|
if (isset($fromtime['min'])) {
|
||||||
|
$this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($fromtime['max'])) {
|
||||||
|
$this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the totime column
|
||||||
|
*
|
||||||
|
* @param string|array $totime 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 CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByTotime($totime = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (is_array($totime)) {
|
||||||
|
$useMinMax = false;
|
||||||
|
if (isset($totime['min'])) {
|
||||||
|
$this->addUsingAlias(CcBackupPeer::TOTIME, $totime['min'], Criteria::GREATER_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if (isset($totime['max'])) {
|
||||||
|
$this->addUsingAlias(CcBackupPeer::TOTIME, $totime['max'], Criteria::LESS_EQUAL);
|
||||||
|
$useMinMax = true;
|
||||||
|
}
|
||||||
|
if ($useMinMax) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
if (null === $comparison) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcBackupPeer::TOTIME, $totime, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exclude object from result
|
||||||
|
*
|
||||||
|
* @param CcBackup $ccBackup Object to remove from the list of results
|
||||||
|
*
|
||||||
|
* @return CcBackupQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function prune($ccBackup = null)
|
||||||
|
{
|
||||||
|
if ($ccBackup) {
|
||||||
|
$this->addUsingAlias(CcBackupPeer::TOKEN, $ccBackup->getToken(), Criteria::NOT_EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcBackupQuery
|
|
@ -0,0 +1,708 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a row from the 'cc_country' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcCountry extends BaseObject implements Persistent
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Peer class name
|
||||||
|
*/
|
||||||
|
const PEER = 'CcCountryPeer';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 CcCountryPeer
|
||||||
|
*/
|
||||||
|
protected static $peer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the isocode field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $isocode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the name field.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 [isocode] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbIsoCode()
|
||||||
|
{
|
||||||
|
return $this->isocode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [name] column value.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDbName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [isocode] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcCountry The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbIsoCode($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->isocode !== $v) {
|
||||||
|
$this->isocode = $v;
|
||||||
|
$this->modifiedColumns[] = CcCountryPeer::ISOCODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbIsoCode()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [name] column.
|
||||||
|
*
|
||||||
|
* @param string $v new value
|
||||||
|
* @return CcCountry The current object (for fluent API support)
|
||||||
|
*/
|
||||||
|
public function setDbName($v)
|
||||||
|
{
|
||||||
|
if ($v !== null) {
|
||||||
|
$v = (string) $v;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->name !== $v) {
|
||||||
|
$this->name = $v;
|
||||||
|
$this->modifiedColumns[] = CcCountryPeer::NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
} // setDbName()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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->isocode = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
|
||||||
|
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
|
||||||
|
$this->resetModified();
|
||||||
|
|
||||||
|
$this->setNew(false);
|
||||||
|
|
||||||
|
if ($rehydrate) {
|
||||||
|
$this->ensureConsistency();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $startcol + 2; // 2 = CcCountryPeer::NUM_COLUMNS - CcCountryPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
|
} catch (Exception $e) {
|
||||||
|
throw new PropelException("Error populating CcCountry 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(CcCountryPeer::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 = CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$con->beginTransaction();
|
||||||
|
try {
|
||||||
|
$ret = $this->preDelete($con);
|
||||||
|
if ($ret) {
|
||||||
|
CcCountryQuery::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(CcCountryPeer::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);
|
||||||
|
CcCountryPeer::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 object has been modified, then save it to the database.
|
||||||
|
if ($this->isModified()) {
|
||||||
|
if ($this->isNew()) {
|
||||||
|
$criteria = $this->buildCriteria();
|
||||||
|
$pk = BasePeer::doInsert($criteria, $con);
|
||||||
|
$affectedRows = 1;
|
||||||
|
$this->setNew(false);
|
||||||
|
} else {
|
||||||
|
$affectedRows = CcCountryPeer::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 = CcCountryPeer::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 = CcCountryPeer::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->getDbIsoCode();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
return $this->getDbName();
|
||||||
|
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 = CcCountryPeer::getFieldNames($keyType);
|
||||||
|
$result = array(
|
||||||
|
$keys[0] => $this->getDbIsoCode(),
|
||||||
|
$keys[1] => $this->getDbName(),
|
||||||
|
);
|
||||||
|
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 = CcCountryPeer::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->setDbIsoCode($value);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$this->setDbName($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 = CcCountryPeer::getFieldNames($keyType);
|
||||||
|
|
||||||
|
if (array_key_exists($keys[0], $arr)) $this->setDbIsoCode($arr[$keys[0]]);
|
||||||
|
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(CcCountryPeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($this->isColumnModified(CcCountryPeer::ISOCODE)) $criteria->add(CcCountryPeer::ISOCODE, $this->isocode);
|
||||||
|
if ($this->isColumnModified(CcCountryPeer::NAME)) $criteria->add(CcCountryPeer::NAME, $this->name);
|
||||||
|
|
||||||
|
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(CcCountryPeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcCountryPeer::ISOCODE, $this->isocode);
|
||||||
|
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primary key for this object (row).
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getPrimaryKey()
|
||||||
|
{
|
||||||
|
return $this->getDbIsoCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generic method to set the primary key (isocode column).
|
||||||
|
*
|
||||||
|
* @param string $key Primary key.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setPrimaryKey($key)
|
||||||
|
{
|
||||||
|
$this->setDbIsoCode($key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the primary key for this object is null.
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isPrimaryKeyNull()
|
||||||
|
{
|
||||||
|
return null === $this->getDbIsoCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 CcCountry (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->setDbIsoCode($this->isocode);
|
||||||
|
$copyObj->setDbName($this->name);
|
||||||
|
|
||||||
|
$copyObj->setNew(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 CcCountry 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 CcCountryPeer
|
||||||
|
*/
|
||||||
|
public function getPeer()
|
||||||
|
{
|
||||||
|
if (self::$peer === null) {
|
||||||
|
self::$peer = new CcCountryPeer();
|
||||||
|
}
|
||||||
|
return self::$peer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the current object and sets all attributes to their default values
|
||||||
|
*/
|
||||||
|
public function clear()
|
||||||
|
{
|
||||||
|
$this->isocode = null;
|
||||||
|
$this->name = 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcCountry
|
|
@ -0,0 +1,735 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base static class for performing query and update operations on the 'cc_country' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcCountryPeer {
|
||||||
|
|
||||||
|
/** the default database name for this class */
|
||||||
|
const DATABASE_NAME = 'airtime';
|
||||||
|
|
||||||
|
/** the table name for this class */
|
||||||
|
const TABLE_NAME = 'cc_country';
|
||||||
|
|
||||||
|
/** the related Propel class for this table */
|
||||||
|
const OM_CLASS = 'CcCountry';
|
||||||
|
|
||||||
|
/** A class that can be returned by this peer. */
|
||||||
|
const CLASS_DEFAULT = 'airtime.CcCountry';
|
||||||
|
|
||||||
|
/** the related TableMap class for this table */
|
||||||
|
const TM_CLASS = 'CcCountryTableMap';
|
||||||
|
|
||||||
|
/** The total number of columns. */
|
||||||
|
const NUM_COLUMNS = 2;
|
||||||
|
|
||||||
|
/** The number of lazy-loaded columns. */
|
||||||
|
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||||
|
|
||||||
|
/** the column name for the ISOCODE field */
|
||||||
|
const ISOCODE = 'cc_country.ISOCODE';
|
||||||
|
|
||||||
|
/** the column name for the NAME field */
|
||||||
|
const NAME = 'cc_country.NAME';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An identiy map to hold any loaded instances of CcCountry objects.
|
||||||
|
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||||
|
* queries.
|
||||||
|
* @var array CcCountry[]
|
||||||
|
*/
|
||||||
|
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 ('DbIsoCode', 'DbName', ),
|
||||||
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbIsoCode', 'dbName', ),
|
||||||
|
BasePeer::TYPE_COLNAME => array (self::ISOCODE, self::NAME, ),
|
||||||
|
BasePeer::TYPE_RAW_COLNAME => array ('ISOCODE', 'NAME', ),
|
||||||
|
BasePeer::TYPE_FIELDNAME => array ('isocode', 'name', ),
|
||||||
|
BasePeer::TYPE_NUM => array (0, 1, )
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 ('DbIsoCode' => 0, 'DbName' => 1, ),
|
||||||
|
BasePeer::TYPE_STUDLYPHPNAME => array ('dbIsoCode' => 0, 'dbName' => 1, ),
|
||||||
|
BasePeer::TYPE_COLNAME => array (self::ISOCODE => 0, self::NAME => 1, ),
|
||||||
|
BasePeer::TYPE_RAW_COLNAME => array ('ISOCODE' => 0, 'NAME' => 1, ),
|
||||||
|
BasePeer::TYPE_FIELDNAME => array ('isocode' => 0, 'name' => 1, ),
|
||||||
|
BasePeer::TYPE_NUM => array (0, 1, )
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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. CcCountryPeer::COLUMN_NAME).
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function alias($alias, $column)
|
||||||
|
{
|
||||||
|
return str_replace(CcCountryPeer::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(CcCountryPeer::ISOCODE);
|
||||||
|
$criteria->addSelectColumn(CcCountryPeer::NAME);
|
||||||
|
} else {
|
||||||
|
$criteria->addSelectColumn($alias . '.ISOCODE');
|
||||||
|
$criteria->addSelectColumn($alias . '.NAME');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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(CcCountryPeer::TABLE_NAME);
|
||||||
|
|
||||||
|
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||||
|
$criteria->setDistinct();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$criteria->hasSelectClause()) {
|
||||||
|
CcCountryPeer::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(CcCountryPeer::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 CcCountry
|
||||||
|
* @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 = CcCountryPeer::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 CcCountryPeer::populateObjects(CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$criteria->hasSelectClause()) {
|
||||||
|
$criteria = clone $criteria;
|
||||||
|
CcCountryPeer::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 CcCountry $value A CcCountry object.
|
||||||
|
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||||
|
*/
|
||||||
|
public static function addInstanceToPool(CcCountry $obj, $key = null)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled()) {
|
||||||
|
if ($key === null) {
|
||||||
|
$key = (string) $obj->getDbIsoCode();
|
||||||
|
} // 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 CcCountry object or a primary key value.
|
||||||
|
*/
|
||||||
|
public static function removeInstanceFromPool($value)
|
||||||
|
{
|
||||||
|
if (Propel::isInstancePoolingEnabled() && $value !== null) {
|
||||||
|
if (is_object($value) && $value instanceof CcCountry) {
|
||||||
|
$key = (string) $value->getDbIsoCode();
|
||||||
|
} 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 CcCountry 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 CcCountry 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_country
|
||||||
|
* 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 (string) $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 = CcCountryPeer::getOMClass(false);
|
||||||
|
// populate the object(s)
|
||||||
|
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||||
|
$key = CcCountryPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||||
|
if (null !== ($obj = CcCountryPeer::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;
|
||||||
|
CcCountryPeer::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 (CcCountry object, last column rank)
|
||||||
|
*/
|
||||||
|
public static function populateObject($row, $startcol = 0)
|
||||||
|
{
|
||||||
|
$key = CcCountryPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||||
|
if (null !== ($obj = CcCountryPeer::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 + CcCountryPeer::NUM_COLUMNS;
|
||||||
|
} else {
|
||||||
|
$cls = CcCountryPeer::OM_CLASS;
|
||||||
|
$obj = new $cls();
|
||||||
|
$col = $obj->hydrate($row, $startcol);
|
||||||
|
CcCountryPeer::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(BaseCcCountryPeer::DATABASE_NAME);
|
||||||
|
if (!$dbMap->hasTable(BaseCcCountryPeer::TABLE_NAME))
|
||||||
|
{
|
||||||
|
$dbMap->addTableObject(new CcCountryTableMap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 ? CcCountryPeer::CLASS_DEFAULT : CcCountryPeer::OM_CLASS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform an INSERT on the database, given a CcCountry or Criteria object.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcCountry 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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
$criteria = clone $values; // rename for clarity
|
||||||
|
} else {
|
||||||
|
$criteria = $values->buildCriteria(); // build Criteria from CcCountry object
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 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 CcCountry or Criteria object.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcCountry 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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($values instanceof Criteria) {
|
||||||
|
$criteria = clone $values; // rename for clarity
|
||||||
|
|
||||||
|
$comparison = $criteria->getComparison(CcCountryPeer::ISOCODE);
|
||||||
|
$value = $criteria->remove(CcCountryPeer::ISOCODE);
|
||||||
|
if ($value) {
|
||||||
|
$selectCriteria->add(CcCountryPeer::ISOCODE, $value, $comparison);
|
||||||
|
} else {
|
||||||
|
$selectCriteria->setPrimaryTableName(CcCountryPeer::TABLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else { // $values is CcCountry 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_country 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(CcCountryPeer::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(CcCountryPeer::TABLE_NAME, $con, CcCountryPeer::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).
|
||||||
|
CcCountryPeer::clearInstancePool();
|
||||||
|
CcCountryPeer::clearRelatedInstancePool();
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method perform a DELETE on the database, given a CcCountry or Criteria object OR a primary key value.
|
||||||
|
*
|
||||||
|
* @param mixed $values Criteria or CcCountry 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(CcCountryPeer::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.
|
||||||
|
CcCountryPeer::clearInstancePool();
|
||||||
|
// rename for clarity
|
||||||
|
$criteria = clone $values;
|
||||||
|
} elseif ($values instanceof CcCountry) { // it's a model object
|
||||||
|
// invalidate the cache for this single object
|
||||||
|
CcCountryPeer::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(CcCountryPeer::ISOCODE, (array) $values, Criteria::IN);
|
||||||
|
// invalidate the cache for this object(s)
|
||||||
|
foreach ((array) $values as $singleval) {
|
||||||
|
CcCountryPeer::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);
|
||||||
|
CcCountryPeer::clearRelatedInstancePool();
|
||||||
|
$con->commit();
|
||||||
|
return $affectedRows;
|
||||||
|
} catch (PropelException $e) {
|
||||||
|
$con->rollBack();
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates all modified columns of given CcCountry 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 CcCountry $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(CcCountry $obj, $cols = null)
|
||||||
|
{
|
||||||
|
$columns = array();
|
||||||
|
|
||||||
|
if ($cols) {
|
||||||
|
$dbMap = Propel::getDatabaseMap(CcCountryPeer::DATABASE_NAME);
|
||||||
|
$tableMap = $dbMap->getTable(CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, CcCountryPeer::TABLE_NAME, $columns);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a single object by pkey.
|
||||||
|
*
|
||||||
|
* @param string $pk the primary key.
|
||||||
|
* @param PropelPDO $con the connection to use
|
||||||
|
* @return CcCountry
|
||||||
|
*/
|
||||||
|
public static function retrieveByPK($pk, PropelPDO $con = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (null !== ($obj = CcCountryPeer::getInstanceFromPool((string) $pk))) {
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($con === null) {
|
||||||
|
$con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
$criteria = new Criteria(CcCountryPeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcCountryPeer::ISOCODE, $pk);
|
||||||
|
|
||||||
|
$v = CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||||
|
}
|
||||||
|
|
||||||
|
$objs = null;
|
||||||
|
if (empty($pks)) {
|
||||||
|
$objs = array();
|
||||||
|
} else {
|
||||||
|
$criteria = new Criteria(CcCountryPeer::DATABASE_NAME);
|
||||||
|
$criteria->add(CcCountryPeer::ISOCODE, $pks, Criteria::IN);
|
||||||
|
$objs = CcCountryPeer::doSelect($criteria, $con);
|
||||||
|
}
|
||||||
|
return $objs;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcCountryPeer
|
||||||
|
|
||||||
|
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||||
|
//
|
||||||
|
BaseCcCountryPeer::buildTableMap();
|
||||||
|
|
|
@ -0,0 +1,196 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class that represents a query for the 'cc_country' table.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @method CcCountryQuery orderByDbIsoCode($order = Criteria::ASC) Order by the isocode column
|
||||||
|
* @method CcCountryQuery orderByDbName($order = Criteria::ASC) Order by the name column
|
||||||
|
*
|
||||||
|
* @method CcCountryQuery groupByDbIsoCode() Group by the isocode column
|
||||||
|
* @method CcCountryQuery groupByDbName() Group by the name column
|
||||||
|
*
|
||||||
|
* @method CcCountryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||||
|
* @method CcCountryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||||
|
* @method CcCountryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||||
|
*
|
||||||
|
* @method CcCountry findOne(PropelPDO $con = null) Return the first CcCountry matching the query
|
||||||
|
* @method CcCountry findOneOrCreate(PropelPDO $con = null) Return the first CcCountry matching the query, or a new CcCountry object populated from the query conditions when no match is found
|
||||||
|
*
|
||||||
|
* @method CcCountry findOneByDbIsoCode(string $isocode) Return the first CcCountry filtered by the isocode column
|
||||||
|
* @method CcCountry findOneByDbName(string $name) Return the first CcCountry filtered by the name column
|
||||||
|
*
|
||||||
|
* @method array findByDbIsoCode(string $isocode) Return CcCountry objects filtered by the isocode column
|
||||||
|
* @method array findByDbName(string $name) Return CcCountry objects filtered by the name column
|
||||||
|
*
|
||||||
|
* @package propel.generator.airtime.om
|
||||||
|
*/
|
||||||
|
abstract class BaseCcCountryQuery extends ModelCriteria
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes internal state of BaseCcCountryQuery 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 = 'CcCountry', $modelAlias = null)
|
||||||
|
{
|
||||||
|
parent::__construct($dbName, $modelName, $modelAlias);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new CcCountryQuery object.
|
||||||
|
*
|
||||||
|
* @param string $modelAlias The alias of a model in the query
|
||||||
|
* @param Criteria $criteria Optional Criteria to build the query from
|
||||||
|
*
|
||||||
|
* @return CcCountryQuery
|
||||||
|
*/
|
||||||
|
public static function create($modelAlias = null, $criteria = null)
|
||||||
|
{
|
||||||
|
if ($criteria instanceof CcCountryQuery) {
|
||||||
|
return $criteria;
|
||||||
|
}
|
||||||
|
$query = new CcCountryQuery();
|
||||||
|
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 CcCountry|array|mixed the result, formatted by the current formatter
|
||||||
|
*/
|
||||||
|
public function findPk($key, $con = null)
|
||||||
|
{
|
||||||
|
if ((null !== ($obj = CcCountryPeer::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 CcCountryQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKey($key)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcCountryPeer::ISOCODE, $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 CcCountryQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByPrimaryKeys($keys)
|
||||||
|
{
|
||||||
|
return $this->addUsingAlias(CcCountryPeer::ISOCODE, $keys, Criteria::IN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the isocode column
|
||||||
|
*
|
||||||
|
* @param string $dbIsoCode 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 CcCountryQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbIsoCode($dbIsoCode = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbIsoCode)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbIsoCode)) {
|
||||||
|
$dbIsoCode = str_replace('*', '%', $dbIsoCode);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcCountryPeer::ISOCODE, $dbIsoCode, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the query on the name column
|
||||||
|
*
|
||||||
|
* @param string $dbName The value to use as filter.
|
||||||
|
* Accepts wildcards (* and % trigger a LIKE)
|
||||||
|
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||||
|
*
|
||||||
|
* @return CcCountryQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function filterByDbName($dbName = null, $comparison = null)
|
||||||
|
{
|
||||||
|
if (null === $comparison) {
|
||||||
|
if (is_array($dbName)) {
|
||||||
|
$comparison = Criteria::IN;
|
||||||
|
} elseif (preg_match('/[\%\*]/', $dbName)) {
|
||||||
|
$dbName = str_replace('*', '%', $dbName);
|
||||||
|
$comparison = Criteria::LIKE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $this->addUsingAlias(CcCountryPeer::NAME, $dbName, $comparison);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exclude object from result
|
||||||
|
*
|
||||||
|
* @param CcCountry $ccCountry Object to remove from the list of results
|
||||||
|
*
|
||||||
|
* @return CcCountryQuery The current query, for fluid interface
|
||||||
|
*/
|
||||||
|
public function prune($ccCountry = null)
|
||||||
|
{
|
||||||
|
if ($ccCountry) {
|
||||||
|
$this->addUsingAlias(CcCountryPeer::ISOCODE, $ccCountry->getDbIsoCode(), Criteria::NOT_EQUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // BaseCcCountryQuery
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue