propel added as ORM for backend

This commit is contained in:
naomiaro 2010-11-04 17:48:29 -04:00
parent 649656779c
commit 0c74dc5a43
95 changed files with 38537 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#Database driver
propel.database = pgsql
propel.database.url = pgsql:host=localhost dbname=Campcaster-naomiaro user=test password=test
#Project name
propel.project = campcaster

View File

@ -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.campcaster
*/
class CcAccess extends BaseCcAccess {
} // CcAccess

View File

@ -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.campcaster
*/
class CcAccessPeer extends BaseCcAccessPeer {
} // CcAccessPeer

View File

@ -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.campcaster
*/
class CcAccessQuery extends BaseCcAccessQuery {
} // CcAccessQuery

View File

@ -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.campcaster
*/
class CcBackup extends BaseCcBackup {
} // CcBackup

View File

@ -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.campcaster
*/
class CcBackupPeer extends BaseCcBackupPeer {
} // CcBackupPeer

View File

@ -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.campcaster
*/
class CcBackupQuery extends BaseCcBackupQuery {
} // CcBackupQuery

View File

@ -0,0 +1,18 @@
<?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 {
} // CcFiles

View File

@ -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.campcaster
*/
class CcFilesPeer extends BaseCcFilesPeer {
} // CcFilesPeer

View File

@ -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.campcaster
*/
class CcFilesQuery extends BaseCcFilesQuery {
} // CcFilesQuery

View File

@ -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.campcaster
*/
class CcPerms extends BaseCcPerms {
} // CcPerms

View File

@ -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.campcaster
*/
class CcPermsPeer extends BaseCcPermsPeer {
} // CcPermsPeer

View File

@ -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.campcaster
*/
class CcPermsQuery extends BaseCcPermsQuery {
} // CcPermsQuery

View File

@ -0,0 +1,18 @@
<?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 {
} // CcPlaylist

View File

@ -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.campcaster
*/
class CcPlaylistPeer extends BaseCcPlaylistPeer {
} // CcPlaylistPeer

View File

@ -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.campcaster
*/
class CcPlaylistQuery extends BaseCcPlaylistQuery {
} // CcPlaylistQuery

View File

@ -0,0 +1,18 @@
<?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 {
} // CcPlaylistcontents

View File

@ -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.campcaster
*/
class CcPlaylistcontentsPeer extends BaseCcPlaylistcontentsPeer {
} // CcPlaylistcontentsPeer

View File

@ -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.campcaster
*/
class CcPlaylistcontentsQuery extends BaseCcPlaylistcontentsQuery {
} // CcPlaylistcontentsQuery

View File

@ -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.campcaster
*/
class CcPref extends BaseCcPref {
} // CcPref

View File

@ -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.campcaster
*/
class CcPrefPeer extends BaseCcPrefPeer {
} // CcPrefPeer

View File

@ -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.campcaster
*/
class CcPrefQuery extends BaseCcPrefQuery {
} // CcPrefQuery

View File

@ -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.campcaster
*/
class CcSchedule extends BaseCcSchedule {
} // CcSchedule

View File

@ -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.campcaster
*/
class CcSchedulePeer extends BaseCcSchedulePeer {
} // CcSchedulePeer

View File

@ -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.campcaster
*/
class CcScheduleQuery extends BaseCcScheduleQuery {
} // CcScheduleQuery

View File

@ -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.campcaster
*/
class CcSess extends BaseCcSess {
} // CcSess

View File

@ -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.campcaster
*/
class CcSessPeer extends BaseCcSessPeer {
} // CcSessPeer

View File

@ -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.campcaster
*/
class CcSessQuery extends BaseCcSessQuery {
} // CcSessQuery

View File

@ -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.campcaster
*/
class CcSmemb extends BaseCcSmemb {
} // CcSmemb

View File

@ -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.campcaster
*/
class CcSmembPeer extends BaseCcSmembPeer {
} // CcSmembPeer

View File

@ -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.campcaster
*/
class CcSmembQuery extends BaseCcSmembQuery {
} // CcSmembQuery

View File

@ -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.campcaster
*/
class CcSubjs extends BaseCcSubjs {
} // CcSubjs

View File

@ -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.campcaster
*/
class CcSubjsPeer extends BaseCcSubjsPeer {
} // CcSubjsPeer

View File

@ -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.campcaster
*/
class CcSubjsQuery extends BaseCcSubjsQuery {
} // CcSubjsQuery

View File

@ -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.campcaster
*/
class CcTrans extends BaseCcTrans {
} // CcTrans

View File

@ -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.campcaster
*/
class CcTransPeer extends BaseCcTransPeer {
} // CcTransPeer

View File

@ -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.campcaster
*/
class CcTransQuery extends BaseCcTransQuery {
} // CcTransQuery

View File

@ -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.campcaster.map
*/
class CcAccessTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_access_id_seq');
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('GUNID', 'Gunid', 'BIGINT', false, null, 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

View File

@ -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.campcaster.map
*/
class CcBackupTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$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

View File

@ -0,0 +1,106 @@
<?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.campcaster.map
*/
class CcFilesTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_files_id_seq');
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('GUNID', 'Gunid', 'BIGINT', true, null, null);
$this->addColumn('NAME', 'Name', 'VARCHAR', true, 255, '');
$this->addColumn('MIME', 'Mime', 'VARCHAR', true, 255, '');
$this->addColumn('FTYPE', 'Ftype', 'VARCHAR', true, 128, '');
$this->addColumn('STATE', 'State', 'VARCHAR', true, 128, 'empty');
$this->addColumn('CURRENTLYACCESSING', 'Currentlyaccessing', 'INTEGER', true, null, 0);
$this->addForeignKey('EDITEDBY', 'Editedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
$this->addColumn('MTIME', 'Mtime', 'TIMESTAMP', false, 6, null);
$this->addColumn('MD5', 'Md5', 'CHAR', false, 32, null);
$this->addColumn('TRACK_TITLE', 'TrackTitle', 'VARCHAR', false, 512, null);
$this->addColumn('ARTIST_NAME', 'ArtistName', 'VARCHAR', false, 512, null);
$this->addColumn('BIT_RATE', 'BitRate', 'VARCHAR', false, 32, null);
$this->addColumn('SAMPLE_RATE', 'SampleRate', 'VARCHAR', false, 32, null);
$this->addColumn('FORMAT', 'Format', 'VARCHAR', false, 128, null);
$this->addColumn('LENGTH', 'Length', 'TIME', false, null, null);
$this->addColumn('ALBUM_TITLE', 'AlbumTitle', 'VARCHAR', false, 512, null);
$this->addColumn('GENRE', 'Genre', 'VARCHAR', false, 64, null);
$this->addColumn('COMMENTS', 'Comments', 'LONGVARCHAR', false, null, null);
$this->addColumn('YEAR', 'Year', 'VARCHAR', false, 16, null);
$this->addColumn('TRACK_NUMBER', 'TrackNumber', 'INTEGER', false, null, null);
$this->addColumn('CHANNELS', 'Channels', 'INTEGER', false, null, null);
$this->addColumn('URL', 'Url', 'VARCHAR', false, 1024, null);
$this->addColumn('BPM', 'Bpm', 'VARCHAR', false, 8, null);
$this->addColumn('RATING', 'Rating', 'VARCHAR', false, 8, null);
$this->addColumn('ENCODED_BY', 'EncodedBy', 'VARCHAR', false, 255, null);
$this->addColumn('DISC_NUMBER', 'DiscNumber', 'VARCHAR', false, 8, null);
$this->addColumn('MOOD', 'Mood', 'VARCHAR', false, 64, null);
$this->addColumn('LABEL', 'Label', 'VARCHAR', false, 512, null);
$this->addColumn('COMPOSER', 'Composer', 'VARCHAR', false, 512, null);
$this->addColumn('ENCODER', 'Encoder', 'VARCHAR', false, 64, null);
$this->addColumn('CHECKSUM', 'Checksum', 'VARCHAR', false, 256, null);
$this->addColumn('LYRICS', 'Lyrics', 'LONGVARCHAR', false, null, null);
$this->addColumn('ORCHESTRA', 'Orchestra', 'VARCHAR', false, 512, null);
$this->addColumn('CONDUCTOR', 'Conductor', 'VARCHAR', false, 512, null);
$this->addColumn('LYRICIST', 'Lyricist', 'VARCHAR', false, 512, null);
$this->addColumn('ORIGINAL_LYRICIST', 'OriginalLyricist', 'VARCHAR', false, 512, null);
$this->addColumn('RADIO_STATION_NAME', 'RadioStationName', 'VARCHAR', false, 512, null);
$this->addColumn('INFO_URL', 'InfoUrl', 'VARCHAR', false, 512, null);
$this->addColumn('ARTIST_URL', 'ArtistUrl', 'VARCHAR', false, 512, null);
$this->addColumn('AUDIO_SOURCE_URL', 'AudioSourceUrl', 'VARCHAR', false, 512, null);
$this->addColumn('RADIO_STATION_URL', 'RadioStationUrl', 'VARCHAR', false, 512, null);
$this->addColumn('BUY_THIS_URL', 'BuyThisUrl', 'VARCHAR', false, 512, null);
$this->addColumn('ISRC_NUMBER', 'IsrcNumber', 'VARCHAR', false, 512, null);
$this->addColumn('CATALOG_NUMBER', 'CatalogNumber', 'VARCHAR', false, 512, null);
$this->addColumn('ORIGINAL_ARTIST', 'OriginalArtist', 'VARCHAR', false, 512, null);
$this->addColumn('COPYRIGHT', 'Copyright', 'VARCHAR', false, 512, null);
$this->addColumn('REPORT_DATETIME', 'ReportDatetime', 'VARCHAR', false, 32, null);
$this->addColumn('REPORT_LOCATION', 'ReportLocation', 'VARCHAR', false, 512, null);
$this->addColumn('REPORT_ORGANIZATION', 'ReportOrganization', 'VARCHAR', false, 512, null);
$this->addColumn('SUBJECT', 'Subject', 'VARCHAR', false, 512, null);
$this->addColumn('CONTRIBUTOR', 'Contributor', 'VARCHAR', false, 512, null);
$this->addColumn('LANGUAGE', 'Language', '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' => 'file_id', ), 'CASCADE', null);
} // buildRelations()
} // CcFilesTableMap

View File

@ -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.campcaster.map
*/
class CcPermsTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$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

View File

@ -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.campcaster.map
*/
class CcPlaylistTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_playlist_id_seq');
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('NAME', 'Name', 'VARCHAR', true, 255, '');
$this->addColumn('STATE', 'State', 'VARCHAR', true, 128, 'empty');
$this->addColumn('CURRENTLYACCESSING', 'Currentlyaccessing', 'INTEGER', true, null, 0);
$this->addForeignKey('EDITEDBY', 'Editedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
$this->addColumn('MTIME', 'Mtime', 'TIMESTAMP', false, 6, null);
$this->addColumn('CREATOR', 'Creator', 'VARCHAR', false, 32, null);
$this->addColumn('DESCRIPTION', 'Description', '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

View File

@ -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.campcaster.map
*/
class CcPlaylistcontentsTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_playlistcontents_id_seq');
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('PLAYLIST_ID', 'PlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null);
$this->addForeignKey('FILE_ID', 'FileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
$this->addColumn('POSITION', 'Position', 'INTEGER', false, null, null);
$this->addColumn('CLIPLENGTH', 'Cliplength', 'TIME', false, null, '00:00:00');
$this->addColumn('CUEIN', 'Cuein', 'TIME', false, null, '00:00:00');
$this->addColumn('CUEOUT', 'Cueout', 'TIME', false, null, '00:00:00');
$this->addColumn('FADEIN', 'Fadein', 'TIME', false, null, '00:00:00');
$this->addColumn('FADEOUT', 'Fadeout', '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

View File

@ -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.campcaster.map
*/
class CcPrefTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$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

View File

@ -0,0 +1,61 @@
<?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.campcaster.map
*/
class CcScheduleTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$this->setUseIdGenerator(false);
// columns
$this->addPrimaryKey('ID', 'Id', 'BIGINT', true, null, null);
$this->addColumn('PLAYLIST_ID', 'PlaylistId', 'INTEGER', true, null, null);
$this->addColumn('STARTS', 'Starts', 'TIMESTAMP', true, null, null);
$this->addColumn('ENDS', 'Ends', 'TIMESTAMP', true, null, null);
$this->addColumn('GROUP_ID', 'GroupId', 'INTEGER', false, null, null);
$this->addColumn('FILE_ID', 'FileId', 'INTEGER', false, null, null);
$this->addColumn('CLIP_LENGTH', 'ClipLength', 'TIME', false, null, '00:00:00');
$this->addColumn('FADE_IN', 'FadeIn', 'TIME', false, null, '00:00:00');
$this->addColumn('FADE_OUT', 'FadeOut', 'TIME', false, null, '00:00:00');
$this->addColumn('CUE_IN', 'CueIn', 'TIME', false, null, '00:00:00');
$this->addColumn('CUE_OUT', 'CueOut', 'TIME', false, null, '00:00:00');
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
} // buildRelations()
} // CcScheduleTableMap

View File

@ -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.campcaster.map
*/
class CcSessTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$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

View File

@ -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.campcaster.map
*/
class CcSmembTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$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

View File

@ -0,0 +1,63 @@
<?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.campcaster.map
*/
class CcSubjsTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$this->setUseIdGenerator(false);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('LOGIN', 'Login', 'VARCHAR', true, 255, '');
$this->addColumn('PASS', 'Pass', 'VARCHAR', true, 255, '');
$this->addColumn('TYPE', 'Type', 'CHAR', true, 1, 'U');
$this->addColumn('REALNAME', 'Realname', 'VARCHAR', true, 255, '');
$this->addColumn('LASTLOGIN', 'Lastlogin', 'TIMESTAMP', false, null, null);
$this->addColumn('LASTFAIL', 'Lastfail', 'TIMESTAMP', false, null, 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('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

View File

@ -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.campcaster.map
*/
class CcTransTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'campcaster.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('campcaster');
$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', 'BIGINT', false, null, 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

View File

@ -0,0 +1,486 @@
<?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.campcaster.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 = 'campcaster', $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|array $gunid 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 filterByGunid($gunid = null, $comparison = null)
{
if (is_array($gunid)) {
$useMinMax = false;
if (isset($gunid['min'])) {
$this->addUsingAlias(CcAccessPeer::GUNID, $gunid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($gunid['max'])) {
$this->addUsingAlias(CcAccessPeer::GUNID, $gunid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
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->getId(), $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

View File

@ -0,0 +1,956 @@
<?php
/**
* Base class that represents a row from the 'cc_backup' table.
*
*
*
* @package propel.generator.campcaster.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

View File

@ -0,0 +1,750 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_backup' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcBackupPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** 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 = 'campcaster.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();

View File

@ -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.campcaster.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 = 'campcaster', $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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,945 @@
<?php
/**
* Base class that represents a row from the 'cc_perms' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPerms extends BaseObject implements Persistent
{
/**
* Peer class name
*/
const PEER = 'CcPermsPeer';
/**
* 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 CcPermsPeer
*/
protected static $peer;
/**
* The value for the permid field.
* @var int
*/
protected $permid;
/**
* The value for the subj field.
* @var int
*/
protected $subj;
/**
* The value for the action field.
* @var string
*/
protected $action;
/**
* The value for the obj field.
* @var int
*/
protected $obj;
/**
* The value for the type field.
* @var string
*/
protected $type;
/**
* @var CcSubjs
*/
protected $aCcSubjs;
/**
* 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 [permid] column value.
*
* @return int
*/
public function getPermid()
{
return $this->permid;
}
/**
* Get the [subj] column value.
*
* @return int
*/
public function getSubj()
{
return $this->subj;
}
/**
* Get the [action] column value.
*
* @return string
*/
public function getAction()
{
return $this->action;
}
/**
* Get the [obj] column value.
*
* @return int
*/
public function getObj()
{
return $this->obj;
}
/**
* Get the [type] column value.
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set the value of [permid] column.
*
* @param int $v new value
* @return CcPerms The current object (for fluent API support)
*/
public function setPermid($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->permid !== $v) {
$this->permid = $v;
$this->modifiedColumns[] = CcPermsPeer::PERMID;
}
return $this;
} // setPermid()
/**
* Set the value of [subj] column.
*
* @param int $v new value
* @return CcPerms The current object (for fluent API support)
*/
public function setSubj($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->subj !== $v) {
$this->subj = $v;
$this->modifiedColumns[] = CcPermsPeer::SUBJ;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
$this->aCcSubjs = null;
}
return $this;
} // setSubj()
/**
* Set the value of [action] column.
*
* @param string $v new value
* @return CcPerms The current object (for fluent API support)
*/
public function setAction($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->action !== $v) {
$this->action = $v;
$this->modifiedColumns[] = CcPermsPeer::ACTION;
}
return $this;
} // setAction()
/**
* Set the value of [obj] column.
*
* @param int $v new value
* @return CcPerms The current object (for fluent API support)
*/
public function setObj($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->obj !== $v) {
$this->obj = $v;
$this->modifiedColumns[] = CcPermsPeer::OBJ;
}
return $this;
} // setObj()
/**
* Set the value of [type] column.
*
* @param string $v new value
* @return CcPerms The current object (for fluent API support)
*/
public function setType($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->type !== $v) {
$this->type = $v;
$this->modifiedColumns[] = CcPermsPeer::TYPE;
}
return $this;
} // setType()
/**
* Indicates whether the columns in this object are only set to default values.
*
* This method can be used in conjunction with isModified() to indicate whether an object is both
* modified _and_ has some values set which are non-default.
*
* @return boolean Whether the columns in this object are only been set with default values.
*/
public function hasOnlyDefaultValues()
{
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
* An offset (0-based "start column") is specified so that objects can be hydrated
* with a subset of the columns in the resultset rows. This is needed, for example,
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->permid = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->subj = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->action = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->obj = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
$this->type = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->resetModified();
$this->setNew(false);
if ($rehydrate) {
$this->ensureConsistency();
}
return $startcol + 5; // 5 = CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcPerms 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()
{
if ($this->aCcSubjs !== null && $this->subj !== $this->aCcSubjs->getId()) {
$this->aCcSubjs = null;
}
} // 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(CcPermsPeer::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 = CcPermsPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
$row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor();
if (!$row) {
throw new PropelException('Cannot find matching row in the database to reload object values.');
}
$this->hydrate($row, 0, true); // rehydrate
if ($deep) { // also de-associate any related objects?
$this->aCcSubjs = null;
} // if (deep)
}
/**
* Removes this object from datastore and sets delete attribute.
*
* @param PropelPDO $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
if ($ret) {
CcPermsQuery::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(CcPermsPeer::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);
CcPermsPeer::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;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcSubjs !== null) {
if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) {
$affectedRows += $this->aCcSubjs->save($con);
}
$this->setCcSubjs($this->aCcSubjs);
}
// 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 += CcPermsPeer::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();
// We call the validate method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcSubjs !== null) {
if (!$this->aCcSubjs->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures());
}
}
if (($retval = CcPermsPeer::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 = CcPermsPeer::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->getPermid();
break;
case 1:
return $this->getSubj();
break;
case 2:
return $this->getAction();
break;
case 3:
return $this->getObj();
break;
case 4:
return $this->getType();
break;
default:
return null;
break;
} // switch()
}
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false)
{
$keys = CcPermsPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getPermid(),
$keys[1] => $this->getSubj(),
$keys[2] => $this->getAction(),
$keys[3] => $this->getObj(),
$keys[4] => $this->getType(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcSubjs) {
$result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true);
}
}
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 = CcPermsPeer::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->setPermid($value);
break;
case 1:
$this->setSubj($value);
break;
case 2:
$this->setAction($value);
break;
case 3:
$this->setObj($value);
break;
case 4:
$this->setType($value);
break;
} // switch()
}
/**
* Populates the object using an array.
*
* This is particularly useful when populating an object from one of the
* request arrays (e.g. $_POST). This method goes through the column
* names, checking to see whether a matching key exists in populated
* array. If so the setByName() method is called for that column.
*
* You can specify the key type of the array by additionally passing one
* of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* The default key type is the column's phpname (e.g. 'AuthorId')
*
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = CcPermsPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setPermid($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setSubj($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setAction($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setObj($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setType($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(CcPermsPeer::DATABASE_NAME);
if ($this->isColumnModified(CcPermsPeer::PERMID)) $criteria->add(CcPermsPeer::PERMID, $this->permid);
if ($this->isColumnModified(CcPermsPeer::SUBJ)) $criteria->add(CcPermsPeer::SUBJ, $this->subj);
if ($this->isColumnModified(CcPermsPeer::ACTION)) $criteria->add(CcPermsPeer::ACTION, $this->action);
if ($this->isColumnModified(CcPermsPeer::OBJ)) $criteria->add(CcPermsPeer::OBJ, $this->obj);
if ($this->isColumnModified(CcPermsPeer::TYPE)) $criteria->add(CcPermsPeer::TYPE, $this->type);
return $criteria;
}
/**
* Builds a Criteria object containing the primary key for this object.
*
* Unlike buildCriteria() this method includes the primary key values regardless
* of whether or not they have been modified.
*
* @return Criteria The Criteria object containing value(s) for primary key(s).
*/
public function buildPkeyCriteria()
{
$criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
$criteria->add(CcPermsPeer::PERMID, $this->permid);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return int
*/
public function getPrimaryKey()
{
return $this->getPermid();
}
/**
* Generic method to set the primary key (permid column).
*
* @param int $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setPermid($key);
}
/**
* Returns true if the primary key for this object is null.
* @return boolean
*/
public function isPrimaryKeyNull()
{
return null === $this->getPermid();
}
/**
* 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 CcPerms (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->setPermid($this->permid);
$copyObj->setSubj($this->subj);
$copyObj->setAction($this->action);
$copyObj->setObj($this->obj);
$copyObj->setType($this->type);
$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 CcPerms 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 CcPermsPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CcPermsPeer();
}
return self::$peer;
}
/**
* Declares an association between this object and a CcSubjs object.
*
* @param CcSubjs $v
* @return CcPerms The current object (for fluent API support)
* @throws PropelException
*/
public function setCcSubjs(CcSubjs $v = null)
{
if ($v === null) {
$this->setSubj(NULL);
} else {
$this->setSubj($v->getId());
}
$this->aCcSubjs = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcSubjs object, it will not be re-added.
if ($v !== null) {
$v->addCcPerms($this);
}
return $this;
}
/**
* Get the associated CcSubjs object
*
* @param PropelPDO Optional Connection object.
* @return CcSubjs The associated CcSubjs object.
* @throws PropelException
*/
public function getCcSubjs(PropelPDO $con = null)
{
if ($this->aCcSubjs === null && ($this->subj !== null)) {
$this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subj, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aCcSubjs->addCcPermss($this);
*/
}
return $this->aCcSubjs;
}
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->permid = null;
$this->subj = null;
$this->action = null;
$this->obj = null;
$this->type = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
}
/**
* Resets all collections of referencing foreign keys.
*
* This method is a user-space workaround for PHP's inability to garbage collect objects
* with circular references. This is currently necessary when using Propel in certain
* daemon or large-volumne/high-memory operations.
*
* @param boolean $deep Whether to also clear the references on all associated objects.
*/
public function clearAllReferences($deep = false)
{
if ($deep) {
} // if ($deep)
$this->aCcSubjs = null;
}
/**
* Catches calls to virtual methods
*/
public function __call($name, $params)
{
if (preg_match('/get(\w+)/', $name, $matches)) {
$virtualColumn = $matches[1];
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
// no lcfirst in php<5.3...
$virtualColumn[0] = strtolower($virtualColumn[0]);
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
}
throw new PropelException('Call to undefined method: ' . $name);
}
} // BaseCcPerms

View File

@ -0,0 +1,984 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_perms' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPermsPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_perms';
/** the related Propel class for this table */
const OM_CLASS = 'CcPerms';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcPerms';
/** the related TableMap class for this table */
const TM_CLASS = 'CcPermsTableMap';
/** 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 PERMID field */
const PERMID = 'cc_perms.PERMID';
/** the column name for the SUBJ field */
const SUBJ = 'cc_perms.SUBJ';
/** the column name for the ACTION field */
const ACTION = 'cc_perms.ACTION';
/** the column name for the OBJ field */
const OBJ = 'cc_perms.OBJ';
/** the column name for the TYPE field */
const TYPE = 'cc_perms.TYPE';
/**
* An identiy map to hold any loaded instances of CcPerms objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcPerms[]
*/
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 ('Permid', 'Subj', 'Action', 'Obj', 'Type', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('permid', 'subj', 'action', 'obj', 'type', ),
BasePeer::TYPE_COLNAME => array (self::PERMID, self::SUBJ, self::ACTION, self::OBJ, self::TYPE, ),
BasePeer::TYPE_RAW_COLNAME => array ('PERMID', 'SUBJ', 'ACTION', 'OBJ', 'TYPE', ),
BasePeer::TYPE_FIELDNAME => array ('permid', 'subj', 'action', 'obj', 'type', ),
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 ('Permid' => 0, 'Subj' => 1, 'Action' => 2, 'Obj' => 3, 'Type' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ),
BasePeer::TYPE_COLNAME => array (self::PERMID => 0, self::SUBJ => 1, self::ACTION => 2, self::OBJ => 3, self::TYPE => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('PERMID' => 0, 'SUBJ' => 1, 'ACTION' => 2, 'OBJ' => 3, 'TYPE' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 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. CcPermsPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcPermsPeer::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(CcPermsPeer::PERMID);
$criteria->addSelectColumn(CcPermsPeer::SUBJ);
$criteria->addSelectColumn(CcPermsPeer::ACTION);
$criteria->addSelectColumn(CcPermsPeer::OBJ);
$criteria->addSelectColumn(CcPermsPeer::TYPE);
} else {
$criteria->addSelectColumn($alias . '.PERMID');
$criteria->addSelectColumn($alias . '.SUBJ');
$criteria->addSelectColumn($alias . '.ACTION');
$criteria->addSelectColumn($alias . '.OBJ');
$criteria->addSelectColumn($alias . '.TYPE');
}
}
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
{
// we may modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcPermsPeer::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(CcPermsPeer::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 CcPerms
* @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 = CcPermsPeer::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 CcPermsPeer::populateObjects(CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcPermsPeer::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 CcPerms $value A CcPerms object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcPerms $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getPermid();
} // 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 CcPerms object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcPerms) {
$key = (string) $value->getPermid();
} 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 CcPerms 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 CcPerms 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_perms
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* Retrieves the primary key from the DB resultset row
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CcPermsPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcPermsPeer::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;
CcPermsPeer::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 (CcPerms object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcPermsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcPermsPeer::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 + CcPermsPeer::NUM_COLUMNS;
} else {
$cls = CcPermsPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcPermsPeer::addInstanceToPool($obj, $key);
}
return array($obj, $col);
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcPermsPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcPerms objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcPerms objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcPermsPeer::addSelectColumns($criteria);
$startcol = (CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcPermsPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcPermsPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcPermsPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (CcPerms) to $obj2 (CcSubjs)
$obj2->addCcPerms($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcPermsPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcPerms objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcPerms objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcPermsPeer::addSelectColumns($criteria);
$startcol2 = (CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcPermsPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcPermsPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcPermsPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcSubjs rows
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded
// Add the $obj1 (CcPerms) to the collection in $obj2 (CcSubjs)
$obj2->addCcPerms($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* 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(BaseCcPermsPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcPermsPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcPermsTableMap());
}
}
/**
* 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 ? CcPermsPeer::CLASS_DEFAULT : CcPermsPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcPerms or Criteria object.
*
* @param mixed $values Criteria or CcPerms 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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcPerms 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 CcPerms or Criteria object.
*
* @param mixed $values Criteria or CcPerms 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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcPermsPeer::PERMID);
$value = $criteria->remove(CcPermsPeer::PERMID);
if ($value) {
$selectCriteria->add(CcPermsPeer::PERMID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
}
} else { // $values is CcPerms 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_perms 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(CcPermsPeer::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(CcPermsPeer::TABLE_NAME, $con, CcPermsPeer::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).
CcPermsPeer::clearInstancePool();
CcPermsPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcPerms or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcPerms 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(CcPermsPeer::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.
CcPermsPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcPerms) { // it's a model object
// invalidate the cache for this single object
CcPermsPeer::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(CcPermsPeer::PERMID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcPermsPeer::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);
CcPermsPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcPerms 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 CcPerms $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(CcPerms $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcPermsPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, CcPermsPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcPerms
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcPermsPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
$criteria->add(CcPermsPeer::PERMID, $pk);
$v = CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
$criteria->add(CcPermsPeer::PERMID, $pks, Criteria::IN);
$objs = CcPermsPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcPermsPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcPermsPeer::buildTableMap();

View File

@ -0,0 +1,355 @@
<?php
/**
* Base class that represents a query for the 'cc_perms' table.
*
*
*
* @method CcPermsQuery orderByPermid($order = Criteria::ASC) Order by the permid column
* @method CcPermsQuery orderBySubj($order = Criteria::ASC) Order by the subj column
* @method CcPermsQuery orderByAction($order = Criteria::ASC) Order by the action column
* @method CcPermsQuery orderByObj($order = Criteria::ASC) Order by the obj column
* @method CcPermsQuery orderByType($order = Criteria::ASC) Order by the type column
*
* @method CcPermsQuery groupByPermid() Group by the permid column
* @method CcPermsQuery groupBySubj() Group by the subj column
* @method CcPermsQuery groupByAction() Group by the action column
* @method CcPermsQuery groupByObj() Group by the obj column
* @method CcPermsQuery groupByType() Group by the type column
*
* @method CcPermsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcPermsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcPermsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcPermsQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
* @method CcPermsQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method CcPermsQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method CcPerms findOne(PropelPDO $con = null) Return the first CcPerms matching the query
* @method CcPerms findOneOrCreate(PropelPDO $con = null) Return the first CcPerms matching the query, or a new CcPerms object populated from the query conditions when no match is found
*
* @method CcPerms findOneByPermid(int $permid) Return the first CcPerms filtered by the permid column
* @method CcPerms findOneBySubj(int $subj) Return the first CcPerms filtered by the subj column
* @method CcPerms findOneByAction(string $action) Return the first CcPerms filtered by the action column
* @method CcPerms findOneByObj(int $obj) Return the first CcPerms filtered by the obj column
* @method CcPerms findOneByType(string $type) Return the first CcPerms filtered by the type column
*
* @method array findByPermid(int $permid) Return CcPerms objects filtered by the permid column
* @method array findBySubj(int $subj) Return CcPerms objects filtered by the subj column
* @method array findByAction(string $action) Return CcPerms objects filtered by the action column
* @method array findByObj(int $obj) Return CcPerms objects filtered by the obj column
* @method array findByType(string $type) Return CcPerms objects filtered by the type column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPermsQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcPermsQuery 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 = 'campcaster', $modelName = 'CcPerms', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcPermsQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcPermsQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcPermsQuery) {
return $criteria;
}
$query = new CcPermsQuery();
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 CcPerms|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcPermsPeer::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 CcPermsQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcPermsPeer::PERMID, $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 CcPermsQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcPermsPeer::PERMID, $keys, Criteria::IN);
}
/**
* Filter the query on the permid column
*
* @param int|array $permid 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 CcPermsQuery The current query, for fluid interface
*/
public function filterByPermid($permid = null, $comparison = null)
{
if (is_array($permid) && null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(CcPermsPeer::PERMID, $permid, $comparison);
}
/**
* Filter the query on the subj column
*
* @param int|array $subj 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 CcPermsQuery The current query, for fluid interface
*/
public function filterBySubj($subj = null, $comparison = null)
{
if (is_array($subj)) {
$useMinMax = false;
if (isset($subj['min'])) {
$this->addUsingAlias(CcPermsPeer::SUBJ, $subj['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($subj['max'])) {
$this->addUsingAlias(CcPermsPeer::SUBJ, $subj['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPermsPeer::SUBJ, $subj, $comparison);
}
/**
* Filter the query on the action column
*
* @param string $action 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 CcPermsQuery The current query, for fluid interface
*/
public function filterByAction($action = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($action)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $action)) {
$action = str_replace('*', '%', $action);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPermsPeer::ACTION, $action, $comparison);
}
/**
* Filter the query on the obj column
*
* @param int|array $obj 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 CcPermsQuery The current query, for fluid interface
*/
public function filterByObj($obj = null, $comparison = null)
{
if (is_array($obj)) {
$useMinMax = false;
if (isset($obj['min'])) {
$this->addUsingAlias(CcPermsPeer::OBJ, $obj['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($obj['max'])) {
$this->addUsingAlias(CcPermsPeer::OBJ, $obj['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPermsPeer::OBJ, $obj, $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 CcPermsQuery 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(CcPermsPeer::TYPE, $type, $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 CcPermsQuery The current query, for fluid interface
*/
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->getId(), $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 CcPermsQuery 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 CcPerms $ccPerms Object to remove from the list of results
*
* @return CcPermsQuery The current query, for fluid interface
*/
public function prune($ccPerms = null)
{
if ($ccPerms) {
$this->addUsingAlias(CcPermsPeer::PERMID, $ccPerms->getPermid(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcPermsQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,510 @@
<?php
/**
* Base class that represents a query for the 'cc_playlist' table.
*
*
*
* @method CcPlaylistQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcPlaylistQuery orderByName($order = Criteria::ASC) Order by the name column
* @method CcPlaylistQuery orderByState($order = Criteria::ASC) Order by the state column
* @method CcPlaylistQuery orderByCurrentlyaccessing($order = Criteria::ASC) Order by the currentlyaccessing column
* @method CcPlaylistQuery orderByEditedby($order = Criteria::ASC) Order by the editedby column
* @method CcPlaylistQuery orderByMtime($order = Criteria::ASC) Order by the mtime column
* @method CcPlaylistQuery orderByCreator($order = Criteria::ASC) Order by the creator column
* @method CcPlaylistQuery orderByDescription($order = Criteria::ASC) Order by the description column
*
* @method CcPlaylistQuery groupById() Group by the id column
* @method CcPlaylistQuery groupByName() Group by the name column
* @method CcPlaylistQuery groupByState() Group by the state column
* @method CcPlaylistQuery groupByCurrentlyaccessing() Group by the currentlyaccessing column
* @method CcPlaylistQuery groupByEditedby() Group by the editedby column
* @method CcPlaylistQuery groupByMtime() Group by the mtime column
* @method CcPlaylistQuery groupByCreator() Group by the creator column
* @method CcPlaylistQuery groupByDescription() Group by the description column
*
* @method CcPlaylistQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcPlaylistQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcPlaylistQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcPlaylistQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
* @method CcPlaylistQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method CcPlaylistQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method CcPlaylistQuery leftJoinCcPlaylistcontents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlaylistcontents relation
* @method CcPlaylistQuery rightJoinCcPlaylistcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylistcontents relation
* @method CcPlaylistQuery innerJoinCcPlaylistcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylistcontents relation
*
* @method CcPlaylist findOne(PropelPDO $con = null) Return the first CcPlaylist matching the query
* @method CcPlaylist findOneOrCreate(PropelPDO $con = null) Return the first CcPlaylist matching the query, or a new CcPlaylist object populated from the query conditions when no match is found
*
* @method CcPlaylist findOneById(int $id) Return the first CcPlaylist filtered by the id column
* @method CcPlaylist findOneByName(string $name) Return the first CcPlaylist filtered by the name column
* @method CcPlaylist findOneByState(string $state) Return the first CcPlaylist filtered by the state column
* @method CcPlaylist findOneByCurrentlyaccessing(int $currentlyaccessing) Return the first CcPlaylist filtered by the currentlyaccessing column
* @method CcPlaylist findOneByEditedby(int $editedby) Return the first CcPlaylist filtered by the editedby column
* @method CcPlaylist findOneByMtime(string $mtime) Return the first CcPlaylist filtered by the mtime column
* @method CcPlaylist findOneByCreator(string $creator) Return the first CcPlaylist filtered by the creator column
* @method CcPlaylist findOneByDescription(string $description) Return the first CcPlaylist filtered by the description column
*
* @method array findById(int $id) Return CcPlaylist objects filtered by the id column
* @method array findByName(string $name) Return CcPlaylist objects filtered by the name column
* @method array findByState(string $state) Return CcPlaylist objects filtered by the state column
* @method array findByCurrentlyaccessing(int $currentlyaccessing) Return CcPlaylist objects filtered by the currentlyaccessing column
* @method array findByEditedby(int $editedby) Return CcPlaylist objects filtered by the editedby column
* @method array findByMtime(string $mtime) Return CcPlaylist objects filtered by the mtime column
* @method array findByCreator(string $creator) Return CcPlaylist objects filtered by the creator column
* @method array findByDescription(string $description) Return CcPlaylist objects filtered by the description column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPlaylistQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcPlaylistQuery 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 = 'campcaster', $modelName = 'CcPlaylist', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcPlaylistQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcPlaylistQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcPlaylistQuery) {
return $criteria;
}
$query = new CcPlaylistQuery();
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 CcPlaylist|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcPlaylistPeer::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 CcPlaylistQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcPlaylistPeer::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 CcPlaylistQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcPlaylistPeer::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 CcPlaylistQuery 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(CcPlaylistPeer::ID, $id, $comparison);
}
/**
* Filter the query on the name column
*
* @param string $name The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByName($name = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($name)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $name)) {
$name = str_replace('*', '%', $name);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPlaylistPeer::NAME, $name, $comparison);
}
/**
* Filter the query on the state column
*
* @param string $state The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByState($state = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($state)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $state)) {
$state = str_replace('*', '%', $state);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPlaylistPeer::STATE, $state, $comparison);
}
/**
* Filter the query on the currentlyaccessing column
*
* @param int|array $currentlyaccessing The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByCurrentlyaccessing($currentlyaccessing = null, $comparison = null)
{
if (is_array($currentlyaccessing)) {
$useMinMax = false;
if (isset($currentlyaccessing['min'])) {
$this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $currentlyaccessing['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($currentlyaccessing['max'])) {
$this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $currentlyaccessing['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $currentlyaccessing, $comparison);
}
/**
* Filter the query on the editedby column
*
* @param int|array $editedby The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByEditedby($editedby = null, $comparison = null)
{
if (is_array($editedby)) {
$useMinMax = false;
if (isset($editedby['min'])) {
$this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $editedby['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($editedby['max'])) {
$this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $editedby['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $editedby, $comparison);
}
/**
* Filter the query on the mtime column
*
* @param string|array $mtime The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByMtime($mtime = null, $comparison = null)
{
if (is_array($mtime)) {
$useMinMax = false;
if (isset($mtime['min'])) {
$this->addUsingAlias(CcPlaylistPeer::MTIME, $mtime['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($mtime['max'])) {
$this->addUsingAlias(CcPlaylistPeer::MTIME, $mtime['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistPeer::MTIME, $mtime, $comparison);
}
/**
* Filter the query on the creator column
*
* @param string $creator The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByCreator($creator = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($creator)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $creator)) {
$creator = str_replace('*', '%', $creator);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPlaylistPeer::CREATOR, $creator, $comparison);
}
/**
* Filter the query on the description column
*
* @param string $description The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByDescription($description = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($description)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $description)) {
$description = str_replace('*', '%', $description);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPlaylistPeer::DESCRIPTION, $description, $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 CcPlaylistQuery The current query, for fluid interface
*/
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcPlaylistPeer::EDITEDBY, $ccSubjs->getId(), $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 CcPlaylistQuery 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');
}
/**
* Filter the query by a related CcPlaylistcontents object
*
* @param CcPlaylistcontents $ccPlaylistcontents the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null)
{
return $this
->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylistcontents->getPlaylistId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcPlaylistcontents relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function joinCcPlaylistcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcPlaylistcontents');
// 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, 'CcPlaylistcontents');
}
return $this;
}
/**
* Use the CcPlaylistcontents relation CcPlaylistcontents 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 CcPlaylistcontentsQuery A secondary query class using the current class as primary query
*/
public function useCcPlaylistcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcPlaylistcontents($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery');
}
/**
* Exclude object from result
*
* @param CcPlaylist $ccPlaylist Object to remove from the list of results
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function prune($ccPlaylist = null)
{
if ($ccPlaylist) {
$this->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylist->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcPlaylistQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,581 @@
<?php
/**
* Base class that represents a query for the 'cc_playlistcontents' table.
*
*
*
* @method CcPlaylistcontentsQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcPlaylistcontentsQuery orderByPlaylistId($order = Criteria::ASC) Order by the playlist_id column
* @method CcPlaylistcontentsQuery orderByFileId($order = Criteria::ASC) Order by the file_id column
* @method CcPlaylistcontentsQuery orderByPosition($order = Criteria::ASC) Order by the position column
* @method CcPlaylistcontentsQuery orderByCliplength($order = Criteria::ASC) Order by the cliplength column
* @method CcPlaylistcontentsQuery orderByCuein($order = Criteria::ASC) Order by the cuein column
* @method CcPlaylistcontentsQuery orderByCueout($order = Criteria::ASC) Order by the cueout column
* @method CcPlaylistcontentsQuery orderByFadein($order = Criteria::ASC) Order by the fadein column
* @method CcPlaylistcontentsQuery orderByFadeout($order = Criteria::ASC) Order by the fadeout column
*
* @method CcPlaylistcontentsQuery groupById() Group by the id column
* @method CcPlaylistcontentsQuery groupByPlaylistId() Group by the playlist_id column
* @method CcPlaylistcontentsQuery groupByFileId() Group by the file_id column
* @method CcPlaylistcontentsQuery groupByPosition() Group by the position column
* @method CcPlaylistcontentsQuery groupByCliplength() Group by the cliplength column
* @method CcPlaylistcontentsQuery groupByCuein() Group by the cuein column
* @method CcPlaylistcontentsQuery groupByCueout() Group by the cueout column
* @method CcPlaylistcontentsQuery groupByFadein() Group by the fadein column
* @method CcPlaylistcontentsQuery groupByFadeout() Group by the fadeout column
*
* @method CcPlaylistcontentsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcPlaylistcontentsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcPlaylistcontentsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcPlaylistcontentsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
* @method CcPlaylistcontentsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
* @method CcPlaylistcontentsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
*
* @method CcPlaylistcontentsQuery leftJoinCcPlaylist($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlaylist relation
* @method CcPlaylistcontentsQuery rightJoinCcPlaylist($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylist relation
* @method CcPlaylistcontentsQuery innerJoinCcPlaylist($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylist relation
*
* @method CcPlaylistcontents findOne(PropelPDO $con = null) Return the first CcPlaylistcontents matching the query
* @method CcPlaylistcontents findOneOrCreate(PropelPDO $con = null) Return the first CcPlaylistcontents matching the query, or a new CcPlaylistcontents object populated from the query conditions when no match is found
*
* @method CcPlaylistcontents findOneById(int $id) Return the first CcPlaylistcontents filtered by the id column
* @method CcPlaylistcontents findOneByPlaylistId(int $playlist_id) Return the first CcPlaylistcontents filtered by the playlist_id column
* @method CcPlaylistcontents findOneByFileId(int $file_id) Return the first CcPlaylistcontents filtered by the file_id column
* @method CcPlaylistcontents findOneByPosition(int $position) Return the first CcPlaylistcontents filtered by the position column
* @method CcPlaylistcontents findOneByCliplength(string $cliplength) Return the first CcPlaylistcontents filtered by the cliplength column
* @method CcPlaylistcontents findOneByCuein(string $cuein) Return the first CcPlaylistcontents filtered by the cuein column
* @method CcPlaylistcontents findOneByCueout(string $cueout) Return the first CcPlaylistcontents filtered by the cueout column
* @method CcPlaylistcontents findOneByFadein(string $fadein) Return the first CcPlaylistcontents filtered by the fadein column
* @method CcPlaylistcontents findOneByFadeout(string $fadeout) Return the first CcPlaylistcontents filtered by the fadeout column
*
* @method array findById(int $id) Return CcPlaylistcontents objects filtered by the id column
* @method array findByPlaylistId(int $playlist_id) Return CcPlaylistcontents objects filtered by the playlist_id column
* @method array findByFileId(int $file_id) Return CcPlaylistcontents objects filtered by the file_id column
* @method array findByPosition(int $position) Return CcPlaylistcontents objects filtered by the position column
* @method array findByCliplength(string $cliplength) Return CcPlaylistcontents objects filtered by the cliplength column
* @method array findByCuein(string $cuein) Return CcPlaylistcontents objects filtered by the cuein column
* @method array findByCueout(string $cueout) Return CcPlaylistcontents objects filtered by the cueout column
* @method array findByFadein(string $fadein) Return CcPlaylistcontents objects filtered by the fadein column
* @method array findByFadeout(string $fadeout) Return CcPlaylistcontents objects filtered by the fadeout column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPlaylistcontentsQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcPlaylistcontentsQuery 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 = 'campcaster', $modelName = 'CcPlaylistcontents', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcPlaylistcontentsQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcPlaylistcontentsQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcPlaylistcontentsQuery) {
return $criteria;
}
$query = new CcPlaylistcontentsQuery();
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 CcPlaylistcontents|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery 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(CcPlaylistcontentsPeer::ID, $id, $comparison);
}
/**
* Filter the query on the playlist_id column
*
* @param int|array $playlistId 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByPlaylistId($playlistId = null, $comparison = null)
{
if (is_array($playlistId)) {
$useMinMax = false;
if (isset($playlistId['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $playlistId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($playlistId['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $playlistId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $playlistId, $comparison);
}
/**
* Filter the query on the file_id column
*
* @param int|array $fileId 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByFileId($fileId = null, $comparison = null)
{
if (is_array($fileId)) {
$useMinMax = false;
if (isset($fileId['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $fileId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($fileId['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $fileId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $fileId, $comparison);
}
/**
* Filter the query on the position column
*
* @param int|array $position 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByPosition($position = null, $comparison = null)
{
if (is_array($position)) {
$useMinMax = false;
if (isset($position['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $position['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($position['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $position['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $position, $comparison);
}
/**
* Filter the query on the cliplength column
*
* @param string|array $cliplength 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByCliplength($cliplength = null, $comparison = null)
{
if (is_array($cliplength)) {
$useMinMax = false;
if (isset($cliplength['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $cliplength['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cliplength['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $cliplength['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $cliplength, $comparison);
}
/**
* Filter the query on the cuein column
*
* @param string|array $cuein 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByCuein($cuein = null, $comparison = null)
{
if (is_array($cuein)) {
$useMinMax = false;
if (isset($cuein['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $cuein['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cuein['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $cuein['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $cuein, $comparison);
}
/**
* Filter the query on the cueout column
*
* @param string|array $cueout 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByCueout($cueout = null, $comparison = null)
{
if (is_array($cueout)) {
$useMinMax = false;
if (isset($cueout['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $cueout['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cueout['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $cueout['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $cueout, $comparison);
}
/**
* Filter the query on the fadein column
*
* @param string|array $fadein 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByFadein($fadein = null, $comparison = null)
{
if (is_array($fadein)) {
$useMinMax = false;
if (isset($fadein['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $fadein['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($fadein['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $fadein['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $fadein, $comparison);
}
/**
* Filter the query on the fadeout column
*
* @param string|array $fadeout 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 CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByFadeout($fadeout = null, $comparison = null)
{
if (is_array($fadeout)) {
$useMinMax = false;
if (isset($fadeout['min'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $fadeout['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($fadeout['max'])) {
$this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $fadeout['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $fadeout, $comparison);
}
/**
* Filter the query by a related CcFiles object
*
* @param CcFiles $ccFiles the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByCcFiles($ccFiles, $comparison = null)
{
return $this
->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $ccFiles->getId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcFiles relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcFiles');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcFiles');
}
return $this;
}
/**
* Use the CcFiles relation CcFiles object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcFilesQuery A secondary query class using the current class as primary query
*/
public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcFiles($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
}
/**
* Filter the query by a related CcPlaylist object
*
* @param CcPlaylist $ccPlaylist the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function filterByCcPlaylist($ccPlaylist, $comparison = null)
{
return $this
->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $ccPlaylist->getId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcPlaylist relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcPlaylist');
// 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, 'CcPlaylist');
}
return $this;
}
/**
* Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query
*/
public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcPlaylist($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery');
}
/**
* Exclude object from result
*
* @param CcPlaylistcontents $ccPlaylistcontents Object to remove from the list of results
*
* @return CcPlaylistcontentsQuery The current query, for fluid interface
*/
public function prune($ccPlaylistcontents = null)
{
if ($ccPlaylistcontents) {
$this->addUsingAlias(CcPlaylistcontentsPeer::ID, $ccPlaylistcontents->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcPlaylistcontentsQuery

View File

@ -0,0 +1,905 @@
<?php
/**
* Base class that represents a row from the 'cc_pref' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPref extends BaseObject implements Persistent
{
/**
* Peer class name
*/
const PEER = 'CcPrefPeer';
/**
* 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 CcPrefPeer
*/
protected static $peer;
/**
* The value for the id field.
* @var int
*/
protected $id;
/**
* The value for the subjid field.
* @var int
*/
protected $subjid;
/**
* The value for the keystr field.
* @var string
*/
protected $keystr;
/**
* The value for the valstr field.
* @var string
*/
protected $valstr;
/**
* @var CcSubjs
*/
protected $aCcSubjs;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInSave = false;
/**
* Flag to prevent endless validation loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
*/
protected $alreadyInValidation = false;
/**
* Get the [id] column value.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Get the [subjid] column value.
*
* @return int
*/
public function getSubjid()
{
return $this->subjid;
}
/**
* Get the [keystr] column value.
*
* @return string
*/
public function getKeystr()
{
return $this->keystr;
}
/**
* Get the [valstr] column value.
*
* @return string
*/
public function getValstr()
{
return $this->valstr;
}
/**
* Set the value of [id] column.
*
* @param int $v new value
* @return CcPref The current object (for fluent API support)
*/
public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CcPrefPeer::ID;
}
return $this;
} // setId()
/**
* Set the value of [subjid] column.
*
* @param int $v new value
* @return CcPref The current object (for fluent API support)
*/
public function setSubjid($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->subjid !== $v) {
$this->subjid = $v;
$this->modifiedColumns[] = CcPrefPeer::SUBJID;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
$this->aCcSubjs = null;
}
return $this;
} // setSubjid()
/**
* Set the value of [keystr] column.
*
* @param string $v new value
* @return CcPref The current object (for fluent API support)
*/
public function setKeystr($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->keystr !== $v) {
$this->keystr = $v;
$this->modifiedColumns[] = CcPrefPeer::KEYSTR;
}
return $this;
} // setKeystr()
/**
* Set the value of [valstr] column.
*
* @param string $v new value
* @return CcPref The current object (for fluent API support)
*/
public function setValstr($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->valstr !== $v) {
$this->valstr = $v;
$this->modifiedColumns[] = CcPrefPeer::VALSTR;
}
return $this;
} // setValstr()
/**
* Indicates whether the columns in this object are only set to default values.
*
* This method can be used in conjunction with isModified() to indicate whether an object is both
* modified _and_ has some values set which are non-default.
*
* @return boolean Whether the columns in this object are only been set with default values.
*/
public function hasOnlyDefaultValues()
{
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
* An offset (0-based "start column") is specified so that objects can be hydrated
* with a subset of the columns in the resultset rows. This is needed, for example,
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->subjid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->keystr = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->valstr = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->resetModified();
$this->setNew(false);
if ($rehydrate) {
$this->ensureConsistency();
}
return $startcol + 4; // 4 = CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcPref 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()
{
if ($this->aCcSubjs !== null && $this->subjid !== $this->aCcSubjs->getId()) {
$this->aCcSubjs = null;
}
} // 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(CcPrefPeer::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 = CcPrefPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
$row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor();
if (!$row) {
throw new PropelException('Cannot find matching row in the database to reload object values.');
}
$this->hydrate($row, 0, true); // rehydrate
if ($deep) { // also de-associate any related objects?
$this->aCcSubjs = null;
} // if (deep)
}
/**
* Removes this object from datastore and sets delete attribute.
*
* @param PropelPDO $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
if ($ret) {
CcPrefQuery::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(CcPrefPeer::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);
CcPrefPeer::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;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcSubjs !== null) {
if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) {
$affectedRows += $this->aCcSubjs->save($con);
}
$this->setCcSubjs($this->aCcSubjs);
}
if ($this->isNew() ) {
$this->modifiedColumns[] = CcPrefPeer::ID;
}
// If this object has been modified, then save it to the database.
if ($this->isModified()) {
if ($this->isNew()) {
$criteria = $this->buildCriteria();
if ($criteria->keyContainsValue(CcPrefPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPrefPeer::ID.')');
}
$pk = BasePeer::doInsert($criteria, $con);
$affectedRows += 1;
$this->setId($pk); //[IMV] update autoincrement primary key
$this->setNew(false);
} else {
$affectedRows += CcPrefPeer::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();
// We call the validate method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcSubjs !== null) {
if (!$this->aCcSubjs->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures());
}
}
if (($retval = CcPrefPeer::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 = CcPrefPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
}
/**
* Retrieves a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
*/
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getSubjid();
break;
case 2:
return $this->getKeystr();
break;
case 3:
return $this->getValstr();
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.
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false)
{
$keys = CcPrefPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getSubjid(),
$keys[2] => $this->getKeystr(),
$keys[3] => $this->getValstr(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcSubjs) {
$result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true);
}
}
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 = CcPrefPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
/**
* Sets a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
*/
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setSubjid($value);
break;
case 2:
$this->setKeystr($value);
break;
case 3:
$this->setValstr($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 = CcPrefPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setSubjid($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setKeystr($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setValstr($arr[$keys[3]]);
}
/**
* 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(CcPrefPeer::DATABASE_NAME);
if ($this->isColumnModified(CcPrefPeer::ID)) $criteria->add(CcPrefPeer::ID, $this->id);
if ($this->isColumnModified(CcPrefPeer::SUBJID)) $criteria->add(CcPrefPeer::SUBJID, $this->subjid);
if ($this->isColumnModified(CcPrefPeer::KEYSTR)) $criteria->add(CcPrefPeer::KEYSTR, $this->keystr);
if ($this->isColumnModified(CcPrefPeer::VALSTR)) $criteria->add(CcPrefPeer::VALSTR, $this->valstr);
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(CcPrefPeer::DATABASE_NAME);
$criteria->add(CcPrefPeer::ID, $this->id);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return int
*/
public function getPrimaryKey()
{
return $this->getId();
}
/**
* Generic method to set the primary key (id column).
*
* @param int $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setId($key);
}
/**
* Returns true if the primary key for this object is null.
* @return boolean
*/
public function isPrimaryKeyNull()
{
return null === $this->getId();
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of CcPref (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->setSubjid($this->subjid);
$copyObj->setKeystr($this->keystr);
$copyObj->setValstr($this->valstr);
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
}
/**
* Makes a copy of this object that will be inserted as a new row in table when saved.
* It creates a new object filling in the simple attributes, but skipping any primary
* keys that are defined for the table.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @return CcPref 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 CcPrefPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CcPrefPeer();
}
return self::$peer;
}
/**
* Declares an association between this object and a CcSubjs object.
*
* @param CcSubjs $v
* @return CcPref The current object (for fluent API support)
* @throws PropelException
*/
public function setCcSubjs(CcSubjs $v = null)
{
if ($v === null) {
$this->setSubjid(NULL);
} else {
$this->setSubjid($v->getId());
}
$this->aCcSubjs = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcSubjs object, it will not be re-added.
if ($v !== null) {
$v->addCcPref($this);
}
return $this;
}
/**
* Get the associated CcSubjs object
*
* @param PropelPDO Optional Connection object.
* @return CcSubjs The associated CcSubjs object.
* @throws PropelException
*/
public function getCcSubjs(PropelPDO $con = null)
{
if ($this->aCcSubjs === null && ($this->subjid !== null)) {
$this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subjid, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aCcSubjs->addCcPrefs($this);
*/
}
return $this->aCcSubjs;
}
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->id = null;
$this->subjid = null;
$this->keystr = null;
$this->valstr = 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)
$this->aCcSubjs = null;
}
/**
* Catches calls to virtual methods
*/
public function __call($name, $params)
{
if (preg_match('/get(\w+)/', $name, $matches)) {
$virtualColumn = $matches[1];
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
// no lcfirst in php<5.3...
$virtualColumn[0] = strtolower($virtualColumn[0]);
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
}
throw new PropelException('Call to undefined method: ' . $name);
}
} // BaseCcPref

View File

@ -0,0 +1,983 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_pref' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPrefPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_pref';
/** the related Propel class for this table */
const OM_CLASS = 'CcPref';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcPref';
/** the related TableMap class for this table */
const TM_CLASS = 'CcPrefTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 4;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'cc_pref.ID';
/** the column name for the SUBJID field */
const SUBJID = 'cc_pref.SUBJID';
/** the column name for the KEYSTR field */
const KEYSTR = 'cc_pref.KEYSTR';
/** the column name for the VALSTR field */
const VALSTR = 'cc_pref.VALSTR';
/**
* An identiy map to hold any loaded instances of CcPref objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcPref[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Subjid', 'Keystr', 'Valstr', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'subjid', 'keystr', 'valstr', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::SUBJID, self::KEYSTR, self::VALSTR, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SUBJID', 'KEYSTR', 'VALSTR', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'subjid', 'keystr', 'valstr', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Subjid' => 1, 'Keystr' => 2, 'Valstr' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'subjid' => 1, 'keystr' => 2, 'valstr' => 3, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SUBJID => 1, self::KEYSTR => 2, self::VALSTR => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SUBJID' => 1, 'KEYSTR' => 2, 'VALSTR' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'subjid' => 1, 'keystr' => 2, 'valstr' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
* 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. CcPrefPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcPrefPeer::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(CcPrefPeer::ID);
$criteria->addSelectColumn(CcPrefPeer::SUBJID);
$criteria->addSelectColumn(CcPrefPeer::KEYSTR);
$criteria->addSelectColumn(CcPrefPeer::VALSTR);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.SUBJID');
$criteria->addSelectColumn($alias . '.KEYSTR');
$criteria->addSelectColumn($alias . '.VALSTR');
}
}
/**
* 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(CcPrefPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcPrefPeer::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(CcPrefPeer::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 CcPref
* @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 = CcPrefPeer::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 CcPrefPeer::populateObjects(CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcPrefPeer::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 CcPref $value A CcPref object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcPref $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A CcPref object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcPref) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcPref 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 CcPref 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_pref
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* Retrieves the primary key from the DB resultset row
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CcPrefPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcPrefPeer::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;
CcPrefPeer::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 (CcPref object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcPrefPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcPrefPeer::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 + CcPrefPeer::NUM_COLUMNS;
} else {
$cls = CcPrefPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcPrefPeer::addInstanceToPool($obj, $key);
}
return array($obj, $col);
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcPrefPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcPrefPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcPref objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcPref objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcPrefPeer::addSelectColumns($criteria);
$startcol = (CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcPrefPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcPrefPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcPrefPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (CcPref) to $obj2 (CcSubjs)
$obj2->addCcPref($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcPrefPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcPrefPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcPref objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcPref objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcPrefPeer::addSelectColumns($criteria);
$startcol2 = (CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcPrefPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcPrefPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcPrefPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcSubjs rows
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded
// Add the $obj1 (CcPref) to the collection in $obj2 (CcSubjs)
$obj2->addCcPref($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* 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(BaseCcPrefPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcPrefPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcPrefTableMap());
}
}
/**
* 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 ? CcPrefPeer::CLASS_DEFAULT : CcPrefPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcPref or Criteria object.
*
* @param mixed $values Criteria or CcPref 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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcPref object
}
if ($criteria->containsKey(CcPrefPeer::ID) && $criteria->keyContainsValue(CcPrefPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPrefPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->beginTransaction();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollBack();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a CcPref or Criteria object.
*
* @param mixed $values Criteria or CcPref 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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcPrefPeer::ID);
$value = $criteria->remove(CcPrefPeer::ID);
if ($value) {
$selectCriteria->add(CcPrefPeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcPrefPeer::TABLE_NAME);
}
} else { // $values is CcPref 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_pref 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(CcPrefPeer::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(CcPrefPeer::TABLE_NAME, $con, CcPrefPeer::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).
CcPrefPeer::clearInstancePool();
CcPrefPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcPref or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcPref 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(CcPrefPeer::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.
CcPrefPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcPref) { // it's a model object
// invalidate the cache for this single object
CcPrefPeer::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(CcPrefPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcPrefPeer::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);
CcPrefPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcPref 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 CcPref $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(CcPref $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcPrefPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, CcPrefPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcPref
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcPrefPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcPrefPeer::DATABASE_NAME);
$criteria->add(CcPrefPeer::ID, $pk);
$v = CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcPrefPeer::DATABASE_NAME);
$criteria->add(CcPrefPeer::ID, $pks, Criteria::IN);
$objs = CcPrefPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcPrefPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcPrefPeer::buildTableMap();

View File

@ -0,0 +1,320 @@
<?php
/**
* Base class that represents a query for the 'cc_pref' table.
*
*
*
* @method CcPrefQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcPrefQuery orderBySubjid($order = Criteria::ASC) Order by the subjid column
* @method CcPrefQuery orderByKeystr($order = Criteria::ASC) Order by the keystr column
* @method CcPrefQuery orderByValstr($order = Criteria::ASC) Order by the valstr column
*
* @method CcPrefQuery groupById() Group by the id column
* @method CcPrefQuery groupBySubjid() Group by the subjid column
* @method CcPrefQuery groupByKeystr() Group by the keystr column
* @method CcPrefQuery groupByValstr() Group by the valstr column
*
* @method CcPrefQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcPrefQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcPrefQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcPrefQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
* @method CcPrefQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method CcPrefQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method CcPref findOne(PropelPDO $con = null) Return the first CcPref matching the query
* @method CcPref findOneOrCreate(PropelPDO $con = null) Return the first CcPref matching the query, or a new CcPref object populated from the query conditions when no match is found
*
* @method CcPref findOneById(int $id) Return the first CcPref filtered by the id column
* @method CcPref findOneBySubjid(int $subjid) Return the first CcPref filtered by the subjid column
* @method CcPref findOneByKeystr(string $keystr) Return the first CcPref filtered by the keystr column
* @method CcPref findOneByValstr(string $valstr) Return the first CcPref filtered by the valstr column
*
* @method array findById(int $id) Return CcPref objects filtered by the id column
* @method array findBySubjid(int $subjid) Return CcPref objects filtered by the subjid column
* @method array findByKeystr(string $keystr) Return CcPref objects filtered by the keystr column
* @method array findByValstr(string $valstr) Return CcPref objects filtered by the valstr column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcPrefQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcPrefQuery 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 = 'campcaster', $modelName = 'CcPref', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcPrefQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcPrefQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcPrefQuery) {
return $criteria;
}
$query = new CcPrefQuery();
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 CcPref|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcPrefPeer::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 CcPrefQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcPrefPeer::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 CcPrefQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcPrefPeer::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 CcPrefQuery 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(CcPrefPeer::ID, $id, $comparison);
}
/**
* Filter the query on the subjid column
*
* @param int|array $subjid 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 CcPrefQuery The current query, for fluid interface
*/
public function filterBySubjid($subjid = null, $comparison = null)
{
if (is_array($subjid)) {
$useMinMax = false;
if (isset($subjid['min'])) {
$this->addUsingAlias(CcPrefPeer::SUBJID, $subjid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($subjid['max'])) {
$this->addUsingAlias(CcPrefPeer::SUBJID, $subjid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid, $comparison);
}
/**
* Filter the query on the keystr column
*
* @param string $keystr 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 CcPrefQuery The current query, for fluid interface
*/
public function filterByKeystr($keystr = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($keystr)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $keystr)) {
$keystr = str_replace('*', '%', $keystr);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPrefPeer::KEYSTR, $keystr, $comparison);
}
/**
* Filter the query on the valstr column
*
* @param string $valstr 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 CcPrefQuery The current query, for fluid interface
*/
public function filterByValstr($valstr = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($valstr)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $valstr)) {
$valstr = str_replace('*', '%', $valstr);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPrefPeer::VALSTR, $valstr, $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 CcPrefQuery The current query, for fluid interface
*/
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcPrefPeer::SUBJID, $ccSubjs->getId(), $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 CcPrefQuery 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 CcPref $ccPref Object to remove from the list of results
*
* @return CcPrefQuery The current query, for fluid interface
*/
public function prune($ccPref = null)
{
if ($ccPref) {
$this->addUsingAlias(CcPrefPeer::ID, $ccPref->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcPrefQuery

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,780 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_schedule' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSchedulePeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_schedule';
/** the related Propel class for this table */
const OM_CLASS = 'CcSchedule';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcSchedule';
/** the related TableMap class for this table */
const TM_CLASS = 'CcScheduleTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 11;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'cc_schedule.ID';
/** the column name for the PLAYLIST_ID field */
const PLAYLIST_ID = 'cc_schedule.PLAYLIST_ID';
/** the column name for the STARTS field */
const STARTS = 'cc_schedule.STARTS';
/** the column name for the ENDS field */
const ENDS = 'cc_schedule.ENDS';
/** the column name for the GROUP_ID field */
const GROUP_ID = 'cc_schedule.GROUP_ID';
/** the column name for the FILE_ID field */
const FILE_ID = 'cc_schedule.FILE_ID';
/** the column name for the CLIP_LENGTH field */
const CLIP_LENGTH = 'cc_schedule.CLIP_LENGTH';
/** the column name for the FADE_IN field */
const FADE_IN = 'cc_schedule.FADE_IN';
/** the column name for the FADE_OUT field */
const FADE_OUT = 'cc_schedule.FADE_OUT';
/** the column name for the CUE_IN field */
const CUE_IN = 'cc_schedule.CUE_IN';
/** the column name for the CUE_OUT field */
const CUE_OUT = 'cc_schedule.CUE_OUT';
/**
* An identiy map to hold any loaded instances of CcSchedule objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcSchedule[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'PlaylistId', 'Starts', 'Ends', 'GroupId', 'FileId', 'ClipLength', 'FadeIn', 'FadeOut', 'CueIn', 'CueOut', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'playlistId', 'starts', 'ends', 'groupId', 'fileId', 'clipLength', 'fadeIn', 'fadeOut', 'cueIn', 'cueOut', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::STARTS, self::ENDS, self::GROUP_ID, self::FILE_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'STARTS', 'ENDS', 'GROUP_ID', 'FILE_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'starts', 'ends', 'group_id', 'file_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'PlaylistId' => 1, 'Starts' => 2, 'Ends' => 3, 'GroupId' => 4, 'FileId' => 5, 'ClipLength' => 6, 'FadeIn' => 7, 'FadeOut' => 8, 'CueIn' => 9, 'CueOut' => 10, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'playlistId' => 1, 'starts' => 2, 'ends' => 3, 'groupId' => 4, 'fileId' => 5, 'clipLength' => 6, 'fadeIn' => 7, 'fadeOut' => 8, 'cueIn' => 9, 'cueOut' => 10, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::STARTS => 2, self::ENDS => 3, self::GROUP_ID => 4, self::FILE_ID => 5, self::CLIP_LENGTH => 6, self::FADE_IN => 7, self::FADE_OUT => 8, self::CUE_IN => 9, self::CUE_OUT => 10, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'STARTS' => 2, 'ENDS' => 3, 'GROUP_ID' => 4, 'FILE_ID' => 5, 'CLIP_LENGTH' => 6, 'FADE_IN' => 7, 'FADE_OUT' => 8, 'CUE_IN' => 9, 'CUE_OUT' => 10, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'starts' => 2, 'ends' => 3, 'group_id' => 4, 'file_id' => 5, 'clip_length' => 6, 'fade_in' => 7, 'fade_out' => 8, 'cue_in' => 9, 'cue_out' => 10, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
);
/**
* 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. CcSchedulePeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcSchedulePeer::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(CcSchedulePeer::ID);
$criteria->addSelectColumn(CcSchedulePeer::PLAYLIST_ID);
$criteria->addSelectColumn(CcSchedulePeer::STARTS);
$criteria->addSelectColumn(CcSchedulePeer::ENDS);
$criteria->addSelectColumn(CcSchedulePeer::GROUP_ID);
$criteria->addSelectColumn(CcSchedulePeer::FILE_ID);
$criteria->addSelectColumn(CcSchedulePeer::CLIP_LENGTH);
$criteria->addSelectColumn(CcSchedulePeer::FADE_IN);
$criteria->addSelectColumn(CcSchedulePeer::FADE_OUT);
$criteria->addSelectColumn(CcSchedulePeer::CUE_IN);
$criteria->addSelectColumn(CcSchedulePeer::CUE_OUT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PLAYLIST_ID');
$criteria->addSelectColumn($alias . '.STARTS');
$criteria->addSelectColumn($alias . '.ENDS');
$criteria->addSelectColumn($alias . '.GROUP_ID');
$criteria->addSelectColumn($alias . '.FILE_ID');
$criteria->addSelectColumn($alias . '.CLIP_LENGTH');
$criteria->addSelectColumn($alias . '.FADE_IN');
$criteria->addSelectColumn($alias . '.FADE_OUT');
$criteria->addSelectColumn($alias . '.CUE_IN');
$criteria->addSelectColumn($alias . '.CUE_OUT');
}
}
/**
* 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(CcSchedulePeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSchedulePeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
$criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName
if ($con === null) {
$con = Propel::getConnection(CcSchedulePeer::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 CcSchedule
* @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 = CcSchedulePeer::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 CcSchedulePeer::populateObjects(CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcSchedulePeer::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 CcSchedule $value A CcSchedule object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcSchedule $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A CcSchedule object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcSchedule) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcSchedule 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 CcSchedule 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_schedule
* 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 = CcSchedulePeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcSchedulePeer::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;
CcSchedulePeer::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 (CcSchedule object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcSchedulePeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcSchedulePeer::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 + CcSchedulePeer::NUM_COLUMNS;
} else {
$cls = CcSchedulePeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcSchedulePeer::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(BaseCcSchedulePeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcSchedulePeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcScheduleTableMap());
}
}
/**
* 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 ? CcSchedulePeer::CLASS_DEFAULT : CcSchedulePeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcSchedule or Criteria object.
*
* @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcSchedule 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 CcSchedule or Criteria object.
*
* @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcSchedulePeer::ID);
$value = $criteria->remove(CcSchedulePeer::ID);
if ($value) {
$selectCriteria->add(CcSchedulePeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME);
}
} else { // $values is CcSchedule 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_schedule 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(CcSchedulePeer::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(CcSchedulePeer::TABLE_NAME, $con, CcSchedulePeer::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).
CcSchedulePeer::clearInstancePool();
CcSchedulePeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcSchedule or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::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.
CcSchedulePeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcSchedule) { // it's a model object
// invalidate the cache for this single object
CcSchedulePeer::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(CcSchedulePeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcSchedulePeer::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);
CcSchedulePeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcSchedule 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 CcSchedule $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(CcSchedule $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcSchedulePeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, CcSchedulePeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param string $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcSchedule
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcSchedulePeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcSchedulePeer::DATABASE_NAME);
$criteria->add(CcSchedulePeer::ID, $pk);
$v = CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcSchedulePeer::DATABASE_NAME);
$criteria->add(CcSchedulePeer::ID, $pks, Criteria::IN);
$objs = CcSchedulePeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcSchedulePeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcSchedulePeer::buildTableMap();

View File

@ -0,0 +1,515 @@
<?php
/**
* Base class that represents a query for the 'cc_schedule' table.
*
*
*
* @method CcScheduleQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcScheduleQuery orderByPlaylistId($order = Criteria::ASC) Order by the playlist_id column
* @method CcScheduleQuery orderByStarts($order = Criteria::ASC) Order by the starts column
* @method CcScheduleQuery orderByEnds($order = Criteria::ASC) Order by the ends column
* @method CcScheduleQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
* @method CcScheduleQuery orderByFileId($order = Criteria::ASC) Order by the file_id column
* @method CcScheduleQuery orderByClipLength($order = Criteria::ASC) Order by the clip_length column
* @method CcScheduleQuery orderByFadeIn($order = Criteria::ASC) Order by the fade_in column
* @method CcScheduleQuery orderByFadeOut($order = Criteria::ASC) Order by the fade_out column
* @method CcScheduleQuery orderByCueIn($order = Criteria::ASC) Order by the cue_in column
* @method CcScheduleQuery orderByCueOut($order = Criteria::ASC) Order by the cue_out column
*
* @method CcScheduleQuery groupById() Group by the id column
* @method CcScheduleQuery groupByPlaylistId() Group by the playlist_id column
* @method CcScheduleQuery groupByStarts() Group by the starts column
* @method CcScheduleQuery groupByEnds() Group by the ends column
* @method CcScheduleQuery groupByGroupId() Group by the group_id column
* @method CcScheduleQuery groupByFileId() Group by the file_id column
* @method CcScheduleQuery groupByClipLength() Group by the clip_length column
* @method CcScheduleQuery groupByFadeIn() Group by the fade_in column
* @method CcScheduleQuery groupByFadeOut() Group by the fade_out column
* @method CcScheduleQuery groupByCueIn() Group by the cue_in column
* @method CcScheduleQuery groupByCueOut() Group by the cue_out column
*
* @method CcScheduleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcScheduleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcSchedule findOne(PropelPDO $con = null) Return the first CcSchedule matching the query
* @method CcSchedule findOneOrCreate(PropelPDO $con = null) Return the first CcSchedule matching the query, or a new CcSchedule object populated from the query conditions when no match is found
*
* @method CcSchedule findOneById(string $id) Return the first CcSchedule filtered by the id column
* @method CcSchedule findOneByPlaylistId(int $playlist_id) Return the first CcSchedule filtered by the playlist_id column
* @method CcSchedule findOneByStarts(string $starts) Return the first CcSchedule filtered by the starts column
* @method CcSchedule findOneByEnds(string $ends) Return the first CcSchedule filtered by the ends column
* @method CcSchedule findOneByGroupId(int $group_id) Return the first CcSchedule filtered by the group_id column
* @method CcSchedule findOneByFileId(int $file_id) Return the first CcSchedule filtered by the file_id column
* @method CcSchedule findOneByClipLength(string $clip_length) Return the first CcSchedule filtered by the clip_length column
* @method CcSchedule findOneByFadeIn(string $fade_in) Return the first CcSchedule filtered by the fade_in column
* @method CcSchedule findOneByFadeOut(string $fade_out) Return the first CcSchedule filtered by the fade_out column
* @method CcSchedule findOneByCueIn(string $cue_in) Return the first CcSchedule filtered by the cue_in column
* @method CcSchedule findOneByCueOut(string $cue_out) Return the first CcSchedule filtered by the cue_out column
*
* @method array findById(string $id) Return CcSchedule objects filtered by the id column
* @method array findByPlaylistId(int $playlist_id) Return CcSchedule objects filtered by the playlist_id column
* @method array findByStarts(string $starts) Return CcSchedule objects filtered by the starts column
* @method array findByEnds(string $ends) Return CcSchedule objects filtered by the ends column
* @method array findByGroupId(int $group_id) Return CcSchedule objects filtered by the group_id column
* @method array findByFileId(int $file_id) Return CcSchedule objects filtered by the file_id column
* @method array findByClipLength(string $clip_length) Return CcSchedule objects filtered by the clip_length column
* @method array findByFadeIn(string $fade_in) Return CcSchedule objects filtered by the fade_in column
* @method array findByFadeOut(string $fade_out) Return CcSchedule objects filtered by the fade_out column
* @method array findByCueIn(string $cue_in) Return CcSchedule objects filtered by the cue_in column
* @method array findByCueOut(string $cue_out) Return CcSchedule objects filtered by the cue_out column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcScheduleQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcScheduleQuery 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 = 'campcaster', $modelName = 'CcSchedule', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcScheduleQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcScheduleQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcScheduleQuery) {
return $criteria;
}
$query = new CcScheduleQuery();
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 CcSchedule|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcSchedulePeer::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 CcScheduleQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcSchedulePeer::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* @param string|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 CcScheduleQuery 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(CcSchedulePeer::ID, $id, $comparison);
}
/**
* Filter the query on the playlist_id column
*
* @param int|array $playlistId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByPlaylistId($playlistId = null, $comparison = null)
{
if (is_array($playlistId)) {
$useMinMax = false;
if (isset($playlistId['min'])) {
$this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $playlistId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($playlistId['max'])) {
$this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $playlistId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $playlistId, $comparison);
}
/**
* Filter the query on the starts column
*
* @param string|array $starts The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByStarts($starts = null, $comparison = null)
{
if (is_array($starts)) {
$useMinMax = false;
if (isset($starts['min'])) {
$this->addUsingAlias(CcSchedulePeer::STARTS, $starts['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($starts['max'])) {
$this->addUsingAlias(CcSchedulePeer::STARTS, $starts['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::STARTS, $starts, $comparison);
}
/**
* Filter the query on the ends column
*
* @param string|array $ends The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByEnds($ends = null, $comparison = null)
{
if (is_array($ends)) {
$useMinMax = false;
if (isset($ends['min'])) {
$this->addUsingAlias(CcSchedulePeer::ENDS, $ends['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ends['max'])) {
$this->addUsingAlias(CcSchedulePeer::ENDS, $ends['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::ENDS, $ends, $comparison);
}
/**
* Filter the query on the group_id column
*
* @param int|array $groupId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByGroupId($groupId = null, $comparison = null)
{
if (is_array($groupId)) {
$useMinMax = false;
if (isset($groupId['min'])) {
$this->addUsingAlias(CcSchedulePeer::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($groupId['max'])) {
$this->addUsingAlias(CcSchedulePeer::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $groupId, $comparison);
}
/**
* Filter the query on the file_id column
*
* @param int|array $fileId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByFileId($fileId = null, $comparison = null)
{
if (is_array($fileId)) {
$useMinMax = false;
if (isset($fileId['min'])) {
$this->addUsingAlias(CcSchedulePeer::FILE_ID, $fileId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($fileId['max'])) {
$this->addUsingAlias(CcSchedulePeer::FILE_ID, $fileId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::FILE_ID, $fileId, $comparison);
}
/**
* Filter the query on the clip_length column
*
* @param string|array $clipLength The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByClipLength($clipLength = null, $comparison = null)
{
if (is_array($clipLength)) {
$useMinMax = false;
if (isset($clipLength['min'])) {
$this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $clipLength['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($clipLength['max'])) {
$this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $clipLength['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $clipLength, $comparison);
}
/**
* Filter the query on the fade_in column
*
* @param string|array $fadeIn The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByFadeIn($fadeIn = null, $comparison = null)
{
if (is_array($fadeIn)) {
$useMinMax = false;
if (isset($fadeIn['min'])) {
$this->addUsingAlias(CcSchedulePeer::FADE_IN, $fadeIn['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($fadeIn['max'])) {
$this->addUsingAlias(CcSchedulePeer::FADE_IN, $fadeIn['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::FADE_IN, $fadeIn, $comparison);
}
/**
* Filter the query on the fade_out column
*
* @param string|array $fadeOut The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByFadeOut($fadeOut = null, $comparison = null)
{
if (is_array($fadeOut)) {
$useMinMax = false;
if (isset($fadeOut['min'])) {
$this->addUsingAlias(CcSchedulePeer::FADE_OUT, $fadeOut['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($fadeOut['max'])) {
$this->addUsingAlias(CcSchedulePeer::FADE_OUT, $fadeOut['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $fadeOut, $comparison);
}
/**
* Filter the query on the cue_in column
*
* @param string|array $cueIn The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByCueIn($cueIn = null, $comparison = null)
{
if (is_array($cueIn)) {
$useMinMax = false;
if (isset($cueIn['min'])) {
$this->addUsingAlias(CcSchedulePeer::CUE_IN, $cueIn['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cueIn['max'])) {
$this->addUsingAlias(CcSchedulePeer::CUE_IN, $cueIn['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::CUE_IN, $cueIn, $comparison);
}
/**
* Filter the query on the cue_out column
*
* @param string|array $cueOut The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByCueOut($cueOut = null, $comparison = null)
{
if (is_array($cueOut)) {
$useMinMax = false;
if (isset($cueOut['min'])) {
$this->addUsingAlias(CcSchedulePeer::CUE_OUT, $cueOut['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cueOut['max'])) {
$this->addUsingAlias(CcSchedulePeer::CUE_OUT, $cueOut['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $cueOut, $comparison);
}
/**
* Exclude object from result
*
* @param CcSchedule $ccSchedule Object to remove from the list of results
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function prune($ccSchedule = null)
{
if ($ccSchedule) {
$this->addUsingAlias(CcSchedulePeer::ID, $ccSchedule->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcScheduleQuery

View File

@ -0,0 +1,949 @@
<?php
/**
* Base class that represents a row from the 'cc_sess' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSess extends BaseObject implements Persistent
{
/**
* Peer class name
*/
const PEER = 'CcSessPeer';
/**
* 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 CcSessPeer
*/
protected static $peer;
/**
* The value for the sessid field.
* @var string
*/
protected $sessid;
/**
* The value for the userid field.
* @var int
*/
protected $userid;
/**
* The value for the login field.
* @var string
*/
protected $login;
/**
* The value for the ts field.
* @var string
*/
protected $ts;
/**
* @var CcSubjs
*/
protected $aCcSubjs;
/**
* 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 [sessid] column value.
*
* @return string
*/
public function getSessid()
{
return $this->sessid;
}
/**
* Get the [userid] column value.
*
* @return int
*/
public function getUserid()
{
return $this->userid;
}
/**
* Get the [login] column value.
*
* @return string
*/
public function getLogin()
{
return $this->login;
}
/**
* Get the [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s')
{
if ($this->ts === null) {
return null;
}
try {
$dt = new DateTime($this->ts);
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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 [sessid] column.
*
* @param string $v new value
* @return CcSess The current object (for fluent API support)
*/
public function setSessid($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->sessid !== $v) {
$this->sessid = $v;
$this->modifiedColumns[] = CcSessPeer::SESSID;
}
return $this;
} // setSessid()
/**
* Set the value of [userid] column.
*
* @param int $v new value
* @return CcSess The current object (for fluent API support)
*/
public function setUserid($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->userid !== $v) {
$this->userid = $v;
$this->modifiedColumns[] = CcSessPeer::USERID;
}
if ($this->aCcSubjs !== null && $this->aCcSubjs->getId() !== $v) {
$this->aCcSubjs = null;
}
return $this;
} // setUserid()
/**
* Set the value of [login] column.
*
* @param string $v new value
* @return CcSess The current object (for fluent API support)
*/
public function setLogin($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->login !== $v) {
$this->login = $v;
$this->modifiedColumns[] = CcSessPeer::LOGIN;
}
return $this;
} // setLogin()
/**
* Sets the value of [ts] 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 CcSess The current object (for fluent API support)
*/
public function setTs($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->ts !== null || $dt !== null ) {
// (nested ifs are a little easier to read in this case)
$currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $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->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null);
$this->modifiedColumns[] = CcSessPeer::TS;
}
} // if either are not null
return $this;
} // setTs()
/**
* 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->sessid = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
$this->userid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->login = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->ts = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->resetModified();
$this->setNew(false);
if ($rehydrate) {
$this->ensureConsistency();
}
return $startcol + 4; // 4 = CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcSess 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()
{
if ($this->aCcSubjs !== null && $this->userid !== $this->aCcSubjs->getId()) {
$this->aCcSubjs = null;
}
} // 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(CcSessPeer::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 = CcSessPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
$row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor();
if (!$row) {
throw new PropelException('Cannot find matching row in the database to reload object values.');
}
$this->hydrate($row, 0, true); // rehydrate
if ($deep) { // also de-associate any related objects?
$this->aCcSubjs = null;
} // if (deep)
}
/**
* Removes this object from datastore and sets delete attribute.
*
* @param PropelPDO $con
* @return void
* @throws PropelException
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/
public function delete(PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("This object has already been deleted.");
}
if ($con === null) {
$con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
if ($ret) {
CcSessQuery::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(CcSessPeer::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);
CcSessPeer::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;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcSubjs !== null) {
if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) {
$affectedRows += $this->aCcSubjs->save($con);
}
$this->setCcSubjs($this->aCcSubjs);
}
// 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 += CcSessPeer::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();
// We call the validate method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcSubjs !== null) {
if (!$this->aCcSubjs->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures());
}
}
if (($retval = CcSessPeer::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 = CcSessPeer::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->getSessid();
break;
case 1:
return $this->getUserid();
break;
case 2:
return $this->getLogin();
break;
case 3:
return $this->getTs();
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.
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false)
{
$keys = CcSessPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getSessid(),
$keys[1] => $this->getUserid(),
$keys[2] => $this->getLogin(),
$keys[3] => $this->getTs(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcSubjs) {
$result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true);
}
}
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 = CcSessPeer::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->setSessid($value);
break;
case 1:
$this->setUserid($value);
break;
case 2:
$this->setLogin($value);
break;
case 3:
$this->setTs($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 = CcSessPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setSessid($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setUserid($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setLogin($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setTs($arr[$keys[3]]);
}
/**
* 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(CcSessPeer::DATABASE_NAME);
if ($this->isColumnModified(CcSessPeer::SESSID)) $criteria->add(CcSessPeer::SESSID, $this->sessid);
if ($this->isColumnModified(CcSessPeer::USERID)) $criteria->add(CcSessPeer::USERID, $this->userid);
if ($this->isColumnModified(CcSessPeer::LOGIN)) $criteria->add(CcSessPeer::LOGIN, $this->login);
if ($this->isColumnModified(CcSessPeer::TS)) $criteria->add(CcSessPeer::TS, $this->ts);
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(CcSessPeer::DATABASE_NAME);
$criteria->add(CcSessPeer::SESSID, $this->sessid);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return string
*/
public function getPrimaryKey()
{
return $this->getSessid();
}
/**
* Generic method to set the primary key (sessid column).
*
* @param string $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setSessid($key);
}
/**
* Returns true if the primary key for this object is null.
* @return boolean
*/
public function isPrimaryKeyNull()
{
return null === $this->getSessid();
}
/**
* 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 CcSess (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->setSessid($this->sessid);
$copyObj->setUserid($this->userid);
$copyObj->setLogin($this->login);
$copyObj->setTs($this->ts);
$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 CcSess 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 CcSessPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CcSessPeer();
}
return self::$peer;
}
/**
* Declares an association between this object and a CcSubjs object.
*
* @param CcSubjs $v
* @return CcSess The current object (for fluent API support)
* @throws PropelException
*/
public function setCcSubjs(CcSubjs $v = null)
{
if ($v === null) {
$this->setUserid(NULL);
} else {
$this->setUserid($v->getId());
}
$this->aCcSubjs = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcSubjs object, it will not be re-added.
if ($v !== null) {
$v->addCcSess($this);
}
return $this;
}
/**
* Get the associated CcSubjs object
*
* @param PropelPDO Optional Connection object.
* @return CcSubjs The associated CcSubjs object.
* @throws PropelException
*/
public function getCcSubjs(PropelPDO $con = null)
{
if ($this->aCcSubjs === null && ($this->userid !== null)) {
$this->aCcSubjs = CcSubjsQuery::create()->findPk($this->userid, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aCcSubjs->addCcSesss($this);
*/
}
return $this->aCcSubjs;
}
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->sessid = null;
$this->userid = null;
$this->login = null;
$this->ts = 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)
$this->aCcSubjs = null;
}
/**
* Catches calls to virtual methods
*/
public function __call($name, $params)
{
if (preg_match('/get(\w+)/', $name, $matches)) {
$virtualColumn = $matches[1];
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
// no lcfirst in php<5.3...
$virtualColumn[0] = strtolower($virtualColumn[0]);
if ($this->hasVirtualColumn($virtualColumn)) {
return $this->getVirtualColumn($virtualColumn);
}
}
throw new PropelException('Call to undefined method: ' . $name);
}
} // BaseCcSess

View File

@ -0,0 +1,979 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_sess' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSessPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_sess';
/** the related Propel class for this table */
const OM_CLASS = 'CcSess';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcSess';
/** the related TableMap class for this table */
const TM_CLASS = 'CcSessTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 4;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the SESSID field */
const SESSID = 'cc_sess.SESSID';
/** the column name for the USERID field */
const USERID = 'cc_sess.USERID';
/** the column name for the LOGIN field */
const LOGIN = 'cc_sess.LOGIN';
/** the column name for the TS field */
const TS = 'cc_sess.TS';
/**
* An identiy map to hold any loaded instances of CcSess objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcSess[]
*/
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 ('Sessid', 'Userid', 'Login', 'Ts', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('sessid', 'userid', 'login', 'ts', ),
BasePeer::TYPE_COLNAME => array (self::SESSID, self::USERID, self::LOGIN, self::TS, ),
BasePeer::TYPE_RAW_COLNAME => array ('SESSID', 'USERID', 'LOGIN', 'TS', ),
BasePeer::TYPE_FIELDNAME => array ('sessid', 'userid', 'login', 'ts', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
* 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 ('Sessid' => 0, 'Userid' => 1, 'Login' => 2, 'Ts' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('sessid' => 0, 'userid' => 1, 'login' => 2, 'ts' => 3, ),
BasePeer::TYPE_COLNAME => array (self::SESSID => 0, self::USERID => 1, self::LOGIN => 2, self::TS => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('SESSID' => 0, 'USERID' => 1, 'LOGIN' => 2, 'TS' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('sessid' => 0, 'userid' => 1, 'login' => 2, 'ts' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
* 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. CcSessPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcSessPeer::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(CcSessPeer::SESSID);
$criteria->addSelectColumn(CcSessPeer::USERID);
$criteria->addSelectColumn(CcSessPeer::LOGIN);
$criteria->addSelectColumn(CcSessPeer::TS);
} else {
$criteria->addSelectColumn($alias . '.SESSID');
$criteria->addSelectColumn($alias . '.USERID');
$criteria->addSelectColumn($alias . '.LOGIN');
$criteria->addSelectColumn($alias . '.TS');
}
}
/**
* 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(CcSessPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSessPeer::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(CcSessPeer::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 CcSess
* @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 = CcSessPeer::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 CcSessPeer::populateObjects(CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcSessPeer::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 CcSess $value A CcSess object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcSess $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getSessid();
} // 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 CcSess object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcSess) {
$key = (string) $value->getSessid();
} 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 CcSess 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 CcSess 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_sess
* 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 = CcSessPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcSessPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcSessPeer::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;
CcSessPeer::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 (CcSess object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcSessPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcSessPeer::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 + CcSessPeer::NUM_COLUMNS;
} else {
$cls = CcSessPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcSessPeer::addInstanceToPool($obj, $key);
}
return array($obj, $col);
}
/**
* Returns the number of rows matching criteria, joining the related CcSubjs table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcSessPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSessPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcSess objects pre-filled with their CcSubjs objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcSess objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcSessPeer::addSelectColumns($criteria);
$startcol = (CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcSessPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcSessPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcSessPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcSessPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (CcSess) to $obj2 (CcSubjs)
$obj2->addCcSess($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcSessPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSessPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcSess objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcSess objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcSessPeer::addSelectColumns($criteria);
$startcol2 = (CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS);
CcSubjsPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcSessPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcSessPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcSessPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcSessPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcSubjs rows
$key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcSubjsPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcSubjsPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcSubjsPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded
// Add the $obj1 (CcSess) to the collection in $obj2 (CcSubjs)
$obj2->addCcSess($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* 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(BaseCcSessPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcSessPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcSessTableMap());
}
}
/**
* 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 ? CcSessPeer::CLASS_DEFAULT : CcSessPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcSess or Criteria object.
*
* @param mixed $values Criteria or CcSess 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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcSess 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 CcSess or Criteria object.
*
* @param mixed $values Criteria or CcSess 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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcSessPeer::SESSID);
$value = $criteria->remove(CcSessPeer::SESSID);
if ($value) {
$selectCriteria->add(CcSessPeer::SESSID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcSessPeer::TABLE_NAME);
}
} else { // $values is CcSess 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_sess 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(CcSessPeer::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(CcSessPeer::TABLE_NAME, $con, CcSessPeer::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).
CcSessPeer::clearInstancePool();
CcSessPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcSess or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcSess 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(CcSessPeer::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.
CcSessPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcSess) { // it's a model object
// invalidate the cache for this single object
CcSessPeer::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(CcSessPeer::SESSID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcSessPeer::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);
CcSessPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcSess 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 CcSess $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(CcSess $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcSessPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcSessPeer::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(CcSessPeer::DATABASE_NAME, CcSessPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param string $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcSess
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcSessPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcSessPeer::DATABASE_NAME);
$criteria->add(CcSessPeer::SESSID, $pk);
$v = CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcSessPeer::DATABASE_NAME);
$criteria->add(CcSessPeer::SESSID, $pks, Criteria::IN);
$objs = CcSessPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcSessPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcSessPeer::buildTableMap();

View File

@ -0,0 +1,334 @@
<?php
/**
* Base class that represents a query for the 'cc_sess' table.
*
*
*
* @method CcSessQuery orderBySessid($order = Criteria::ASC) Order by the sessid column
* @method CcSessQuery orderByUserid($order = Criteria::ASC) Order by the userid column
* @method CcSessQuery orderByLogin($order = Criteria::ASC) Order by the login column
* @method CcSessQuery orderByTs($order = Criteria::ASC) Order by the ts column
*
* @method CcSessQuery groupBySessid() Group by the sessid column
* @method CcSessQuery groupByUserid() Group by the userid column
* @method CcSessQuery groupByLogin() Group by the login column
* @method CcSessQuery groupByTs() Group by the ts column
*
* @method CcSessQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcSessQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcSessQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcSessQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
* @method CcSessQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
* @method CcSessQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
*
* @method CcSess findOne(PropelPDO $con = null) Return the first CcSess matching the query
* @method CcSess findOneOrCreate(PropelPDO $con = null) Return the first CcSess matching the query, or a new CcSess object populated from the query conditions when no match is found
*
* @method CcSess findOneBySessid(string $sessid) Return the first CcSess filtered by the sessid column
* @method CcSess findOneByUserid(int $userid) Return the first CcSess filtered by the userid column
* @method CcSess findOneByLogin(string $login) Return the first CcSess filtered by the login column
* @method CcSess findOneByTs(string $ts) Return the first CcSess filtered by the ts column
*
* @method array findBySessid(string $sessid) Return CcSess objects filtered by the sessid column
* @method array findByUserid(int $userid) Return CcSess objects filtered by the userid column
* @method array findByLogin(string $login) Return CcSess objects filtered by the login column
* @method array findByTs(string $ts) Return CcSess objects filtered by the ts column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSessQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcSessQuery 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 = 'campcaster', $modelName = 'CcSess', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcSessQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcSessQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcSessQuery) {
return $criteria;
}
$query = new CcSessQuery();
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 CcSess|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcSessPeer::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 CcSessQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcSessPeer::SESSID, $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 CcSessQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcSessPeer::SESSID, $keys, Criteria::IN);
}
/**
* Filter the query on the sessid column
*
* @param string $sessid 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 CcSessQuery The current query, for fluid interface
*/
public function filterBySessid($sessid = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($sessid)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $sessid)) {
$sessid = str_replace('*', '%', $sessid);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSessPeer::SESSID, $sessid, $comparison);
}
/**
* Filter the query on the userid column
*
* @param int|array $userid 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 CcSessQuery The current query, for fluid interface
*/
public function filterByUserid($userid = null, $comparison = null)
{
if (is_array($userid)) {
$useMinMax = false;
if (isset($userid['min'])) {
$this->addUsingAlias(CcSessPeer::USERID, $userid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($userid['max'])) {
$this->addUsingAlias(CcSessPeer::USERID, $userid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSessPeer::USERID, $userid, $comparison);
}
/**
* Filter the query on the login column
*
* @param string $login 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 CcSessQuery The current query, for fluid interface
*/
public function filterByLogin($login = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($login)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $login)) {
$login = str_replace('*', '%', $login);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSessPeer::LOGIN, $login, $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 CcSessQuery 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(CcSessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ts['max'])) {
$this->addUsingAlias(CcSessPeer::TS, $ts['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSessPeer::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 CcSessQuery The current query, for fluid interface
*/
public function filterByCcSubjs($ccSubjs, $comparison = null)
{
return $this
->addUsingAlias(CcSessPeer::USERID, $ccSubjs->getId(), $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 CcSessQuery 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 CcSess $ccSess Object to remove from the list of results
*
* @return CcSessQuery The current query, for fluid interface
*/
public function prune($ccSess = null)
{
if ($ccSess) {
$this->addUsingAlias(CcSessPeer::SESSID, $ccSess->getSessid(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcSessQuery

View File

@ -0,0 +1,891 @@
<?php
/**
* Base class that represents a row from the 'cc_smemb' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSmemb extends BaseObject implements Persistent
{
/**
* Peer class name
*/
const PEER = 'CcSmembPeer';
/**
* 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 CcSmembPeer
*/
protected static $peer;
/**
* The value for the id field.
* @var int
*/
protected $id;
/**
* The value for the uid field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $uid;
/**
* The value for the gid field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $gid;
/**
* The value for the level field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $level;
/**
* The value for the mid field.
* @var int
*/
protected $mid;
/**
* 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;
/**
* Applies default values to this object.
* This method should be called from the object's constructor (or
* equivalent initialization method).
* @see __construct()
*/
public function applyDefaultValues()
{
$this->uid = 0;
$this->gid = 0;
$this->level = 0;
}
/**
* Initializes internal state of BaseCcSmemb object.
* @see applyDefaults()
*/
public function __construct()
{
parent::__construct();
$this->applyDefaultValues();
}
/**
* Get the [id] column value.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Get the [uid] column value.
*
* @return int
*/
public function getUid()
{
return $this->uid;
}
/**
* Get the [gid] column value.
*
* @return int
*/
public function getGid()
{
return $this->gid;
}
/**
* Get the [level] column value.
*
* @return int
*/
public function getLevel()
{
return $this->level;
}
/**
* Get the [mid] column value.
*
* @return int
*/
public function getMid()
{
return $this->mid;
}
/**
* Set the value of [id] column.
*
* @param int $v new value
* @return CcSmemb The current object (for fluent API support)
*/
public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[] = CcSmembPeer::ID;
}
return $this;
} // setId()
/**
* Set the value of [uid] column.
*
* @param int $v new value
* @return CcSmemb The current object (for fluent API support)
*/
public function setUid($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->uid !== $v || $this->isNew()) {
$this->uid = $v;
$this->modifiedColumns[] = CcSmembPeer::UID;
}
return $this;
} // setUid()
/**
* Set the value of [gid] column.
*
* @param int $v new value
* @return CcSmemb The current object (for fluent API support)
*/
public function setGid($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->gid !== $v || $this->isNew()) {
$this->gid = $v;
$this->modifiedColumns[] = CcSmembPeer::GID;
}
return $this;
} // setGid()
/**
* Set the value of [level] column.
*
* @param int $v new value
* @return CcSmemb The current object (for fluent API support)
*/
public function setLevel($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->level !== $v || $this->isNew()) {
$this->level = $v;
$this->modifiedColumns[] = CcSmembPeer::LEVEL;
}
return $this;
} // setLevel()
/**
* Set the value of [mid] column.
*
* @param int $v new value
* @return CcSmemb The current object (for fluent API support)
*/
public function setMid($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->mid !== $v) {
$this->mid = $v;
$this->modifiedColumns[] = CcSmembPeer::MID;
}
return $this;
} // setMid()
/**
* 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()
{
if ($this->uid !== 0) {
return false;
}
if ($this->gid !== 0) {
return false;
}
if ($this->level !== 0) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
* An offset (0-based "start column") is specified so that objects can be hydrated
* with a subset of the columns in the resultset rows. This is needed, for example,
* for results of JOIN queries where the resultset row includes columns from two or
* more tables.
*
* @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
* @param int $startcol 0-based offset column which indicates which restultset column to start with.
* @param boolean $rehydrate Whether this object is being re-hydrated from the database.
* @return int next starting column
* @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
*/
public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->uid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->gid = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
$this->level = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
$this->mid = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
$this->resetModified();
$this->setNew(false);
if ($rehydrate) {
$this->ensureConsistency();
}
return $startcol + 5; // 5 = CcSmembPeer::NUM_COLUMNS - CcSmembPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcSmemb 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(CcSmembPeer::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 = CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$con->beginTransaction();
try {
$ret = $this->preDelete($con);
if ($ret) {
CcSmembQuery::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(CcSmembPeer::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);
CcSmembPeer::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 = CcSmembPeer::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 = CcSmembPeer::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 = CcSmembPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
$field = $this->getByPosition($pos);
return $field;
}
/**
* Retrieves a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @return mixed Value of field at $pos
*/
public function getByPosition($pos)
{
switch($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getUid();
break;
case 2:
return $this->getGid();
break;
case 3:
return $this->getLevel();
break;
case 4:
return $this->getMid();
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 = CcSmembPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getId(),
$keys[1] => $this->getUid(),
$keys[2] => $this->getGid(),
$keys[3] => $this->getLevel(),
$keys[4] => $this->getMid(),
);
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 = CcSmembPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
return $this->setByPosition($pos, $value);
}
/**
* Sets a field from the object by Position as specified in the xml schema.
* Zero-based.
*
* @param int $pos position in xml schema
* @param mixed $value field value
* @return void
*/
public function setByPosition($pos, $value)
{
switch($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setUid($value);
break;
case 2:
$this->setGid($value);
break;
case 3:
$this->setLevel($value);
break;
case 4:
$this->setMid($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 = CcSmembPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setUid($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setGid($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setLevel($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setMid($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(CcSmembPeer::DATABASE_NAME);
if ($this->isColumnModified(CcSmembPeer::ID)) $criteria->add(CcSmembPeer::ID, $this->id);
if ($this->isColumnModified(CcSmembPeer::UID)) $criteria->add(CcSmembPeer::UID, $this->uid);
if ($this->isColumnModified(CcSmembPeer::GID)) $criteria->add(CcSmembPeer::GID, $this->gid);
if ($this->isColumnModified(CcSmembPeer::LEVEL)) $criteria->add(CcSmembPeer::LEVEL, $this->level);
if ($this->isColumnModified(CcSmembPeer::MID)) $criteria->add(CcSmembPeer::MID, $this->mid);
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(CcSmembPeer::DATABASE_NAME);
$criteria->add(CcSmembPeer::ID, $this->id);
return $criteria;
}
/**
* Returns the primary key for this object (row).
* @return int
*/
public function getPrimaryKey()
{
return $this->getId();
}
/**
* Generic method to set the primary key (id column).
*
* @param int $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
{
$this->setId($key);
}
/**
* Returns true if the primary key for this object is null.
* @return boolean
*/
public function isPrimaryKeyNull()
{
return null === $this->getId();
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of CcSmemb (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->setId($this->id);
$copyObj->setUid($this->uid);
$copyObj->setGid($this->gid);
$copyObj->setLevel($this->level);
$copyObj->setMid($this->mid);
$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 CcSmemb 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 CcSmembPeer
*/
public function getPeer()
{
if (self::$peer === null) {
self::$peer = new CcSmembPeer();
}
return self::$peer;
}
/**
* Clears the current object and sets all attributes to their default values
*/
public function clear()
{
$this->id = null;
$this->uid = null;
$this->gid = null;
$this->level = null;
$this->mid = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();
$this->applyDefaultValues();
$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);
}
} // BaseCcSmemb

View File

@ -0,0 +1,750 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_smemb' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSmembPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_smemb';
/** the related Propel class for this table */
const OM_CLASS = 'CcSmemb';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcSmemb';
/** the related TableMap class for this table */
const TM_CLASS = 'CcSmembTableMap';
/** 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 ID field */
const ID = 'cc_smemb.ID';
/** the column name for the UID field */
const UID = 'cc_smemb.UID';
/** the column name for the GID field */
const GID = 'cc_smemb.GID';
/** the column name for the LEVEL field */
const LEVEL = 'cc_smemb.LEVEL';
/** the column name for the MID field */
const MID = 'cc_smemb.MID';
/**
* An identiy map to hold any loaded instances of CcSmemb objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcSmemb[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Uid', 'Gid', 'Level', 'Mid', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'uid', 'gid', 'level', 'mid', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::UID, self::GID, self::LEVEL, self::MID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'UID', 'GID', 'LEVEL', 'MID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'uid', 'gid', 'level', 'mid', ),
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 ('Id' => 0, 'Uid' => 1, 'Gid' => 2, 'Level' => 3, 'Mid' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'uid' => 1, 'gid' => 2, 'level' => 3, 'mid' => 4, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::UID => 1, self::GID => 2, self::LEVEL => 3, self::MID => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'UID' => 1, 'GID' => 2, 'LEVEL' => 3, 'MID' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'uid' => 1, 'gid' => 2, 'level' => 3, 'mid' => 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. CcSmembPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcSmembPeer::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(CcSmembPeer::ID);
$criteria->addSelectColumn(CcSmembPeer::UID);
$criteria->addSelectColumn(CcSmembPeer::GID);
$criteria->addSelectColumn(CcSmembPeer::LEVEL);
$criteria->addSelectColumn(CcSmembPeer::MID);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.UID');
$criteria->addSelectColumn($alias . '.GID');
$criteria->addSelectColumn($alias . '.LEVEL');
$criteria->addSelectColumn($alias . '.MID');
}
}
/**
* 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(CcSmembPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSmembPeer::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(CcSmembPeer::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 CcSmemb
* @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 = CcSmembPeer::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 CcSmembPeer::populateObjects(CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcSmembPeer::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 CcSmemb $value A CcSmemb object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcSmemb $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A CcSmemb object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcSmemb) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcSmemb 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 CcSmemb 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_smemb
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* Retrieves the primary key from the DB resultset row
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CcSmembPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcSmembPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcSmembPeer::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;
CcSmembPeer::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 (CcSmemb object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcSmembPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcSmembPeer::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 + CcSmembPeer::NUM_COLUMNS;
} else {
$cls = CcSmembPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcSmembPeer::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(BaseCcSmembPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcSmembPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcSmembTableMap());
}
}
/**
* 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 ? CcSmembPeer::CLASS_DEFAULT : CcSmembPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcSmemb or Criteria object.
*
* @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcSmemb 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 CcSmemb or Criteria object.
*
* @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcSmembPeer::ID);
$value = $criteria->remove(CcSmembPeer::ID);
if ($value) {
$selectCriteria->add(CcSmembPeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcSmembPeer::TABLE_NAME);
}
} else { // $values is CcSmemb 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_smemb 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(CcSmembPeer::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(CcSmembPeer::TABLE_NAME, $con, CcSmembPeer::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).
CcSmembPeer::clearInstancePool();
CcSmembPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcSmemb or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::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.
CcSmembPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcSmemb) { // it's a model object
// invalidate the cache for this single object
CcSmembPeer::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(CcSmembPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcSmembPeer::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);
CcSmembPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcSmemb 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 CcSmemb $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(CcSmemb $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcSmembPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, CcSmembPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcSmemb
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcSmembPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcSmembPeer::DATABASE_NAME);
$criteria->add(CcSmembPeer::ID, $pk);
$v = CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcSmembPeer::DATABASE_NAME);
$criteria->add(CcSmembPeer::ID, $pks, Criteria::IN);
$objs = CcSmembPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcSmembPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcSmembPeer::buildTableMap();

View File

@ -0,0 +1,305 @@
<?php
/**
* Base class that represents a query for the 'cc_smemb' table.
*
*
*
* @method CcSmembQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcSmembQuery orderByUid($order = Criteria::ASC) Order by the uid column
* @method CcSmembQuery orderByGid($order = Criteria::ASC) Order by the gid column
* @method CcSmembQuery orderByLevel($order = Criteria::ASC) Order by the level column
* @method CcSmembQuery orderByMid($order = Criteria::ASC) Order by the mid column
*
* @method CcSmembQuery groupById() Group by the id column
* @method CcSmembQuery groupByUid() Group by the uid column
* @method CcSmembQuery groupByGid() Group by the gid column
* @method CcSmembQuery groupByLevel() Group by the level column
* @method CcSmembQuery groupByMid() Group by the mid column
*
* @method CcSmembQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcSmembQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcSmembQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcSmemb findOne(PropelPDO $con = null) Return the first CcSmemb matching the query
* @method CcSmemb findOneOrCreate(PropelPDO $con = null) Return the first CcSmemb matching the query, or a new CcSmemb object populated from the query conditions when no match is found
*
* @method CcSmemb findOneById(int $id) Return the first CcSmemb filtered by the id column
* @method CcSmemb findOneByUid(int $uid) Return the first CcSmemb filtered by the uid column
* @method CcSmemb findOneByGid(int $gid) Return the first CcSmemb filtered by the gid column
* @method CcSmemb findOneByLevel(int $level) Return the first CcSmemb filtered by the level column
* @method CcSmemb findOneByMid(int $mid) Return the first CcSmemb filtered by the mid column
*
* @method array findById(int $id) Return CcSmemb objects filtered by the id column
* @method array findByUid(int $uid) Return CcSmemb objects filtered by the uid column
* @method array findByGid(int $gid) Return CcSmemb objects filtered by the gid column
* @method array findByLevel(int $level) Return CcSmemb objects filtered by the level column
* @method array findByMid(int $mid) Return CcSmemb objects filtered by the mid column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSmembQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcSmembQuery 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 = 'campcaster', $modelName = 'CcSmemb', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcSmembQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcSmembQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcSmembQuery) {
return $criteria;
}
$query = new CcSmembQuery();
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 CcSmemb|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcSmembPeer::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 CcSmembQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcSmembPeer::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 CcSmembQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcSmembPeer::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 CcSmembQuery 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(CcSmembPeer::ID, $id, $comparison);
}
/**
* Filter the query on the uid column
*
* @param int|array $uid 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 CcSmembQuery The current query, for fluid interface
*/
public function filterByUid($uid = null, $comparison = null)
{
if (is_array($uid)) {
$useMinMax = false;
if (isset($uid['min'])) {
$this->addUsingAlias(CcSmembPeer::UID, $uid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($uid['max'])) {
$this->addUsingAlias(CcSmembPeer::UID, $uid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSmembPeer::UID, $uid, $comparison);
}
/**
* Filter the query on the gid column
*
* @param int|array $gid 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 CcSmembQuery The current query, for fluid interface
*/
public function filterByGid($gid = null, $comparison = null)
{
if (is_array($gid)) {
$useMinMax = false;
if (isset($gid['min'])) {
$this->addUsingAlias(CcSmembPeer::GID, $gid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($gid['max'])) {
$this->addUsingAlias(CcSmembPeer::GID, $gid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSmembPeer::GID, $gid, $comparison);
}
/**
* Filter the query on the level column
*
* @param int|array $level 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 CcSmembQuery The current query, for fluid interface
*/
public function filterByLevel($level = null, $comparison = null)
{
if (is_array($level)) {
$useMinMax = false;
if (isset($level['min'])) {
$this->addUsingAlias(CcSmembPeer::LEVEL, $level['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($level['max'])) {
$this->addUsingAlias(CcSmembPeer::LEVEL, $level['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSmembPeer::LEVEL, $level, $comparison);
}
/**
* Filter the query on the mid column
*
* @param int|array $mid 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 CcSmembQuery The current query, for fluid interface
*/
public function filterByMid($mid = null, $comparison = null)
{
if (is_array($mid)) {
$useMinMax = false;
if (isset($mid['min'])) {
$this->addUsingAlias(CcSmembPeer::MID, $mid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($mid['max'])) {
$this->addUsingAlias(CcSmembPeer::MID, $mid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSmembPeer::MID, $mid, $comparison);
}
/**
* Exclude object from result
*
* @param CcSmemb $ccSmemb Object to remove from the list of results
*
* @return CcSmembQuery The current query, for fluid interface
*/
public function prune($ccSmemb = null)
{
if ($ccSmemb) {
$this->addUsingAlias(CcSmembPeer::ID, $ccSmemb->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcSmembQuery

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,769 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_subjs' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSubjsPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_subjs';
/** the related Propel class for this table */
const OM_CLASS = 'CcSubjs';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcSubjs';
/** the related TableMap class for this table */
const TM_CLASS = 'CcSubjsTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 7;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'cc_subjs.ID';
/** the column name for the LOGIN field */
const LOGIN = 'cc_subjs.LOGIN';
/** the column name for the PASS field */
const PASS = 'cc_subjs.PASS';
/** the column name for the TYPE field */
const TYPE = 'cc_subjs.TYPE';
/** the column name for the REALNAME field */
const REALNAME = 'cc_subjs.REALNAME';
/** the column name for the LASTLOGIN field */
const LASTLOGIN = 'cc_subjs.LASTLOGIN';
/** the column name for the LASTFAIL field */
const LASTFAIL = 'cc_subjs.LASTFAIL';
/**
* An identiy map to hold any loaded instances of CcSubjs objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcSubjs[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Login', 'Pass', 'Type', 'Realname', 'Lastlogin', 'Lastfail', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'login', 'pass', 'type', 'realname', 'lastlogin', 'lastfail', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::REALNAME, self::LASTLOGIN, self::LASTFAIL, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'REALNAME', 'LASTLOGIN', 'LASTFAIL', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'realname', 'lastlogin', 'lastfail', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Login' => 1, 'Pass' => 2, 'Type' => 3, 'Realname' => 4, 'Lastlogin' => 5, 'Lastfail' => 6, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'realname' => 4, 'lastlogin' => 5, 'lastfail' => 6, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::REALNAME => 4, self::LASTLOGIN => 5, self::LASTFAIL => 6, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'REALNAME' => 4, 'LASTLOGIN' => 5, 'LASTFAIL' => 6, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'realname' => 4, 'lastlogin' => 5, 'lastfail' => 6, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
);
/**
* 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. CcSubjsPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcSubjsPeer::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(CcSubjsPeer::ID);
$criteria->addSelectColumn(CcSubjsPeer::LOGIN);
$criteria->addSelectColumn(CcSubjsPeer::PASS);
$criteria->addSelectColumn(CcSubjsPeer::TYPE);
$criteria->addSelectColumn(CcSubjsPeer::REALNAME);
$criteria->addSelectColumn(CcSubjsPeer::LASTLOGIN);
$criteria->addSelectColumn(CcSubjsPeer::LASTFAIL);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.LOGIN');
$criteria->addSelectColumn($alias . '.PASS');
$criteria->addSelectColumn($alias . '.TYPE');
$criteria->addSelectColumn($alias . '.REALNAME');
$criteria->addSelectColumn($alias . '.LASTLOGIN');
$criteria->addSelectColumn($alias . '.LASTFAIL');
}
}
/**
* 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(CcSubjsPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSubjsPeer::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(CcSubjsPeer::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 CcSubjs
* @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 = CcSubjsPeer::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 CcSubjsPeer::populateObjects(CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcSubjsPeer::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 CcSubjs $value A CcSubjs object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcSubjs $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A CcSubjs object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcSubjs) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcSubjs 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 CcSubjs 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_subjs
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
// Invalidate objects in CcPermsPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcPermsPeer::clearInstancePool();
// Invalidate objects in CcPrefPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcPrefPeer::clearInstancePool();
// Invalidate objects in CcSessPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcSessPeer::clearInstancePool();
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* Retrieves the primary key from the DB resultset row
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CcSubjsPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcSubjsPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcSubjsPeer::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;
CcSubjsPeer::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 (CcSubjs object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcSubjsPeer::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 + CcSubjsPeer::NUM_COLUMNS;
} else {
$cls = CcSubjsPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcSubjsPeer::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(BaseCcSubjsPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcSubjsPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcSubjsTableMap());
}
}
/**
* 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 ? CcSubjsPeer::CLASS_DEFAULT : CcSubjsPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcSubjs or Criteria object.
*
* @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcSubjs 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 CcSubjs or Criteria object.
*
* @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcSubjsPeer::ID);
$value = $criteria->remove(CcSubjsPeer::ID);
if ($value) {
$selectCriteria->add(CcSubjsPeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcSubjsPeer::TABLE_NAME);
}
} else { // $values is CcSubjs 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_subjs 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(CcSubjsPeer::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(CcSubjsPeer::TABLE_NAME, $con, CcSubjsPeer::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).
CcSubjsPeer::clearInstancePool();
CcSubjsPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcSubjs or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::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.
CcSubjsPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcSubjs) { // it's a model object
// invalidate the cache for this single object
CcSubjsPeer::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(CcSubjsPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcSubjsPeer::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);
CcSubjsPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcSubjs 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 CcSubjs $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(CcSubjs $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcSubjsPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, CcSubjsPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcSubjs
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcSubjsPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcSubjsPeer::DATABASE_NAME);
$criteria->add(CcSubjsPeer::ID, $pk);
$v = CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcSubjsPeer::DATABASE_NAME);
$criteria->add(CcSubjsPeer::ID, $pks, Criteria::IN);
$objs = CcSubjsPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcSubjsPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcSubjsPeer::buildTableMap();

View File

@ -0,0 +1,747 @@
<?php
/**
* Base class that represents a query for the 'cc_subjs' table.
*
*
*
* @method CcSubjsQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcSubjsQuery orderByLogin($order = Criteria::ASC) Order by the login column
* @method CcSubjsQuery orderByPass($order = Criteria::ASC) Order by the pass column
* @method CcSubjsQuery orderByType($order = Criteria::ASC) Order by the type column
* @method CcSubjsQuery orderByRealname($order = Criteria::ASC) Order by the realname column
* @method CcSubjsQuery orderByLastlogin($order = Criteria::ASC) Order by the lastlogin column
* @method CcSubjsQuery orderByLastfail($order = Criteria::ASC) Order by the lastfail column
*
* @method CcSubjsQuery groupById() Group by the id column
* @method CcSubjsQuery groupByLogin() Group by the login column
* @method CcSubjsQuery groupByPass() Group by the pass column
* @method CcSubjsQuery groupByType() Group by the type column
* @method CcSubjsQuery groupByRealname() Group by the realname column
* @method CcSubjsQuery groupByLastlogin() Group by the lastlogin column
* @method CcSubjsQuery groupByLastfail() Group by the lastfail column
*
* @method CcSubjsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcSubjsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcSubjsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcSubjsQuery leftJoinCcAccess($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcAccess relation
* @method CcSubjsQuery rightJoinCcAccess($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcAccess relation
* @method CcSubjsQuery innerJoinCcAccess($relationAlias = '') Adds a INNER JOIN clause to the query using the CcAccess relation
*
* @method CcSubjsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
* @method CcSubjsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
* @method CcSubjsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
*
* @method CcSubjsQuery leftJoinCcPerms($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPerms relation
* @method CcSubjsQuery rightJoinCcPerms($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPerms relation
* @method CcSubjsQuery innerJoinCcPerms($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPerms relation
*
* @method CcSubjsQuery leftJoinCcPlaylist($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlaylist relation
* @method CcSubjsQuery rightJoinCcPlaylist($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylist relation
* @method CcSubjsQuery innerJoinCcPlaylist($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylist relation
*
* @method CcSubjsQuery leftJoinCcPref($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPref relation
* @method CcSubjsQuery rightJoinCcPref($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPref relation
* @method CcSubjsQuery innerJoinCcPref($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPref relation
*
* @method CcSubjsQuery leftJoinCcSess($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSess relation
* @method CcSubjsQuery rightJoinCcSess($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSess relation
* @method CcSubjsQuery innerJoinCcSess($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSess relation
*
* @method CcSubjs findOne(PropelPDO $con = null) Return the first CcSubjs matching the query
* @method CcSubjs findOneOrCreate(PropelPDO $con = null) Return the first CcSubjs matching the query, or a new CcSubjs object populated from the query conditions when no match is found
*
* @method CcSubjs findOneById(int $id) Return the first CcSubjs filtered by the id column
* @method CcSubjs findOneByLogin(string $login) Return the first CcSubjs filtered by the login column
* @method CcSubjs findOneByPass(string $pass) Return the first CcSubjs filtered by the pass column
* @method CcSubjs findOneByType(string $type) Return the first CcSubjs filtered by the type column
* @method CcSubjs findOneByRealname(string $realname) Return the first CcSubjs filtered by the realname column
* @method CcSubjs findOneByLastlogin(string $lastlogin) Return the first CcSubjs filtered by the lastlogin column
* @method CcSubjs findOneByLastfail(string $lastfail) Return the first CcSubjs filtered by the lastfail column
*
* @method array findById(int $id) Return CcSubjs objects filtered by the id column
* @method array findByLogin(string $login) Return CcSubjs objects filtered by the login column
* @method array findByPass(string $pass) Return CcSubjs objects filtered by the pass column
* @method array findByType(string $type) Return CcSubjs objects filtered by the type column
* @method array findByRealname(string $realname) Return CcSubjs objects filtered by the realname column
* @method array findByLastlogin(string $lastlogin) Return CcSubjs objects filtered by the lastlogin column
* @method array findByLastfail(string $lastfail) Return CcSubjs objects filtered by the lastfail column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcSubjsQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcSubjsQuery 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 = 'campcaster', $modelName = 'CcSubjs', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcSubjsQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcSubjsQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcSubjsQuery) {
return $criteria;
}
$query = new CcSubjsQuery();
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 CcSubjs|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcSubjsPeer::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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcSubjsPeer::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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcSubjsPeer::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 CcSubjsQuery 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(CcSubjsPeer::ID, $id, $comparison);
}
/**
* Filter the query on the login column
*
* @param string $login 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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByLogin($login = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($login)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $login)) {
$login = str_replace('*', '%', $login);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::LOGIN, $login, $comparison);
}
/**
* Filter the query on the pass column
*
* @param string $pass 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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByPass($pass = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($pass)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $pass)) {
$pass = str_replace('*', '%', $pass);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::PASS, $pass, $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 CcSubjsQuery 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(CcSubjsPeer::TYPE, $type, $comparison);
}
/**
* Filter the query on the realname column
*
* @param string $realname 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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByRealname($realname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($realname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $realname)) {
$realname = str_replace('*', '%', $realname);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcSubjsPeer::REALNAME, $realname, $comparison);
}
/**
* Filter the query on the lastlogin column
*
* @param string|array $lastlogin 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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByLastlogin($lastlogin = null, $comparison = null)
{
if (is_array($lastlogin)) {
$useMinMax = false;
if (isset($lastlogin['min'])) {
$this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $lastlogin['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($lastlogin['max'])) {
$this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $lastlogin['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $lastlogin, $comparison);
}
/**
* Filter the query on the lastfail column
*
* @param string|array $lastfail 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 CcSubjsQuery The current query, for fluid interface
*/
public function filterByLastfail($lastfail = null, $comparison = null)
{
if (is_array($lastfail)) {
$useMinMax = false;
if (isset($lastfail['min'])) {
$this->addUsingAlias(CcSubjsPeer::LASTFAIL, $lastfail['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($lastfail['max'])) {
$this->addUsingAlias(CcSubjsPeer::LASTFAIL, $lastfail['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $lastfail, $comparison);
}
/**
* Filter the query by a related CcAccess object
*
* @param CcAccess $ccAccess the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByCcAccess($ccAccess, $comparison = null)
{
return $this
->addUsingAlias(CcSubjsPeer::ID, $ccAccess->getOwner(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcAccess relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinCcAccess($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcAccess');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcAccess');
}
return $this;
}
/**
* Use the CcAccess relation CcAccess object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcAccessQuery A secondary query class using the current class as primary query
*/
public function useCcAccessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcAccess($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcAccess', 'CcAccessQuery');
}
/**
* Filter the query by a related CcFiles object
*
* @param CcFiles $ccFiles the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByCcFiles($ccFiles, $comparison = null)
{
return $this
->addUsingAlias(CcSubjsPeer::ID, $ccFiles->getEditedby(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcFiles relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcFiles');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcFiles');
}
return $this;
}
/**
* Use the CcFiles relation CcFiles object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcFilesQuery A secondary query class using the current class as primary query
*/
public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcFiles($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
}
/**
* Filter the query by a related CcPerms object
*
* @param CcPerms $ccPerms the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByCcPerms($ccPerms, $comparison = null)
{
return $this
->addUsingAlias(CcSubjsPeer::ID, $ccPerms->getSubj(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcPerms relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinCcPerms($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcPerms');
// 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, 'CcPerms');
}
return $this;
}
/**
* Use the CcPerms relation CcPerms 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 CcPermsQuery A secondary query class using the current class as primary query
*/
public function useCcPermsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcPerms($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcPerms', 'CcPermsQuery');
}
/**
* Filter the query by a related CcPlaylist object
*
* @param CcPlaylist $ccPlaylist the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByCcPlaylist($ccPlaylist, $comparison = null)
{
return $this
->addUsingAlias(CcSubjsPeer::ID, $ccPlaylist->getEditedby(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcPlaylist relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcPlaylist');
// 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, 'CcPlaylist');
}
return $this;
}
/**
* Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query
*/
public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcPlaylist($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery');
}
/**
* Filter the query by a related CcPref object
*
* @param CcPref $ccPref the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByCcPref($ccPref, $comparison = null)
{
return $this
->addUsingAlias(CcSubjsPeer::ID, $ccPref->getSubjid(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcPref relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinCcPref($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcPref');
// 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, 'CcPref');
}
return $this;
}
/**
* Use the CcPref relation CcPref 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 CcPrefQuery A secondary query class using the current class as primary query
*/
public function useCcPrefQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcPref($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcPref', 'CcPrefQuery');
}
/**
* Filter the query by a related CcSess object
*
* @param CcSess $ccSess the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function filterByCcSess($ccSess, $comparison = null)
{
return $this
->addUsingAlias(CcSubjsPeer::ID, $ccSess->getUserid(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcSess relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function joinCcSess($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcSess');
// 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, 'CcSess');
}
return $this;
}
/**
* Use the CcSess relation CcSess 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 CcSessQuery A secondary query class using the current class as primary query
*/
public function useCcSessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcSess($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcSess', 'CcSessQuery');
}
/**
* Exclude object from result
*
* @param CcSubjs $ccSubjs Object to remove from the list of results
*
* @return CcSubjsQuery The current query, for fluid interface
*/
public function prune($ccSubjs = null)
{
if ($ccSubjs) {
$this->addUsingAlias(CcSubjsPeer::ID, $ccSubjs->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcSubjsQuery

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,849 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_trans' table.
*
*
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcTransPeer {
/** the default database name for this class */
const DATABASE_NAME = 'campcaster';
/** the table name for this class */
const TABLE_NAME = 'cc_trans';
/** the related Propel class for this table */
const OM_CLASS = 'CcTrans';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'campcaster.CcTrans';
/** the related TableMap class for this table */
const TM_CLASS = 'CcTransTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 24;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'cc_trans.ID';
/** the column name for the TRTOK field */
const TRTOK = 'cc_trans.TRTOK';
/** the column name for the DIRECTION field */
const DIRECTION = 'cc_trans.DIRECTION';
/** the column name for the STATE field */
const STATE = 'cc_trans.STATE';
/** the column name for the TRTYPE field */
const TRTYPE = 'cc_trans.TRTYPE';
/** the column name for the LOCK field */
const LOCK = 'cc_trans.LOCK';
/** the column name for the TARGET field */
const TARGET = 'cc_trans.TARGET';
/** the column name for the RTRTOK field */
const RTRTOK = 'cc_trans.RTRTOK';
/** the column name for the MDTRTOK field */
const MDTRTOK = 'cc_trans.MDTRTOK';
/** the column name for the GUNID field */
const GUNID = 'cc_trans.GUNID';
/** the column name for the PDTOKEN field */
const PDTOKEN = 'cc_trans.PDTOKEN';
/** the column name for the URL field */
const URL = 'cc_trans.URL';
/** the column name for the LOCALFILE field */
const LOCALFILE = 'cc_trans.LOCALFILE';
/** the column name for the FNAME field */
const FNAME = 'cc_trans.FNAME';
/** the column name for the TITLE field */
const TITLE = 'cc_trans.TITLE';
/** the column name for the EXPECTEDSUM field */
const EXPECTEDSUM = 'cc_trans.EXPECTEDSUM';
/** the column name for the REALSUM field */
const REALSUM = 'cc_trans.REALSUM';
/** the column name for the EXPECTEDSIZE field */
const EXPECTEDSIZE = 'cc_trans.EXPECTEDSIZE';
/** the column name for the REALSIZE field */
const REALSIZE = 'cc_trans.REALSIZE';
/** the column name for the UID field */
const UID = 'cc_trans.UID';
/** the column name for the ERRMSG field */
const ERRMSG = 'cc_trans.ERRMSG';
/** the column name for the JOBPID field */
const JOBPID = 'cc_trans.JOBPID';
/** the column name for the START field */
const START = 'cc_trans.START';
/** the column name for the TS field */
const TS = 'cc_trans.TS';
/**
* An identiy map to hold any loaded instances of CcTrans objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcTrans[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Trtok', 'Direction', 'State', 'Trtype', 'Lock', 'Target', 'Rtrtok', 'Mdtrtok', 'Gunid', 'Pdtoken', 'Url', 'Localfile', 'Fname', 'Title', 'Expectedsum', 'Realsum', 'Expectedsize', 'Realsize', 'Uid', 'Errmsg', 'Jobpid', 'Start', 'Ts', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'trtok', 'direction', 'state', 'trtype', 'lock', 'target', 'rtrtok', 'mdtrtok', 'gunid', 'pdtoken', 'url', 'localfile', 'fname', 'title', 'expectedsum', 'realsum', 'expectedsize', 'realsize', 'uid', 'errmsg', 'jobpid', 'start', 'ts', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::TRTOK, self::DIRECTION, self::STATE, self::TRTYPE, self::LOCK, self::TARGET, self::RTRTOK, self::MDTRTOK, self::GUNID, self::PDTOKEN, self::URL, self::LOCALFILE, self::FNAME, self::TITLE, self::EXPECTEDSUM, self::REALSUM, self::EXPECTEDSIZE, self::REALSIZE, self::UID, self::ERRMSG, self::JOBPID, self::START, self::TS, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TRTOK', 'DIRECTION', 'STATE', 'TRTYPE', 'LOCK', 'TARGET', 'RTRTOK', 'MDTRTOK', 'GUNID', 'PDTOKEN', 'URL', 'LOCALFILE', 'FNAME', 'TITLE', 'EXPECTEDSUM', 'REALSUM', 'EXPECTEDSIZE', 'REALSIZE', 'UID', 'ERRMSG', 'JOBPID', 'START', 'TS', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'trtok', 'direction', 'state', 'trtype', 'lock', 'target', 'rtrtok', 'mdtrtok', 'gunid', 'pdtoken', 'url', 'localfile', 'fname', 'title', 'expectedsum', 'realsum', 'expectedsize', 'realsize', 'uid', 'errmsg', 'jobpid', 'start', 'ts', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Trtok' => 1, 'Direction' => 2, 'State' => 3, 'Trtype' => 4, 'Lock' => 5, 'Target' => 6, 'Rtrtok' => 7, 'Mdtrtok' => 8, 'Gunid' => 9, 'Pdtoken' => 10, 'Url' => 11, 'Localfile' => 12, 'Fname' => 13, 'Title' => 14, 'Expectedsum' => 15, 'Realsum' => 16, 'Expectedsize' => 17, 'Realsize' => 18, 'Uid' => 19, 'Errmsg' => 20, 'Jobpid' => 21, 'Start' => 22, 'Ts' => 23, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'trtok' => 1, 'direction' => 2, 'state' => 3, 'trtype' => 4, 'lock' => 5, 'target' => 6, 'rtrtok' => 7, 'mdtrtok' => 8, 'gunid' => 9, 'pdtoken' => 10, 'url' => 11, 'localfile' => 12, 'fname' => 13, 'title' => 14, 'expectedsum' => 15, 'realsum' => 16, 'expectedsize' => 17, 'realsize' => 18, 'uid' => 19, 'errmsg' => 20, 'jobpid' => 21, 'start' => 22, 'ts' => 23, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TRTOK => 1, self::DIRECTION => 2, self::STATE => 3, self::TRTYPE => 4, self::LOCK => 5, self::TARGET => 6, self::RTRTOK => 7, self::MDTRTOK => 8, self::GUNID => 9, self::PDTOKEN => 10, self::URL => 11, self::LOCALFILE => 12, self::FNAME => 13, self::TITLE => 14, self::EXPECTEDSUM => 15, self::REALSUM => 16, self::EXPECTEDSIZE => 17, self::REALSIZE => 18, self::UID => 19, self::ERRMSG => 20, self::JOBPID => 21, self::START => 22, self::TS => 23, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TRTOK' => 1, 'DIRECTION' => 2, 'STATE' => 3, 'TRTYPE' => 4, 'LOCK' => 5, 'TARGET' => 6, 'RTRTOK' => 7, 'MDTRTOK' => 8, 'GUNID' => 9, 'PDTOKEN' => 10, 'URL' => 11, 'LOCALFILE' => 12, 'FNAME' => 13, 'TITLE' => 14, 'EXPECTEDSUM' => 15, 'REALSUM' => 16, 'EXPECTEDSIZE' => 17, 'REALSIZE' => 18, 'UID' => 19, 'ERRMSG' => 20, 'JOBPID' => 21, 'START' => 22, 'TS' => 23, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'trtok' => 1, 'direction' => 2, 'state' => 3, 'trtype' => 4, 'lock' => 5, 'target' => 6, 'rtrtok' => 7, 'mdtrtok' => 8, 'gunid' => 9, 'pdtoken' => 10, 'url' => 11, 'localfile' => 12, 'fname' => 13, 'title' => 14, 'expectedsum' => 15, 'realsum' => 16, 'expectedsize' => 17, 'realsize' => 18, 'uid' => 19, 'errmsg' => 20, 'jobpid' => 21, 'start' => 22, 'ts' => 23, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, )
);
/**
* 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. CcTransPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcTransPeer::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(CcTransPeer::ID);
$criteria->addSelectColumn(CcTransPeer::TRTOK);
$criteria->addSelectColumn(CcTransPeer::DIRECTION);
$criteria->addSelectColumn(CcTransPeer::STATE);
$criteria->addSelectColumn(CcTransPeer::TRTYPE);
$criteria->addSelectColumn(CcTransPeer::LOCK);
$criteria->addSelectColumn(CcTransPeer::TARGET);
$criteria->addSelectColumn(CcTransPeer::RTRTOK);
$criteria->addSelectColumn(CcTransPeer::MDTRTOK);
$criteria->addSelectColumn(CcTransPeer::GUNID);
$criteria->addSelectColumn(CcTransPeer::PDTOKEN);
$criteria->addSelectColumn(CcTransPeer::URL);
$criteria->addSelectColumn(CcTransPeer::LOCALFILE);
$criteria->addSelectColumn(CcTransPeer::FNAME);
$criteria->addSelectColumn(CcTransPeer::TITLE);
$criteria->addSelectColumn(CcTransPeer::EXPECTEDSUM);
$criteria->addSelectColumn(CcTransPeer::REALSUM);
$criteria->addSelectColumn(CcTransPeer::EXPECTEDSIZE);
$criteria->addSelectColumn(CcTransPeer::REALSIZE);
$criteria->addSelectColumn(CcTransPeer::UID);
$criteria->addSelectColumn(CcTransPeer::ERRMSG);
$criteria->addSelectColumn(CcTransPeer::JOBPID);
$criteria->addSelectColumn(CcTransPeer::START);
$criteria->addSelectColumn(CcTransPeer::TS);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.TRTOK');
$criteria->addSelectColumn($alias . '.DIRECTION');
$criteria->addSelectColumn($alias . '.STATE');
$criteria->addSelectColumn($alias . '.TRTYPE');
$criteria->addSelectColumn($alias . '.LOCK');
$criteria->addSelectColumn($alias . '.TARGET');
$criteria->addSelectColumn($alias . '.RTRTOK');
$criteria->addSelectColumn($alias . '.MDTRTOK');
$criteria->addSelectColumn($alias . '.GUNID');
$criteria->addSelectColumn($alias . '.PDTOKEN');
$criteria->addSelectColumn($alias . '.URL');
$criteria->addSelectColumn($alias . '.LOCALFILE');
$criteria->addSelectColumn($alias . '.FNAME');
$criteria->addSelectColumn($alias . '.TITLE');
$criteria->addSelectColumn($alias . '.EXPECTEDSUM');
$criteria->addSelectColumn($alias . '.REALSUM');
$criteria->addSelectColumn($alias . '.EXPECTEDSIZE');
$criteria->addSelectColumn($alias . '.REALSIZE');
$criteria->addSelectColumn($alias . '.UID');
$criteria->addSelectColumn($alias . '.ERRMSG');
$criteria->addSelectColumn($alias . '.JOBPID');
$criteria->addSelectColumn($alias . '.START');
$criteria->addSelectColumn($alias . '.TS');
}
}
/**
* 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(CcTransPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcTransPeer::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(CcTransPeer::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 CcTrans
* @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 = CcTransPeer::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 CcTransPeer::populateObjects(CcTransPeer::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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcTransPeer::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 CcTrans $value A CcTrans object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcTrans $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A CcTrans object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcTrans) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcTrans 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 CcTrans 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_trans
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* Retrieves the primary key from the DB resultset row
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CcTransPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcTransPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcTransPeer::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;
CcTransPeer::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 (CcTrans object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcTransPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcTransPeer::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 + CcTransPeer::NUM_COLUMNS;
} else {
$cls = CcTransPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcTransPeer::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(BaseCcTransPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcTransPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcTransTableMap());
}
}
/**
* 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 ? CcTransPeer::CLASS_DEFAULT : CcTransPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcTrans or Criteria object.
*
* @param mixed $values Criteria or CcTrans 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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcTrans object
}
if ($criteria->containsKey(CcTransPeer::ID) && $criteria->keyContainsValue(CcTransPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcTransPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->beginTransaction();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollBack();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a CcTrans or Criteria object.
*
* @param mixed $values Criteria or CcTrans 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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcTransPeer::ID);
$value = $criteria->remove(CcTransPeer::ID);
if ($value) {
$selectCriteria->add(CcTransPeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcTransPeer::TABLE_NAME);
}
} else { // $values is CcTrans 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_trans 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(CcTransPeer::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(CcTransPeer::TABLE_NAME, $con, CcTransPeer::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).
CcTransPeer::clearInstancePool();
CcTransPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcTrans or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcTrans 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(CcTransPeer::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.
CcTransPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcTrans) { // it's a model object
// invalidate the cache for this single object
CcTransPeer::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(CcTransPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcTransPeer::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);
CcTransPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcTrans 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 CcTrans $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(CcTrans $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcTransPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcTransPeer::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(CcTransPeer::DATABASE_NAME, CcTransPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcTrans
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcTransPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcTransPeer::DATABASE_NAME);
$criteria->add(CcTransPeer::ID, $pk);
$v = CcTransPeer::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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcTransPeer::DATABASE_NAME);
$criteria->add(CcTransPeer::ID, $pks, Criteria::IN);
$objs = CcTransPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcTransPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcTransPeer::buildTableMap();

View File

@ -0,0 +1,835 @@
<?php
/**
* Base class that represents a query for the 'cc_trans' table.
*
*
*
* @method CcTransQuery orderById($order = Criteria::ASC) Order by the id column
* @method CcTransQuery orderByTrtok($order = Criteria::ASC) Order by the trtok column
* @method CcTransQuery orderByDirection($order = Criteria::ASC) Order by the direction column
* @method CcTransQuery orderByState($order = Criteria::ASC) Order by the state column
* @method CcTransQuery orderByTrtype($order = Criteria::ASC) Order by the trtype column
* @method CcTransQuery orderByLock($order = Criteria::ASC) Order by the lock column
* @method CcTransQuery orderByTarget($order = Criteria::ASC) Order by the target column
* @method CcTransQuery orderByRtrtok($order = Criteria::ASC) Order by the rtrtok column
* @method CcTransQuery orderByMdtrtok($order = Criteria::ASC) Order by the mdtrtok column
* @method CcTransQuery orderByGunid($order = Criteria::ASC) Order by the gunid column
* @method CcTransQuery orderByPdtoken($order = Criteria::ASC) Order by the pdtoken column
* @method CcTransQuery orderByUrl($order = Criteria::ASC) Order by the url column
* @method CcTransQuery orderByLocalfile($order = Criteria::ASC) Order by the localfile column
* @method CcTransQuery orderByFname($order = Criteria::ASC) Order by the fname column
* @method CcTransQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method CcTransQuery orderByExpectedsum($order = Criteria::ASC) Order by the expectedsum column
* @method CcTransQuery orderByRealsum($order = Criteria::ASC) Order by the realsum column
* @method CcTransQuery orderByExpectedsize($order = Criteria::ASC) Order by the expectedsize column
* @method CcTransQuery orderByRealsize($order = Criteria::ASC) Order by the realsize column
* @method CcTransQuery orderByUid($order = Criteria::ASC) Order by the uid column
* @method CcTransQuery orderByErrmsg($order = Criteria::ASC) Order by the errmsg column
* @method CcTransQuery orderByJobpid($order = Criteria::ASC) Order by the jobpid column
* @method CcTransQuery orderByStart($order = Criteria::ASC) Order by the start column
* @method CcTransQuery orderByTs($order = Criteria::ASC) Order by the ts column
*
* @method CcTransQuery groupById() Group by the id column
* @method CcTransQuery groupByTrtok() Group by the trtok column
* @method CcTransQuery groupByDirection() Group by the direction column
* @method CcTransQuery groupByState() Group by the state column
* @method CcTransQuery groupByTrtype() Group by the trtype column
* @method CcTransQuery groupByLock() Group by the lock column
* @method CcTransQuery groupByTarget() Group by the target column
* @method CcTransQuery groupByRtrtok() Group by the rtrtok column
* @method CcTransQuery groupByMdtrtok() Group by the mdtrtok column
* @method CcTransQuery groupByGunid() Group by the gunid column
* @method CcTransQuery groupByPdtoken() Group by the pdtoken column
* @method CcTransQuery groupByUrl() Group by the url column
* @method CcTransQuery groupByLocalfile() Group by the localfile column
* @method CcTransQuery groupByFname() Group by the fname column
* @method CcTransQuery groupByTitle() Group by the title column
* @method CcTransQuery groupByExpectedsum() Group by the expectedsum column
* @method CcTransQuery groupByRealsum() Group by the realsum column
* @method CcTransQuery groupByExpectedsize() Group by the expectedsize column
* @method CcTransQuery groupByRealsize() Group by the realsize column
* @method CcTransQuery groupByUid() Group by the uid column
* @method CcTransQuery groupByErrmsg() Group by the errmsg column
* @method CcTransQuery groupByJobpid() Group by the jobpid column
* @method CcTransQuery groupByStart() Group by the start column
* @method CcTransQuery groupByTs() Group by the ts column
*
* @method CcTransQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcTransQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcTransQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcTrans findOne(PropelPDO $con = null) Return the first CcTrans matching the query
* @method CcTrans findOneOrCreate(PropelPDO $con = null) Return the first CcTrans matching the query, or a new CcTrans object populated from the query conditions when no match is found
*
* @method CcTrans findOneById(int $id) Return the first CcTrans filtered by the id column
* @method CcTrans findOneByTrtok(string $trtok) Return the first CcTrans filtered by the trtok column
* @method CcTrans findOneByDirection(string $direction) Return the first CcTrans filtered by the direction column
* @method CcTrans findOneByState(string $state) Return the first CcTrans filtered by the state column
* @method CcTrans findOneByTrtype(string $trtype) Return the first CcTrans filtered by the trtype column
* @method CcTrans findOneByLock(string $lock) Return the first CcTrans filtered by the lock column
* @method CcTrans findOneByTarget(string $target) Return the first CcTrans filtered by the target column
* @method CcTrans findOneByRtrtok(string $rtrtok) Return the first CcTrans filtered by the rtrtok column
* @method CcTrans findOneByMdtrtok(string $mdtrtok) Return the first CcTrans filtered by the mdtrtok column
* @method CcTrans findOneByGunid(string $gunid) Return the first CcTrans filtered by the gunid column
* @method CcTrans findOneByPdtoken(string $pdtoken) Return the first CcTrans filtered by the pdtoken column
* @method CcTrans findOneByUrl(string $url) Return the first CcTrans filtered by the url column
* @method CcTrans findOneByLocalfile(string $localfile) Return the first CcTrans filtered by the localfile column
* @method CcTrans findOneByFname(string $fname) Return the first CcTrans filtered by the fname column
* @method CcTrans findOneByTitle(string $title) Return the first CcTrans filtered by the title column
* @method CcTrans findOneByExpectedsum(string $expectedsum) Return the first CcTrans filtered by the expectedsum column
* @method CcTrans findOneByRealsum(string $realsum) Return the first CcTrans filtered by the realsum column
* @method CcTrans findOneByExpectedsize(int $expectedsize) Return the first CcTrans filtered by the expectedsize column
* @method CcTrans findOneByRealsize(int $realsize) Return the first CcTrans filtered by the realsize column
* @method CcTrans findOneByUid(int $uid) Return the first CcTrans filtered by the uid column
* @method CcTrans findOneByErrmsg(string $errmsg) Return the first CcTrans filtered by the errmsg column
* @method CcTrans findOneByJobpid(int $jobpid) Return the first CcTrans filtered by the jobpid column
* @method CcTrans findOneByStart(string $start) Return the first CcTrans filtered by the start column
* @method CcTrans findOneByTs(string $ts) Return the first CcTrans filtered by the ts column
*
* @method array findById(int $id) Return CcTrans objects filtered by the id column
* @method array findByTrtok(string $trtok) Return CcTrans objects filtered by the trtok column
* @method array findByDirection(string $direction) Return CcTrans objects filtered by the direction column
* @method array findByState(string $state) Return CcTrans objects filtered by the state column
* @method array findByTrtype(string $trtype) Return CcTrans objects filtered by the trtype column
* @method array findByLock(string $lock) Return CcTrans objects filtered by the lock column
* @method array findByTarget(string $target) Return CcTrans objects filtered by the target column
* @method array findByRtrtok(string $rtrtok) Return CcTrans objects filtered by the rtrtok column
* @method array findByMdtrtok(string $mdtrtok) Return CcTrans objects filtered by the mdtrtok column
* @method array findByGunid(string $gunid) Return CcTrans objects filtered by the gunid column
* @method array findByPdtoken(string $pdtoken) Return CcTrans objects filtered by the pdtoken column
* @method array findByUrl(string $url) Return CcTrans objects filtered by the url column
* @method array findByLocalfile(string $localfile) Return CcTrans objects filtered by the localfile column
* @method array findByFname(string $fname) Return CcTrans objects filtered by the fname column
* @method array findByTitle(string $title) Return CcTrans objects filtered by the title column
* @method array findByExpectedsum(string $expectedsum) Return CcTrans objects filtered by the expectedsum column
* @method array findByRealsum(string $realsum) Return CcTrans objects filtered by the realsum column
* @method array findByExpectedsize(int $expectedsize) Return CcTrans objects filtered by the expectedsize column
* @method array findByRealsize(int $realsize) Return CcTrans objects filtered by the realsize column
* @method array findByUid(int $uid) Return CcTrans objects filtered by the uid column
* @method array findByErrmsg(string $errmsg) Return CcTrans objects filtered by the errmsg column
* @method array findByJobpid(int $jobpid) Return CcTrans objects filtered by the jobpid column
* @method array findByStart(string $start) Return CcTrans objects filtered by the start column
* @method array findByTs(string $ts) Return CcTrans objects filtered by the ts column
*
* @package propel.generator.campcaster.om
*/
abstract class BaseCcTransQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcTransQuery 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 = 'campcaster', $modelName = 'CcTrans', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcTransQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcTransQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcTransQuery) {
return $criteria;
}
$query = new CcTransQuery();
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 CcTrans|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcTransPeer::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 CcTransQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcTransPeer::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 CcTransQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcTransPeer::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 CcTransQuery 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(CcTransPeer::ID, $id, $comparison);
}
/**
* Filter the query on the trtok column
*
* @param string $trtok 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 CcTransQuery The current query, for fluid interface
*/
public function filterByTrtok($trtok = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($trtok)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $trtok)) {
$trtok = str_replace('*', '%', $trtok);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::TRTOK, $trtok, $comparison);
}
/**
* Filter the query on the direction column
*
* @param string $direction 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 CcTransQuery The current query, for fluid interface
*/
public function filterByDirection($direction = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($direction)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $direction)) {
$direction = str_replace('*', '%', $direction);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::DIRECTION, $direction, $comparison);
}
/**
* Filter the query on the state column
*
* @param string $state 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 CcTransQuery The current query, for fluid interface
*/
public function filterByState($state = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($state)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $state)) {
$state = str_replace('*', '%', $state);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::STATE, $state, $comparison);
}
/**
* Filter the query on the trtype column
*
* @param string $trtype 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 CcTransQuery The current query, for fluid interface
*/
public function filterByTrtype($trtype = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($trtype)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $trtype)) {
$trtype = str_replace('*', '%', $trtype);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::TRTYPE, $trtype, $comparison);
}
/**
* Filter the query on the lock column
*
* @param string $lock 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 CcTransQuery The current query, for fluid interface
*/
public function filterByLock($lock = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($lock)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $lock)) {
$lock = str_replace('*', '%', $lock);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::LOCK, $lock, $comparison);
}
/**
* Filter the query on the target column
*
* @param string $target 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 CcTransQuery The current query, for fluid interface
*/
public function filterByTarget($target = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($target)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $target)) {
$target = str_replace('*', '%', $target);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::TARGET, $target, $comparison);
}
/**
* Filter the query on the rtrtok column
*
* @param string $rtrtok 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 CcTransQuery The current query, for fluid interface
*/
public function filterByRtrtok($rtrtok = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($rtrtok)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $rtrtok)) {
$rtrtok = str_replace('*', '%', $rtrtok);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::RTRTOK, $rtrtok, $comparison);
}
/**
* Filter the query on the mdtrtok column
*
* @param string $mdtrtok 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 CcTransQuery The current query, for fluid interface
*/
public function filterByMdtrtok($mdtrtok = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($mdtrtok)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $mdtrtok)) {
$mdtrtok = str_replace('*', '%', $mdtrtok);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::MDTRTOK, $mdtrtok, $comparison);
}
/**
* Filter the query on the gunid column
*
* @param string|array $gunid 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 CcTransQuery The current query, for fluid interface
*/
public function filterByGunid($gunid = null, $comparison = null)
{
if (is_array($gunid)) {
$useMinMax = false;
if (isset($gunid['min'])) {
$this->addUsingAlias(CcTransPeer::GUNID, $gunid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($gunid['max'])) {
$this->addUsingAlias(CcTransPeer::GUNID, $gunid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::GUNID, $gunid, $comparison);
}
/**
* Filter the query on the pdtoken column
*
* @param string|array $pdtoken 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 CcTransQuery The current query, for fluid interface
*/
public function filterByPdtoken($pdtoken = null, $comparison = null)
{
if (is_array($pdtoken)) {
$useMinMax = false;
if (isset($pdtoken['min'])) {
$this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($pdtoken['max'])) {
$this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken, $comparison);
}
/**
* Filter the query on the url column
*
* @param string $url 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 CcTransQuery The current query, for fluid interface
*/
public function filterByUrl($url = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($url)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $url)) {
$url = str_replace('*', '%', $url);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::URL, $url, $comparison);
}
/**
* Filter the query on the localfile column
*
* @param string $localfile 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 CcTransQuery The current query, for fluid interface
*/
public function filterByLocalfile($localfile = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($localfile)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $localfile)) {
$localfile = str_replace('*', '%', $localfile);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::LOCALFILE, $localfile, $comparison);
}
/**
* Filter the query on the fname column
*
* @param string $fname 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 CcTransQuery The current query, for fluid interface
*/
public function filterByFname($fname = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($fname)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $fname)) {
$fname = str_replace('*', '%', $fname);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::FNAME, $fname, $comparison);
}
/**
* Filter the query on the title column
*
* @param string $title 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 CcTransQuery The current query, for fluid interface
*/
public function filterByTitle($title = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($title)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $title)) {
$title = str_replace('*', '%', $title);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::TITLE, $title, $comparison);
}
/**
* Filter the query on the expectedsum column
*
* @param string $expectedsum 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 CcTransQuery The current query, for fluid interface
*/
public function filterByExpectedsum($expectedsum = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($expectedsum)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $expectedsum)) {
$expectedsum = str_replace('*', '%', $expectedsum);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::EXPECTEDSUM, $expectedsum, $comparison);
}
/**
* Filter the query on the realsum column
*
* @param string $realsum 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 CcTransQuery The current query, for fluid interface
*/
public function filterByRealsum($realsum = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($realsum)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $realsum)) {
$realsum = str_replace('*', '%', $realsum);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::REALSUM, $realsum, $comparison);
}
/**
* Filter the query on the expectedsize column
*
* @param int|array $expectedsize 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 CcTransQuery The current query, for fluid interface
*/
public function filterByExpectedsize($expectedsize = null, $comparison = null)
{
if (is_array($expectedsize)) {
$useMinMax = false;
if (isset($expectedsize['min'])) {
$this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($expectedsize['max'])) {
$this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize, $comparison);
}
/**
* Filter the query on the realsize column
*
* @param int|array $realsize 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 CcTransQuery The current query, for fluid interface
*/
public function filterByRealsize($realsize = null, $comparison = null)
{
if (is_array($realsize)) {
$useMinMax = false;
if (isset($realsize['min'])) {
$this->addUsingAlias(CcTransPeer::REALSIZE, $realsize['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($realsize['max'])) {
$this->addUsingAlias(CcTransPeer::REALSIZE, $realsize['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize, $comparison);
}
/**
* Filter the query on the uid column
*
* @param int|array $uid 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 CcTransQuery The current query, for fluid interface
*/
public function filterByUid($uid = null, $comparison = null)
{
if (is_array($uid)) {
$useMinMax = false;
if (isset($uid['min'])) {
$this->addUsingAlias(CcTransPeer::UID, $uid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($uid['max'])) {
$this->addUsingAlias(CcTransPeer::UID, $uid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::UID, $uid, $comparison);
}
/**
* Filter the query on the errmsg column
*
* @param string $errmsg 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 CcTransQuery The current query, for fluid interface
*/
public function filterByErrmsg($errmsg = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($errmsg)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $errmsg)) {
$errmsg = str_replace('*', '%', $errmsg);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcTransPeer::ERRMSG, $errmsg, $comparison);
}
/**
* Filter the query on the jobpid column
*
* @param int|array $jobpid 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 CcTransQuery The current query, for fluid interface
*/
public function filterByJobpid($jobpid = null, $comparison = null)
{
if (is_array($jobpid)) {
$useMinMax = false;
if (isset($jobpid['min'])) {
$this->addUsingAlias(CcTransPeer::JOBPID, $jobpid['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($jobpid['max'])) {
$this->addUsingAlias(CcTransPeer::JOBPID, $jobpid['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid, $comparison);
}
/**
* Filter the query on the start column
*
* @param string|array $start 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 CcTransQuery The current query, for fluid interface
*/
public function filterByStart($start = null, $comparison = null)
{
if (is_array($start)) {
$useMinMax = false;
if (isset($start['min'])) {
$this->addUsingAlias(CcTransPeer::START, $start['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($start['max'])) {
$this->addUsingAlias(CcTransPeer::START, $start['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::START, $start, $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 CcTransQuery 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(CcTransPeer::TS, $ts['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ts['max'])) {
$this->addUsingAlias(CcTransPeer::TS, $ts['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcTransPeer::TS, $ts, $comparison);
}
/**
* Exclude object from result
*
* @param CcTrans $ccTrans Object to remove from the list of results
*
* @return CcTransQuery The current query, for fluid interface
*/
public function prune($ccTrans = null)
{
if ($ccTrans) {
$this->addUsingAlias(CcTransPeer::ID, $ccTrans->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcTransQuery

View File

@ -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/backend/propel-db/runtime-conf.xml
$conf = array (
'datasources' =>
array (
'campcaster' =>
array (
'adapter' => 'pgsql',
'connection' =>
array (
'dsn' => 'pgsql:host=localhost;port=5432;dbname=Campcaster-naomiaro;user=test;password=test',
),
),
'default' => 'campcaster',
),
'generator_version' => '1.5.2',
);
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-campcaster-conf.php');
return $conf;

View File

@ -0,0 +1,88 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
return array (
'CcAccessTableMap' => 'campcaster/map/CcAccessTableMap.php',
'CcAccessPeer' => 'campcaster/CcAccessPeer.php',
'CcAccess' => 'campcaster/CcAccess.php',
'CcAccessQuery' => 'campcaster/CcAccessQuery.php',
'BaseCcAccessPeer' => 'campcaster/om/BaseCcAccessPeer.php',
'BaseCcAccess' => 'campcaster/om/BaseCcAccess.php',
'BaseCcAccessQuery' => 'campcaster/om/BaseCcAccessQuery.php',
'CcBackupTableMap' => 'campcaster/map/CcBackupTableMap.php',
'CcBackupPeer' => 'campcaster/CcBackupPeer.php',
'CcBackup' => 'campcaster/CcBackup.php',
'CcBackupQuery' => 'campcaster/CcBackupQuery.php',
'BaseCcBackupPeer' => 'campcaster/om/BaseCcBackupPeer.php',
'BaseCcBackup' => 'campcaster/om/BaseCcBackup.php',
'BaseCcBackupQuery' => 'campcaster/om/BaseCcBackupQuery.php',
'CcFilesTableMap' => 'campcaster/map/CcFilesTableMap.php',
'CcFilesPeer' => 'campcaster/CcFilesPeer.php',
'CcFiles' => 'campcaster/CcFiles.php',
'CcFilesQuery' => 'campcaster/CcFilesQuery.php',
'BaseCcFilesPeer' => 'campcaster/om/BaseCcFilesPeer.php',
'BaseCcFiles' => 'campcaster/om/BaseCcFiles.php',
'BaseCcFilesQuery' => 'campcaster/om/BaseCcFilesQuery.php',
'CcPermsTableMap' => 'campcaster/map/CcPermsTableMap.php',
'CcPermsPeer' => 'campcaster/CcPermsPeer.php',
'CcPerms' => 'campcaster/CcPerms.php',
'CcPermsQuery' => 'campcaster/CcPermsQuery.php',
'BaseCcPermsPeer' => 'campcaster/om/BaseCcPermsPeer.php',
'BaseCcPerms' => 'campcaster/om/BaseCcPerms.php',
'BaseCcPermsQuery' => 'campcaster/om/BaseCcPermsQuery.php',
'CcPlaylistTableMap' => 'campcaster/map/CcPlaylistTableMap.php',
'CcPlaylistPeer' => 'campcaster/CcPlaylistPeer.php',
'CcPlaylist' => 'campcaster/CcPlaylist.php',
'CcPlaylistQuery' => 'campcaster/CcPlaylistQuery.php',
'BaseCcPlaylistPeer' => 'campcaster/om/BaseCcPlaylistPeer.php',
'BaseCcPlaylist' => 'campcaster/om/BaseCcPlaylist.php',
'BaseCcPlaylistQuery' => 'campcaster/om/BaseCcPlaylistQuery.php',
'CcPlaylistcontentsTableMap' => 'campcaster/map/CcPlaylistcontentsTableMap.php',
'CcPlaylistcontentsPeer' => 'campcaster/CcPlaylistcontentsPeer.php',
'CcPlaylistcontents' => 'campcaster/CcPlaylistcontents.php',
'CcPlaylistcontentsQuery' => 'campcaster/CcPlaylistcontentsQuery.php',
'BaseCcPlaylistcontentsPeer' => 'campcaster/om/BaseCcPlaylistcontentsPeer.php',
'BaseCcPlaylistcontents' => 'campcaster/om/BaseCcPlaylistcontents.php',
'BaseCcPlaylistcontentsQuery' => 'campcaster/om/BaseCcPlaylistcontentsQuery.php',
'CcPrefTableMap' => 'campcaster/map/CcPrefTableMap.php',
'CcPrefPeer' => 'campcaster/CcPrefPeer.php',
'CcPref' => 'campcaster/CcPref.php',
'CcPrefQuery' => 'campcaster/CcPrefQuery.php',
'BaseCcPrefPeer' => 'campcaster/om/BaseCcPrefPeer.php',
'BaseCcPref' => 'campcaster/om/BaseCcPref.php',
'BaseCcPrefQuery' => 'campcaster/om/BaseCcPrefQuery.php',
'CcScheduleTableMap' => 'campcaster/map/CcScheduleTableMap.php',
'CcSchedulePeer' => 'campcaster/CcSchedulePeer.php',
'CcSchedule' => 'campcaster/CcSchedule.php',
'CcScheduleQuery' => 'campcaster/CcScheduleQuery.php',
'BaseCcSchedulePeer' => 'campcaster/om/BaseCcSchedulePeer.php',
'BaseCcSchedule' => 'campcaster/om/BaseCcSchedule.php',
'BaseCcScheduleQuery' => 'campcaster/om/BaseCcScheduleQuery.php',
'CcSessTableMap' => 'campcaster/map/CcSessTableMap.php',
'CcSessPeer' => 'campcaster/CcSessPeer.php',
'CcSess' => 'campcaster/CcSess.php',
'CcSessQuery' => 'campcaster/CcSessQuery.php',
'BaseCcSessPeer' => 'campcaster/om/BaseCcSessPeer.php',
'BaseCcSess' => 'campcaster/om/BaseCcSess.php',
'BaseCcSessQuery' => 'campcaster/om/BaseCcSessQuery.php',
'CcSmembTableMap' => 'campcaster/map/CcSmembTableMap.php',
'CcSmembPeer' => 'campcaster/CcSmembPeer.php',
'CcSmemb' => 'campcaster/CcSmemb.php',
'CcSmembQuery' => 'campcaster/CcSmembQuery.php',
'BaseCcSmembPeer' => 'campcaster/om/BaseCcSmembPeer.php',
'BaseCcSmemb' => 'campcaster/om/BaseCcSmemb.php',
'BaseCcSmembQuery' => 'campcaster/om/BaseCcSmembQuery.php',
'CcSubjsTableMap' => 'campcaster/map/CcSubjsTableMap.php',
'CcSubjsPeer' => 'campcaster/CcSubjsPeer.php',
'CcSubjs' => 'campcaster/CcSubjs.php',
'CcSubjsQuery' => 'campcaster/CcSubjsQuery.php',
'BaseCcSubjsPeer' => 'campcaster/om/BaseCcSubjsPeer.php',
'BaseCcSubjs' => 'campcaster/om/BaseCcSubjs.php',
'BaseCcSubjsQuery' => 'campcaster/om/BaseCcSubjsQuery.php',
'CcTransTableMap' => 'campcaster/map/CcTransTableMap.php',
'CcTransPeer' => 'campcaster/CcTransPeer.php',
'CcTrans' => 'campcaster/CcTrans.php',
'CcTransQuery' => 'campcaster/CcTransQuery.php',
'BaseCcTransPeer' => 'campcaster/om/BaseCcTransPeer.php',
'BaseCcTrans' => 'campcaster/om/BaseCcTrans.php',
'BaseCcTransQuery' => 'campcaster/om/BaseCcTransQuery.php',
);

View File

@ -0,0 +1,385 @@
-----------------------------------------------------------------------------
-- cc_access
-----------------------------------------------------------------------------
DROP TABLE "cc_access" CASCADE;
CREATE TABLE "cc_access"
(
"id" serial NOT NULL,
"gunid" INT8,
"token" INT8,
"chsum" CHAR(32) default '' NOT NULL,
"ext" VARCHAR(128) default '' NOT NULL,
"type" VARCHAR(20) default '' NOT NULL,
"parent" INT8,
"owner" INTEGER,
"ts" TIMESTAMP,
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_access" IS '';
SET search_path TO public;
CREATE INDEX "cc_access_gunid_idx" ON "cc_access" ("gunid");
CREATE INDEX "cc_access_parent_idx" ON "cc_access" ("parent");
CREATE INDEX "cc_access_token_idx" ON "cc_access" ("token");
-----------------------------------------------------------------------------
-- cc_backup
-----------------------------------------------------------------------------
DROP TABLE "cc_backup" CASCADE;
CREATE TABLE "cc_backup"
(
"token" VARCHAR(64) NOT NULL,
"sessionid" VARCHAR(64) NOT NULL,
"status" VARCHAR(32) NOT NULL,
"fromtime" TIMESTAMP NOT NULL,
"totime" TIMESTAMP NOT NULL,
PRIMARY KEY ("token")
);
COMMENT ON TABLE "cc_backup" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_files
-----------------------------------------------------------------------------
DROP TABLE "cc_files" CASCADE;
CREATE TABLE "cc_files"
(
"id" serial NOT NULL,
"gunid" INT8 NOT NULL,
"name" VARCHAR(255) default '' NOT NULL,
"mime" VARCHAR(255) default '' NOT NULL,
"ftype" VARCHAR(128) default '' NOT NULL,
"state" VARCHAR(128) default 'empty' NOT NULL,
"currentlyaccessing" INTEGER default 0 NOT NULL,
"editedby" INTEGER,
"mtime" TIMESTAMP(6),
"md5" CHAR(32),
"track_title" VARCHAR(512),
"artist_name" VARCHAR(512),
"bit_rate" VARCHAR(32),
"sample_rate" VARCHAR(32),
"format" VARCHAR(128),
"length" TIME,
"album_title" VARCHAR(512),
"genre" VARCHAR(64),
"comments" TEXT,
"year" VARCHAR(16),
"track_number" INTEGER,
"channels" INTEGER,
"url" VARCHAR(1024),
"bpm" VARCHAR(8),
"rating" VARCHAR(8),
"encoded_by" VARCHAR(255),
"disc_number" VARCHAR(8),
"mood" VARCHAR(64),
"label" VARCHAR(512),
"composer" VARCHAR(512),
"encoder" VARCHAR(64),
"checksum" VARCHAR(256),
"lyrics" TEXT,
"orchestra" VARCHAR(512),
"conductor" VARCHAR(512),
"lyricist" VARCHAR(512),
"original_lyricist" VARCHAR(512),
"radio_station_name" VARCHAR(512),
"info_url" VARCHAR(512),
"artist_url" VARCHAR(512),
"audio_source_url" VARCHAR(512),
"radio_station_url" VARCHAR(512),
"buy_this_url" VARCHAR(512),
"isrc_number" VARCHAR(512),
"catalog_number" VARCHAR(512),
"original_artist" VARCHAR(512),
"copyright" VARCHAR(512),
"report_datetime" VARCHAR(32),
"report_location" VARCHAR(512),
"report_organization" VARCHAR(512),
"subject" VARCHAR(512),
"contributor" VARCHAR(512),
"language" VARCHAR(512),
PRIMARY KEY ("id"),
CONSTRAINT "cc_files_gunid_idx" UNIQUE ("gunid")
);
COMMENT ON TABLE "cc_files" IS '';
SET search_path TO public;
CREATE INDEX "cc_files_md5_idx" ON "cc_files" ("md5");
CREATE INDEX "cc_files_name_idx" ON "cc_files" ("name");
-----------------------------------------------------------------------------
-- cc_perms
-----------------------------------------------------------------------------
DROP TABLE "cc_perms" CASCADE;
CREATE TABLE "cc_perms"
(
"permid" INTEGER NOT NULL,
"subj" INTEGER,
"action" VARCHAR(20),
"obj" INTEGER,
"type" CHAR(1),
PRIMARY KEY ("permid"),
CONSTRAINT "cc_perms_all_idx" UNIQUE ("subj","action","obj"),
CONSTRAINT "cc_perms_permid_idx" UNIQUE ("permid")
);
COMMENT ON TABLE "cc_perms" IS '';
SET search_path TO public;
CREATE INDEX "cc_perms_subj_obj_idx" ON "cc_perms" ("subj","obj");
-----------------------------------------------------------------------------
-- cc_playlist
-----------------------------------------------------------------------------
DROP TABLE "cc_playlist" CASCADE;
CREATE TABLE "cc_playlist"
(
"id" serial NOT NULL,
"name" VARCHAR(255) default '' NOT NULL,
"state" VARCHAR(128) default 'empty' NOT NULL,
"currentlyaccessing" INTEGER default 0 NOT NULL,
"editedby" INTEGER,
"mtime" TIMESTAMP(6),
"creator" VARCHAR(32),
"description" VARCHAR(512),
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_playlist" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_playlistcontents
-----------------------------------------------------------------------------
DROP TABLE "cc_playlistcontents" CASCADE;
CREATE TABLE "cc_playlistcontents"
(
"id" serial NOT NULL,
"playlist_id" INTEGER,
"file_id" INTEGER,
"position" INTEGER,
"cliplength" TIME default '00:00:00',
"cuein" TIME default '00:00:00',
"cueout" TIME default '00:00:00',
"fadein" TIME default '00:00:00',
"fadeout" TIME default '00:00:00',
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_playlistcontents" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_pref
-----------------------------------------------------------------------------
DROP TABLE "cc_pref" CASCADE;
CREATE TABLE "cc_pref"
(
"id" serial NOT NULL,
"subjid" INTEGER,
"keystr" VARCHAR(255),
"valstr" TEXT,
PRIMARY KEY ("id"),
CONSTRAINT "cc_pref_id_idx" UNIQUE ("id"),
CONSTRAINT "cc_pref_subj_key_idx" UNIQUE ("subjid","keystr")
);
COMMENT ON TABLE "cc_pref" IS '';
SET search_path TO public;
CREATE INDEX "cc_pref_subjid_idx" ON "cc_pref" ("subjid");
-----------------------------------------------------------------------------
-- cc_schedule
-----------------------------------------------------------------------------
DROP TABLE "cc_schedule" CASCADE;
CREATE TABLE "cc_schedule"
(
"id" INT8 NOT NULL,
"playlist_id" INTEGER NOT NULL,
"starts" TIMESTAMP NOT NULL,
"ends" TIMESTAMP NOT NULL,
"group_id" INTEGER,
"file_id" INTEGER,
"clip_length" TIME default '00:00:00',
"fade_in" TIME default '00:00:00',
"fade_out" TIME default '00:00:00',
"cue_in" TIME default '00:00:00',
"cue_out" TIME default '00:00:00',
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_schedule" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_sess
-----------------------------------------------------------------------------
DROP TABLE "cc_sess" CASCADE;
CREATE TABLE "cc_sess"
(
"sessid" CHAR(32) NOT NULL,
"userid" INTEGER,
"login" VARCHAR(255),
"ts" TIMESTAMP,
PRIMARY KEY ("sessid")
);
COMMENT ON TABLE "cc_sess" IS '';
SET search_path TO public;
CREATE INDEX "cc_sess_login_idx" ON "cc_sess" ("login");
CREATE INDEX "cc_sess_userid_idx" ON "cc_sess" ("userid");
-----------------------------------------------------------------------------
-- cc_smemb
-----------------------------------------------------------------------------
DROP TABLE "cc_smemb" CASCADE;
CREATE TABLE "cc_smemb"
(
"id" INTEGER NOT NULL,
"uid" INTEGER default 0 NOT NULL,
"gid" INTEGER default 0 NOT NULL,
"level" INTEGER default 0 NOT NULL,
"mid" INTEGER,
PRIMARY KEY ("id"),
CONSTRAINT "cc_smemb_id_idx" UNIQUE ("id")
);
COMMENT ON TABLE "cc_smemb" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_subjs
-----------------------------------------------------------------------------
DROP TABLE "cc_subjs" CASCADE;
CREATE TABLE "cc_subjs"
(
"id" INTEGER NOT NULL,
"login" VARCHAR(255) default '' NOT NULL,
"pass" VARCHAR(255) default '' NOT NULL,
"type" CHAR(1) default 'U' NOT NULL,
"realname" VARCHAR(255) default '' NOT NULL,
"lastlogin" TIMESTAMP,
"lastfail" TIMESTAMP,
PRIMARY KEY ("id"),
CONSTRAINT "cc_subjs_id_idx" UNIQUE ("id"),
CONSTRAINT "cc_subjs_login_idx" UNIQUE ("login")
);
COMMENT ON TABLE "cc_subjs" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_trans
-----------------------------------------------------------------------------
DROP TABLE "cc_trans" CASCADE;
CREATE TABLE "cc_trans"
(
"id" serial NOT NULL,
"trtok" CHAR(16) NOT NULL,
"direction" VARCHAR(128) NOT NULL,
"state" VARCHAR(128) NOT NULL,
"trtype" VARCHAR(128) NOT NULL,
"lock" CHAR(1) default 'N' NOT NULL,
"target" VARCHAR(255),
"rtrtok" CHAR(16),
"mdtrtok" CHAR(16),
"gunid" INT8,
"pdtoken" INT8,
"url" VARCHAR(255),
"localfile" VARCHAR(255),
"fname" VARCHAR(255),
"title" VARCHAR(255),
"expectedsum" CHAR(32),
"realsum" CHAR(32),
"expectedsize" INTEGER,
"realsize" INTEGER,
"uid" INTEGER,
"errmsg" VARCHAR(255),
"jobpid" INTEGER,
"start" TIMESTAMP,
"ts" TIMESTAMP,
PRIMARY KEY ("id"),
CONSTRAINT "cc_trans_id_idx" UNIQUE ("id"),
CONSTRAINT "cc_trans_token_idx" UNIQUE ("pdtoken"),
CONSTRAINT "cc_trans_trtok_idx" UNIQUE ("trtok")
);
COMMENT ON TABLE "cc_trans" IS '';
SET search_path TO public;
CREATE INDEX "cc_trans_gunid_idx" ON "cc_trans" ("gunid");
CREATE INDEX "cc_trans_state_idx" ON "cc_trans" ("state");
ALTER TABLE "cc_access" ADD CONSTRAINT "cc_access_owner_fkey" FOREIGN KEY ("owner") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey" FOREIGN KEY ("subj") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_pref" ADD CONSTRAINT "cc_pref_subjid_fkey" FOREIGN KEY ("subjid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey" FOREIGN KEY ("userid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;

View File

@ -0,0 +1,3 @@
DROP SEQUENCE schedule_group_id_seq CASCADE;
CREATE SEQUENCE schedule_group_id_seq;

View File

@ -0,0 +1,5 @@
# Sqlfile -> Database map
schema.sql=campcaster
sequences.sql=campcaster
views.sql=campcaster
triggers.sql=campcaster

View File

@ -0,0 +1,23 @@
----------------------------------------------------------------------------------
--calculate_position()
----------------------------------------------------------------------------------
DROP FUNCTION calculate_position() CASCADE;
CREATE FUNCTION calculate_position() RETURNS trigger AS
'
BEGIN
IF(TG_OP=''INSERT'') THEN
UPDATE cc_playlistcontents SET position = (position + 1)
WHERE (playlist_id = new.playlist_id AND position >= new.position AND id != new.id);
END IF;
IF(TG_OP=''DELETE'') THEN
UPDATE cc_playlistcontents SET position = (position - 1)
WHERE (playlist_id = old.playlist_id AND position > old.position);
END IF;
RETURN NULL;
END;
'
LANGUAGE 'plpgsql';
CREATE TRIGGER calculate_position AFTER INSERT OR DELETE ON cc_playlistcontents
FOR EACH ROW EXECUTE PROCEDURE calculate_position();

View File

@ -0,0 +1,11 @@
-------------------------------------------------------
---cc_playlisttimes
-------------------------------------------------------
CREATE VIEW cc_playlisttimes AS
SELECT pl.id, COALESCE(t.length, '00:00:00'::time without time zone) AS length
FROM cc_playlist pl
LEFT JOIN ( SELECT cc_playlistcontents.playlist_id AS id,
sum(cc_playlistcontents.cliplength::interval)::time without time zone AS length
FROM cc_playlistcontents
GROUP BY cc_playlistcontents.playlist_id) t ON pl.id = t.id;

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<config>
<propel>
<datasources default="campcaster">
<datasource id="campcaster">
<adapter>pgsql</adapter> <!-- sqlite, mysql, myssql, oracle, or pgsql -->
<connection>
<dsn>pgsql:host=localhost;port=5432;dbname=Campcaster-naomiaro;user=test;password=test</dsn>
</connection>
</datasource>
</datasources>
</propel>
</config>

View File

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Autogenerated by PropelSchemaReverseTask class.-->
<database name="campcaster" defaultIdMethod="native">
<table name="cc_access" phpName="CcAccess">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="gunid" phpName="Gunid" type="BIGINT" required="false"/>
<column name="token" phpName="Token" type="BIGINT" required="false"/>
<column name="chsum" phpName="Chsum" type="CHAR" size="32" required="true" defaultValue=""/>
<column name="ext" phpName="Ext" type="VARCHAR" size="128" required="true" defaultValue=""/>
<column name="type" phpName="Type" type="VARCHAR" size="20" required="true" defaultValue=""/>
<column name="parent" phpName="Parent" type="BIGINT" required="false"/>
<column name="owner" phpName="Owner" type="INTEGER" required="false"/>
<column name="ts" phpName="Ts" type="TIMESTAMP" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_access_owner_fkey">
<reference local="owner" foreign="id"/>
</foreign-key>
<index name="cc_access_gunid_idx">
<index-column name="gunid"/>
</index>
<index name="cc_access_parent_idx">
<index-column name="parent"/>
</index>
<index name="cc_access_token_idx">
<index-column name="token"/>
</index>
</table>
<table name="cc_backup" phpName="CcBackup">
<column name="token" phpName="Token" type="VARCHAR" size="64" primaryKey="true" required="true"/>
<column name="sessionid" phpName="Sessionid" type="VARCHAR" size="64" required="true"/>
<column name="status" phpName="Status" type="VARCHAR" size="32" required="true"/>
<column name="fromtime" phpName="Fromtime" type="TIMESTAMP" required="true"/>
<column name="totime" phpName="Totime" type="TIMESTAMP" required="true"/>
</table>
<table name="cc_files" phpName="CcFiles">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="gunid" phpName="Gunid" type="BIGINT" required="true"/>
<column name="name" phpName="Name" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="mime" phpName="Mime" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="ftype" phpName="Ftype" type="VARCHAR" size="128" required="true" defaultValue=""/>
<column name="state" phpName="State" type="VARCHAR" size="128" required="true" defaultValue="empty"/>
<column name="currentlyaccessing" phpName="Currentlyaccessing" type="INTEGER" required="true" defaultValue="0"/>
<column name="editedby" phpName="Editedby" type="INTEGER" required="false"/>
<column name="mtime" phpName="Mtime" type="TIMESTAMP" size="6" required="false"/>
<column name="md5" phpName="Md5" type="CHAR" size="32" required="false"/>
<column name="track_title" phpName="TrackTitle" type="VARCHAR" size="512" required="false"/>
<column name="artist_name" phpName="ArtistName" type="VARCHAR" size="512" required="false"/>
<column name="bit_rate" phpName="BitRate" type="VARCHAR" size="32" required="false"/>
<column name="sample_rate" phpName="SampleRate" type="VARCHAR" size="32" required="false"/>
<column name="format" phpName="Format" type="VARCHAR" size="128" required="false"/>
<column name="length" phpName="Length" type="TIME" required="false"/>
<column name="album_title" phpName="AlbumTitle" type="VARCHAR" size="512" required="false"/>
<column name="genre" phpName="Genre" type="VARCHAR" size="64" required="false"/>
<column name="comments" phpName="Comments" type="LONGVARCHAR" required="false"/>
<column name="year" phpName="Year" type="VARCHAR" size="16" required="false"/>
<column name="track_number" phpName="TrackNumber" type="INTEGER" required="false"/>
<column name="channels" phpName="Channels" type="INTEGER" required="false"/>
<column name="url" phpName="Url" type="VARCHAR" size="1024" required="false"/>
<column name="bpm" phpName="Bpm" type="VARCHAR" size="8" required="false"/>
<column name="rating" phpName="Rating" type="VARCHAR" size="8" required="false"/>
<column name="encoded_by" phpName="EncodedBy" type="VARCHAR" size="255" required="false"/>
<column name="disc_number" phpName="DiscNumber" type="VARCHAR" size="8" required="false"/>
<column name="mood" phpName="Mood" type="VARCHAR" size="64" required="false"/>
<column name="label" phpName="Label" type="VARCHAR" size="512" required="false"/>
<column name="composer" phpName="Composer" type="VARCHAR" size="512" required="false"/>
<column name="encoder" phpName="Encoder" type="VARCHAR" size="64" required="false"/>
<column name="checksum" phpName="Checksum" type="VARCHAR" size="256" required="false"/>
<column name="lyrics" phpName="Lyrics" type="LONGVARCHAR" required="false"/>
<column name="orchestra" phpName="Orchestra" type="VARCHAR" size="512" required="false"/>
<column name="conductor" phpName="Conductor" type="VARCHAR" size="512" required="false"/>
<column name="lyricist" phpName="Lyricist" type="VARCHAR" size="512" required="false"/>
<column name="original_lyricist" phpName="OriginalLyricist" type="VARCHAR" size="512" required="false"/>
<column name="radio_station_name" phpName="RadioStationName" type="VARCHAR" size="512" required="false"/>
<column name="info_url" phpName="InfoUrl" type="VARCHAR" size="512" required="false"/>
<column name="artist_url" phpName="ArtistUrl" type="VARCHAR" size="512" required="false"/>
<column name="audio_source_url" phpName="AudioSourceUrl" type="VARCHAR" size="512" required="false"/>
<column name="radio_station_url" phpName="RadioStationUrl" type="VARCHAR" size="512" required="false"/>
<column name="buy_this_url" phpName="BuyThisUrl" type="VARCHAR" size="512" required="false"/>
<column name="isrc_number" phpName="IsrcNumber" type="VARCHAR" size="512" required="false"/>
<column name="catalog_number" phpName="CatalogNumber" type="VARCHAR" size="512" required="false"/>
<column name="original_artist" phpName="OriginalArtist" type="VARCHAR" size="512" required="false"/>
<column name="copyright" phpName="Copyright" type="VARCHAR" size="512" required="false"/>
<column name="report_datetime" phpName="ReportDatetime" type="VARCHAR" size="32" required="false"/>
<column name="report_location" phpName="ReportLocation" type="VARCHAR" size="512" required="false"/>
<column name="report_organization" phpName="ReportOrganization" type="VARCHAR" size="512" required="false"/>
<column name="subject" phpName="Subject" type="VARCHAR" size="512" required="false"/>
<column name="contributor" phpName="Contributor" type="VARCHAR" size="512" required="false"/>
<column name="language" phpName="Language" type="VARCHAR" size="512" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_files_editedby_fkey">
<reference local="editedby" foreign="id"/>
</foreign-key>
<unique name="cc_files_gunid_idx">
<unique-column name="gunid"/>
</unique>
<index name="cc_files_md5_idx">
<index-column name="md5"/>
</index>
<index name="cc_files_name_idx">
<index-column name="name"/>
</index>
</table>
<table name="cc_perms" phpName="CcPerms">
<column name="permid" phpName="Permid" type="INTEGER" primaryKey="true" required="true"/>
<column name="subj" phpName="Subj" type="INTEGER" required="false"/>
<column name="action" phpName="Action" type="VARCHAR" size="20" required="false"/>
<column name="obj" phpName="Obj" type="INTEGER" required="false"/>
<column name="type" phpName="Type" type="CHAR" size="1" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_perms_subj_fkey" onDelete="CASCADE">
<reference local="subj" foreign="id"/>
</foreign-key>
<unique name="cc_perms_all_idx">
<unique-column name="subj"/>
<unique-column name="action"/>
<unique-column name="obj"/>
</unique>
<unique name="cc_perms_permid_idx">
<unique-column name="permid"/>
</unique>
<index name="cc_perms_subj_obj_idx">
<index-column name="subj"/>
<index-column name="obj"/>
</index>
</table>
<table name="cc_playlist" phpName="CcPlaylist">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="name" phpName="Name" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="state" phpName="State" type="VARCHAR" size="128" required="true" defaultValue="empty"/>
<column name="currentlyaccessing" phpName="Currentlyaccessing" type="INTEGER" required="true" defaultValue="0"/>
<column name="editedby" phpName="Editedby" type="INTEGER" required="false"/>
<column name="mtime" phpName="Mtime" type="TIMESTAMP" size="6" required="false"/>
<column name="creator" phpName="Creator" type="VARCHAR" size="32" required="false"/>
<column name="description" phpName="Description" type="VARCHAR" size="512" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_playlist_editedby_fkey">
<reference local="editedby" foreign="id"/>
</foreign-key>
</table>
<table name="cc_playlistcontents" phpName="CcPlaylistcontents">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="playlist_id" phpName="PlaylistId" type="INTEGER" required="false"/>
<column name="file_id" phpName="FileId" type="INTEGER" required="false"/>
<column name="position" phpName="Position" type="INTEGER" required="false"/>
<column name="cliplength" phpName="Cliplength" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="cuein" phpName="Cuein" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="cueout" phpName="Cueout" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="fadein" phpName="Fadein" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="fadeout" phpName="Fadeout" type="TIME" required="false" defaultValue="00:00:00"/>
<foreign-key foreignTable="cc_files" name="cc_playlistcontents_file_id_fkey" onDelete="CASCADE">
<reference local="file_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="cc_playlist" name="cc_playlistcontents_playlist_id_fkey" onDelete="CASCADE">
<reference local="playlist_id" foreign="id"/>
</foreign-key>
</table>
<table name="cc_pref" phpName="CcPref">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="subjid" phpName="Subjid" type="INTEGER" required="false"/>
<column name="keystr" phpName="Keystr" type="VARCHAR" size="255" required="false"/>
<column name="valstr" phpName="Valstr" type="LONGVARCHAR" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_pref_subjid_fkey" onDelete="CASCADE">
<reference local="subjid" foreign="id"/>
</foreign-key>
<unique name="cc_pref_id_idx">
<unique-column name="id"/>
</unique>
<unique name="cc_pref_subj_key_idx">
<unique-column name="subjid"/>
<unique-column name="keystr"/>
</unique>
<index name="cc_pref_subjid_idx">
<index-column name="subjid"/>
</index>
</table>
<table name="cc_schedule" phpName="CcSchedule">
<column name="id" phpName="Id" type="BIGINT" primaryKey="true" required="true"/>
<column name="playlist_id" phpName="PlaylistId" type="INTEGER" required="true"/>
<column name="starts" phpName="Starts" type="TIMESTAMP" required="true"/>
<column name="ends" phpName="Ends" type="TIMESTAMP" required="true"/>
<column name="group_id" phpName="GroupId" type="INTEGER" required="false"/>
<column name="file_id" phpName="FileId" type="INTEGER" required="false"/>
<column name="clip_length" phpName="ClipLength" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="fade_in" phpName="FadeIn" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="fade_out" phpName="FadeOut" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="cue_in" phpName="CueIn" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="cue_out" phpName="CueOut" type="TIME" required="false" defaultValue="00:00:00"/>
</table>
<table name="cc_sess" phpName="CcSess">
<column name="sessid" phpName="Sessid" type="CHAR" size="32" primaryKey="true" required="true"/>
<column name="userid" phpName="Userid" type="INTEGER" required="false"/>
<column name="login" phpName="Login" type="VARCHAR" size="255" required="false"/>
<column name="ts" phpName="Ts" type="TIMESTAMP" required="false"/>
<foreign-key foreignTable="cc_subjs" name="cc_sess_userid_fkey" onDelete="CASCADE">
<reference local="userid" foreign="id"/>
</foreign-key>
<index name="cc_sess_login_idx">
<index-column name="login"/>
</index>
<index name="cc_sess_userid_idx">
<index-column name="userid"/>
</index>
</table>
<table name="cc_smemb" phpName="CcSmemb">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" required="true"/>
<column name="uid" phpName="Uid" type="INTEGER" required="true" defaultValue="0"/>
<column name="gid" phpName="Gid" type="INTEGER" required="true" defaultValue="0"/>
<column name="level" phpName="Level" type="INTEGER" required="true" defaultValue="0"/>
<column name="mid" phpName="Mid" type="INTEGER" required="false"/>
<unique name="cc_smemb_id_idx">
<unique-column name="id"/>
</unique>
</table>
<table name="cc_subjs" phpName="CcSubjs">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" required="true"/>
<column name="login" phpName="Login" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="pass" phpName="Pass" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="type" phpName="Type" type="CHAR" size="1" required="true" defaultValue="U"/>
<column name="realname" phpName="Realname" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="lastlogin" phpName="Lastlogin" type="TIMESTAMP" required="false"/>
<column name="lastfail" phpName="Lastfail" type="TIMESTAMP" required="false"/>
<unique name="cc_subjs_id_idx">
<unique-column name="id"/>
</unique>
<unique name="cc_subjs_login_idx">
<unique-column name="login"/>
</unique>
</table>
<table name="cc_trans" phpName="CcTrans">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="trtok" phpName="Trtok" type="CHAR" size="16" required="true"/>
<column name="direction" phpName="Direction" type="VARCHAR" size="128" required="true"/>
<column name="state" phpName="State" type="VARCHAR" size="128" required="true"/>
<column name="trtype" phpName="Trtype" type="VARCHAR" size="128" required="true"/>
<column name="lock" phpName="Lock" type="CHAR" size="1" required="true" defaultValue="N"/>
<column name="target" phpName="Target" type="VARCHAR" size="255" required="false" defaultValue="NULL"/>
<column name="rtrtok" phpName="Rtrtok" type="CHAR" size="16" required="false" defaultValue="NULL"/>
<column name="mdtrtok" phpName="Mdtrtok" type="CHAR" size="16" required="false"/>
<column name="gunid" phpName="Gunid" type="BIGINT" required="false"/>
<column name="pdtoken" phpName="Pdtoken" type="BIGINT" required="false"/>
<column name="url" phpName="Url" type="VARCHAR" size="255" required="false"/>
<column name="localfile" phpName="Localfile" type="VARCHAR" size="255" required="false"/>
<column name="fname" phpName="Fname" type="VARCHAR" size="255" required="false"/>
<column name="title" phpName="Title" type="VARCHAR" size="255" required="false"/>
<column name="expectedsum" phpName="Expectedsum" type="CHAR" size="32" required="false"/>
<column name="realsum" phpName="Realsum" type="CHAR" size="32" required="false"/>
<column name="expectedsize" phpName="Expectedsize" type="INTEGER" required="false"/>
<column name="realsize" phpName="Realsize" type="INTEGER" required="false"/>
<column name="uid" phpName="Uid" type="INTEGER" required="false"/>
<column name="errmsg" phpName="Errmsg" type="VARCHAR" size="255" required="false"/>
<column name="jobpid" phpName="Jobpid" type="INTEGER" required="false"/>
<column name="start" phpName="Start" type="TIMESTAMP" required="false"/>
<column name="ts" phpName="Ts" type="TIMESTAMP" required="false"/>
<index name="cc_trans_gunid_idx">
<index-column name="gunid"/>
</index>
<unique name="cc_trans_id_idx">
<unique-column name="id"/>
</unique>
<index name="cc_trans_state_idx">
<index-column name="state"/>
</index>
<unique name="cc_trans_token_idx">
<unique-column name="pdtoken"/>
</unique>
<unique name="cc_trans_trtok_idx">
<unique-column name="trtok"/>
</unique>
</table>
</database>

View File

@ -0,0 +1,14 @@
<?php
// Include the main Propel script
require_once (__DIR__."/../../3rd_party/php/propel/runtime/lib/Propel.php");
// Initialize Propel with the runtime configuration
Propel::init(__DIR__."/build/conf/campcaster-conf.php");
// Add the generated 'classes' directory to the include path
set_include_path(__DIR__."/build/classes" . PATH_SEPARATOR . get_include_path());
$pl = new CcPlaylist();
$pl->setName("Playlist in Campcaster!");
$pl->save();