parent
722e470f6f
commit
1f3cbd8aba
|
@ -334,5 +334,57 @@ class Application_Common_DateHelper
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for calculations! Don't modify for display purposes!
|
||||
*
|
||||
* Convert playlist time value to float seconds
|
||||
*
|
||||
* @param string $plt
|
||||
* playlist interval value (HH:mm:ss.dddddd)
|
||||
* @return int
|
||||
* seconds
|
||||
*/
|
||||
public static function playlistTimeToSeconds($plt)
|
||||
{
|
||||
$arr = preg_split('/:/', $plt);
|
||||
if (isset($arr[2])) {
|
||||
return (intval($arr[0])*60 + intval($arr[1]))*60 + floatval($arr[2]);
|
||||
}
|
||||
if (isset($arr[1])) {
|
||||
return intval($arr[0])*60 + floatval($arr[1]);
|
||||
}
|
||||
|
||||
return floatval($arr[0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used for calculations! Don't modify for display purposes!
|
||||
*
|
||||
* Convert float seconds value to playlist time format
|
||||
*
|
||||
* @param float $seconds
|
||||
* @return string
|
||||
* interval in playlist time format (HH:mm:ss.d)
|
||||
*/
|
||||
public static function secondsToPlaylistTime($p_seconds)
|
||||
{
|
||||
$info = explode('.', $p_seconds);
|
||||
$seconds = $info[0];
|
||||
if (!isset($info[1])) {
|
||||
$milliStr = 0;
|
||||
} else {
|
||||
$milliStr = $info[1];
|
||||
}
|
||||
$hours = floor($seconds / 3600);
|
||||
$seconds -= $hours * 3600;
|
||||
$minutes = floor($seconds / 60);
|
||||
$seconds -= $minutes * 60;
|
||||
|
||||
$res = sprintf("%02d:%02d:%02d.%s", $hours, $minutes, $seconds, $milliStr);
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,13 +78,27 @@ return array (
|
|||
'BaseCcPlaylistcontentsPeer' => 'airtime/om/BaseCcPlaylistcontentsPeer.php',
|
||||
'BaseCcPlaylistcontents' => 'airtime/om/BaseCcPlaylistcontents.php',
|
||||
'BaseCcPlaylistcontentsQuery' => 'airtime/om/BaseCcPlaylistcontentsQuery.php',
|
||||
'CcPlaylistcriteriaTableMap' => 'airtime/map/CcPlaylistcriteriaTableMap.php',
|
||||
'CcPlaylistcriteriaPeer' => 'airtime/CcPlaylistcriteriaPeer.php',
|
||||
'CcPlaylistcriteria' => 'airtime/CcPlaylistcriteria.php',
|
||||
'CcPlaylistcriteriaQuery' => 'airtime/CcPlaylistcriteriaQuery.php',
|
||||
'BaseCcPlaylistcriteriaPeer' => 'airtime/om/BaseCcPlaylistcriteriaPeer.php',
|
||||
'BaseCcPlaylistcriteria' => 'airtime/om/BaseCcPlaylistcriteria.php',
|
||||
'BaseCcPlaylistcriteriaQuery' => 'airtime/om/BaseCcPlaylistcriteriaQuery.php',
|
||||
'CcBlockTableMap' => 'airtime/map/CcBlockTableMap.php',
|
||||
'CcBlockPeer' => 'airtime/CcBlockPeer.php',
|
||||
'CcBlock' => 'airtime/CcBlock.php',
|
||||
'CcBlockQuery' => 'airtime/CcBlockQuery.php',
|
||||
'BaseCcBlockPeer' => 'airtime/om/BaseCcBlockPeer.php',
|
||||
'BaseCcBlock' => 'airtime/om/BaseCcBlock.php',
|
||||
'BaseCcBlockQuery' => 'airtime/om/BaseCcBlockQuery.php',
|
||||
'CcBlockcontentsTableMap' => 'airtime/map/CcBlockcontentsTableMap.php',
|
||||
'CcBlockcontentsPeer' => 'airtime/CcBlockcontentsPeer.php',
|
||||
'CcBlockcontents' => 'airtime/CcBlockcontents.php',
|
||||
'CcBlockcontentsQuery' => 'airtime/CcBlockcontentsQuery.php',
|
||||
'BaseCcBlockcontentsPeer' => 'airtime/om/BaseCcBlockcontentsPeer.php',
|
||||
'BaseCcBlockcontents' => 'airtime/om/BaseCcBlockcontents.php',
|
||||
'BaseCcBlockcontentsQuery' => 'airtime/om/BaseCcBlockcontentsQuery.php',
|
||||
'CcBlockcriteriaTableMap' => 'airtime/map/CcBlockcriteriaTableMap.php',
|
||||
'CcBlockcriteriaPeer' => 'airtime/CcBlockcriteriaPeer.php',
|
||||
'CcBlockcriteria' => 'airtime/CcBlockcriteria.php',
|
||||
'CcBlockcriteriaQuery' => 'airtime/CcBlockcriteriaQuery.php',
|
||||
'BaseCcBlockcriteriaPeer' => 'airtime/om/BaseCcBlockcriteriaPeer.php',
|
||||
'BaseCcBlockcriteria' => 'airtime/om/BaseCcBlockcriteria.php',
|
||||
'BaseCcBlockcriteriaQuery' => 'airtime/om/BaseCcBlockcriteriaQuery.php',
|
||||
'CcPrefTableMap' => 'airtime/map/CcPrefTableMap.php',
|
||||
'CcPrefPeer' => 'airtime/CcPrefPeer.php',
|
||||
'CcPref' => 'airtime/CcPref.php',
|
||||
|
|
|
@ -24,10 +24,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('set-playlist-description', 'json')
|
||||
->addActionContext('playlist-preview', 'json')
|
||||
->addActionContext('get-playlist', 'json')
|
||||
->addActionContext('smart-playlist-criteria-save', 'json')
|
||||
->addActionContext('smart-playlist-generate', 'json')
|
||||
->addActionContext('smart-playlist-shuffle', 'json')
|
||||
->addActionContext('new-block', 'json')
|
||||
->addActionContext('smart-block-criteria-save', 'json')
|
||||
->addActionContext('smart-block-generate', 'json')
|
||||
->addActionContext('smart-block-shuffle', 'json')
|
||||
->initContext();
|
||||
|
||||
/*$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
|
||||
|
@ -192,13 +191,16 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
if($isAdminOrPM || $obj->getCreatorId() == $userInfo->id){
|
||||
$this->view->obj = $obj;
|
||||
//$form = new Application_Form_SmartBlockCriteria();
|
||||
//$form->startForm($this->pl_sess->id);
|
||||
//$this->view->form = $form;
|
||||
if($this->obj_sess->type == "block"){
|
||||
$form = new Application_Form_SmartBlockCriteria();
|
||||
$form->startForm($this->obj_sess->id);
|
||||
$this->view->form = $form;
|
||||
}
|
||||
}
|
||||
|
||||
$formatter = new LengthFormatter($obj->getLength());
|
||||
$this->view->length = $formatter->format();
|
||||
$this->view->type = $this->obj_sess->type;
|
||||
}
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound();
|
||||
|
@ -318,7 +320,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
catch (PlaylistOutDatedException $e) {
|
||||
$this->playlistOutdated($obj, $e);
|
||||
$this->playlistOutdated($e);
|
||||
}
|
||||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound($obj_type);
|
||||
|
@ -505,24 +507,24 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function smartPlaylistCriteriaSaveAction()
|
||||
public function smartBlockCriteriaSaveAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
$pl = new Application_Model_Playlist($params['pl_id']);
|
||||
$result = $pl->saveSmartPlaylistCriteria($params['data']);
|
||||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
$result = $bl->saveSmartBlockCriteria($params['data']);
|
||||
die(json_encode($result));
|
||||
}
|
||||
|
||||
public function smartPlaylistGenerateAction()
|
||||
public function smartBlockGenerateAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
$pl = new Application_Model_Playlist($params['pl_id']);
|
||||
$result = $pl->generateSmartPlaylist($params['data']);
|
||||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
$result = $bl->generateSmartBlock($params['data']);
|
||||
if ($result['result'] == 0) {
|
||||
try {
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($pl, true))));
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
|
||||
}
|
||||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound('block');
|
||||
|
@ -535,15 +537,15 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
public function smartPlaylistShuffleAction()
|
||||
public function smartBlockShuffleAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getPost();
|
||||
$pl = new Application_Model_Playlist($params['pl_id']);
|
||||
$result = $pl->shuffleSmartPlaylist();
|
||||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
$result = $bl->shuffleSmartBlock();
|
||||
if ($result['result'] == 0) {
|
||||
try {
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($pl, true))));
|
||||
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
|
||||
}
|
||||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound('block');
|
||||
|
|
|
@ -6,7 +6,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
}
|
||||
|
||||
public function startForm($p_playlistId)
|
||||
public function startForm($p_blockId)
|
||||
{
|
||||
$criteriaOptions = array(
|
||||
0 => "Select criteria",
|
||||
|
@ -94,26 +94,26 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
);
|
||||
|
||||
// load type
|
||||
$out = CcPlaylistQuery::create()->findPk($p_playlistId);
|
||||
$out = CcBlockQuery::create()->findPk($p_blockId);
|
||||
if ($out->getDbType() == "static") {
|
||||
$playlistType = 0;
|
||||
$blockType = 0;
|
||||
} else {
|
||||
$playlistType = 1;
|
||||
$blockType = 1;
|
||||
}
|
||||
|
||||
|
||||
$spType = new Zend_Form_Element_Radio('sp_type');
|
||||
$spType->setLabel('Set smart playlist type:')
|
||||
$spType->setLabel('Set smart block type:')
|
||||
->setDecorators(array('viewHelper'))
|
||||
->setMultiOptions(array(
|
||||
'static' => 'Static',
|
||||
'dynamic' => 'Dynamic'
|
||||
))
|
||||
->setValue($playlistType);
|
||||
->setValue($blockType);
|
||||
$this->addElement($spType);
|
||||
|
||||
|
||||
// load criteria from db
|
||||
$out = CcPlaylistcriteriaQuery::create()->findByDbPlaylistId($p_playlistId);
|
||||
$out = CcBlockcriteriaQuery::create()->findByDbBlockId($p_blockId);
|
||||
|
||||
$storedCrit = array();
|
||||
foreach ($out as $crit) {
|
||||
|
@ -129,9 +129,9 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
|
||||
$openSmartPlaylistOption = false;
|
||||
$openSmartBlockOption = false;
|
||||
if (!empty($storedCrit)) {
|
||||
$openSmartPlaylistOption = true;
|
||||
$openSmartBlockOption = true;
|
||||
}
|
||||
|
||||
$numElements = count($criteriaOptions);
|
||||
|
@ -212,9 +212,9 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$limitValue->setValue($storedCrit["limit"]["value"]);
|
||||
}
|
||||
|
||||
//getting playlist content candidate count that meets criteria
|
||||
$pl = new Application_Model_Playlist($p_playlistId);
|
||||
$files = $pl->getListofFilesMeetCriteria();
|
||||
//getting block content candidate count that meets criteria
|
||||
$bl = new Application_Model_Block($p_blockId);
|
||||
$files = $bl->getListofFilesMeetCriteria();
|
||||
|
||||
$save = new Zend_Form_Element_Button('save_button');
|
||||
$save->setAttrib('class', 'ui-button ui-state-default sp-button');
|
||||
|
@ -226,7 +226,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
$generate = new Zend_Form_Element_Button('generate_button');
|
||||
$generate->setAttrib('class', 'ui-button ui-state-default sp-button');
|
||||
$generate->setAttrib('title', 'Save criteria and generate playlist content');
|
||||
$generate->setAttrib('title', 'Save criteria and generate block content');
|
||||
$generate->setIgnore(true);
|
||||
$generate->setLabel('Generate');
|
||||
$generate->setDecorators(array('viewHelper'));
|
||||
|
@ -234,14 +234,14 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
$shuffle = new Zend_Form_Element_Button('shuffle_button');
|
||||
$shuffle->setAttrib('class', 'ui-button ui-state-default sp-button');
|
||||
$shuffle->setAttrib('title', 'Shuffle playlist content');
|
||||
$shuffle->setAttrib('title', 'Shuffle block content');
|
||||
$shuffle->setIgnore(true);
|
||||
$shuffle->setLabel('Shuffle');
|
||||
$shuffle->setDecorators(array('viewHelper'));
|
||||
$this->addElement($shuffle);
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/smart-block-criteria.phtml', "openOption"=> $openSmartPlaylistOption,
|
||||
array('ViewScript', array('viewScript' => 'form/smart-block-criteria.phtml', "openOption"=> $openSmartBlockOption,
|
||||
'criteriasLength' => count($criteriaOptions), 'poolCount' => $files['count']))
|
||||
));
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,48 +45,6 @@ class Application_Model_Playlist
|
|||
"dc:description" => "Description",
|
||||
"dcterms:extent" => "Length"
|
||||
);
|
||||
|
||||
private static $modifier2CriteriaMap = array(
|
||||
"contains" => Criteria::ILIKE,
|
||||
"does not contain" => Criteria::NOT_ILIKE,
|
||||
"is" => Criteria::EQUAL,
|
||||
"is not" => Criteria::NOT_EQUAL,
|
||||
"starts with" => Criteria::ILIKE,
|
||||
"ends with" => Criteria::ILIKE,
|
||||
"is greater than" => Criteria::GREATER_THAN,
|
||||
"is less than" => Criteria::LESS_THAN,
|
||||
"is in the range" => Criteria::CUSTOM);
|
||||
|
||||
private static $criteria2PeerMap = array(
|
||||
0 => "Select criteria",
|
||||
"album_title" => "DbAlbumTitle",
|
||||
"artist_name" => "DbArtistName",
|
||||
"bit_rate" => "DbBitRate",
|
||||
"bpm" => "DbBpm",
|
||||
"comments" => "DbComments",
|
||||
"composer" => "DbComposer",
|
||||
"conductor" => "DbConductor",
|
||||
"utime" => "DbUtime",
|
||||
"mtime" => "DbMtime",
|
||||
"lptime" => "DbLPtime",
|
||||
"disc_number" => "DbDiscNumber",
|
||||
"genre" => "DbGenre",
|
||||
"isrc_number" => "DbIsrcNumber",
|
||||
"label" => "DbLabel",
|
||||
"language" => "DbLanguage",
|
||||
"length" => "DbLength",
|
||||
"lyricist" => "DbLyricist",
|
||||
"mood" => "DbMood",
|
||||
"name" => "DbName",
|
||||
"orchestra" => "DbOrchestra",
|
||||
"radio_station_name" => "DbRadioStation",
|
||||
"rating" => "DbRating",
|
||||
"sample_rate" => "DbSampleRate",
|
||||
"track_title" => "DbTrackTitle",
|
||||
"track_num" => "DbTrackNum",
|
||||
"year" => "DbYear"
|
||||
);
|
||||
|
||||
|
||||
public function __construct($id=null, $con=null)
|
||||
{
|
||||
|
@ -214,9 +172,9 @@ class Application_Model_Playlist
|
|||
$files[$i] = $row->toArray(BasePeer::TYPE_FIELDNAME, true, true);
|
||||
|
||||
|
||||
$clipSec = Application_Model_Playlist::playlistTimeToSeconds($files[$i]['cliplength']);
|
||||
$clipSec = Application_Common_DateHelper::playlistTimeToSeconds($files[$i]['cliplength']);
|
||||
$offset += $clipSec;
|
||||
$offset_cliplength = Application_Model_Playlist::secondsToPlaylistTime($offset);
|
||||
$offset_cliplength = Application_Common_DateHelper::secondsToPlaylistTime($offset);
|
||||
|
||||
//format the length for UI.
|
||||
$formatter = new LengthFormatter($files[$i]['cliplength']);
|
||||
|
@ -297,14 +255,6 @@ class Application_Model_Playlist
|
|||
throw new Exception("trying to add a file that does not exist.");
|
||||
}
|
||||
}
|
||||
|
||||
public function isStatic(){
|
||||
if ($this->pl->getDbType() == "static") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @param array $p_items
|
||||
|
@ -781,58 +731,6 @@ class Application_Model_Playlist
|
|||
$this->$method($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is used for calculations! Don't modify for display purposes!
|
||||
*
|
||||
* Convert playlist time value to float seconds
|
||||
*
|
||||
* @param string $plt
|
||||
* playlist interval value (HH:mm:ss.dddddd)
|
||||
* @return int
|
||||
* seconds
|
||||
*/
|
||||
public static function playlistTimeToSeconds($plt)
|
||||
{
|
||||
$arr = preg_split('/:/', $plt);
|
||||
if (isset($arr[2])) {
|
||||
return (intval($arr[0])*60 + intval($arr[1]))*60 + floatval($arr[2]);
|
||||
}
|
||||
if (isset($arr[1])) {
|
||||
return intval($arr[0])*60 + floatval($arr[1]);
|
||||
}
|
||||
|
||||
return floatval($arr[0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used for calculations! Don't modify for display purposes!
|
||||
*
|
||||
* Convert float seconds value to playlist time format
|
||||
*
|
||||
* @param float $seconds
|
||||
* @return string
|
||||
* interval in playlist time format (HH:mm:ss.d)
|
||||
*/
|
||||
public static function secondsToPlaylistTime($p_seconds)
|
||||
{
|
||||
$info = explode('.', $p_seconds);
|
||||
$seconds = $info[0];
|
||||
if (!isset($info[1])) {
|
||||
$milliStr = 0;
|
||||
} else {
|
||||
$milliStr = $info[1];
|
||||
}
|
||||
$hours = floor($seconds / 3600);
|
||||
$seconds -= $hours * 3600;
|
||||
$minutes = floor($seconds / 60);
|
||||
$seconds -= $minutes * 60;
|
||||
|
||||
$res = sprintf("%02d:%02d:%02d.%s", $hours, $minutes, $seconds, $milliStr);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public static function getPlaylistCount()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
@ -888,291 +786,6 @@ class Application_Model_Playlist
|
|||
{
|
||||
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
}
|
||||
|
||||
|
||||
// smart playlist functions start
|
||||
public function shuffleSmartPlaylist(){
|
||||
// if it here that means it's static pl
|
||||
$this->saveType("static");
|
||||
$contents = CcPlaylistcontentsQuery::create()
|
||||
->filterByDbPlaylistId($this->id)
|
||||
->orderByDbPosition()
|
||||
->find();
|
||||
$shuffledPos = range(0, count($contents)-1);
|
||||
shuffle($shuffledPos);
|
||||
$temp = new CcPlaylist();
|
||||
foreach ($contents as $item) {
|
||||
$item->setDbPosition(array_shift($shuffledPos));
|
||||
$item->save();
|
||||
}
|
||||
return array("result"=>0);
|
||||
}
|
||||
|
||||
public function saveType($p_playlistType)
|
||||
{
|
||||
// saving dynamic/static flag
|
||||
CcPlaylistQuery::create()->findPk($this->id)->setDbType($p_playlistType)->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves smart playlist criteria
|
||||
* @param array $p_criteria
|
||||
*/
|
||||
public function saveSmartPlaylistCriteria($p_criteria)
|
||||
{
|
||||
$data = $this->organizeSmartPlyalistCriteria($p_criteria);
|
||||
// things we need to check
|
||||
// 1. limit value shouldn't be empty and has upperbound of 24 hrs
|
||||
// 2. sp_criteria or sp_criteria_modifier shouldn't be 0
|
||||
// 3. validate formate according to DB column type
|
||||
$multiplier = 1;
|
||||
$result = 0;
|
||||
$errors = array();
|
||||
$error = array();
|
||||
|
||||
// saving dynamic/static flag
|
||||
$playlistType = $data['etc']['sp_type'] == 0 ? 'static':'dynamic';
|
||||
$this->saveType($playlistType);
|
||||
|
||||
// validation start
|
||||
if ($data['etc']['sp_limit_options'] == 'hours') {
|
||||
$multiplier = 60;
|
||||
}
|
||||
if ($data['etc']['sp_limit_options'] == 'hours' || $data['etc']['sp_limit_options'] == 'mins') {
|
||||
if ($data['etc']['sp_limit_value'] == "" || floatval($data['etc']['sp_limit_value']) <= 0) {
|
||||
$error[] = "Limit cannot be empty or smaller than 0";
|
||||
} else {
|
||||
$mins = $data['etc']['sp_limit_value'] * $multiplier;
|
||||
if ($mins > 14400) {
|
||||
$error[] = "Limit cannot be more than 24 hrs";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($data['etc']['sp_limit_value'] == "" || floatval($data['etc']['sp_limit_value']) <= 0) {
|
||||
$error[] = "Limit cannot be empty or smaller than 0";
|
||||
} else if (floatval($data['etc']['sp_limit_value']) < 1) {
|
||||
$error[] = "The value should be an integer";
|
||||
}
|
||||
}
|
||||
|
||||
if (count($error) > 0){
|
||||
$errors[] = array("element"=>"sp_limit_value", "msg"=>$error);
|
||||
}
|
||||
|
||||
foreach ($data['criteria'] as $key=>$d){
|
||||
$error = array();
|
||||
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$d['sp_criteria_field']]);
|
||||
// check for not selected select box
|
||||
if ($d['sp_criteria_field'] == "0" || $d['sp_criteria_modifier'] == "0"){
|
||||
$error[] = "You must select Criteria and Modifier";
|
||||
} else {
|
||||
// validation on type of column
|
||||
if ($d['sp_criteria_field'] == 'length') {
|
||||
if (!preg_match("/(\d{2}):(\d{2}):(\d{2})/", $d['sp_criteria_value'])) {
|
||||
$error[] = "'Length' should be in '00:00:00' format";
|
||||
}
|
||||
} else if ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
||||
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_value'])) {
|
||||
$error[] = "The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00";
|
||||
} else if (!Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_value'])) {
|
||||
// check for if it is in valid range( 1753-01-01 ~ 12/31/9999 )
|
||||
$error[] = "$d[sp_criteria_value] is not a valid date/time string";
|
||||
}
|
||||
|
||||
if (isset($d['sp_criteria_extra'])) {
|
||||
if (!preg_match("/(\d{4})-(\d{2})-(\d{2})/", $d['sp_criteria_extra'])) {
|
||||
$error[] = "The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00";
|
||||
} else if (!Application_Common_DateHelper::checkDateTimeRangeForSQL($d['sp_criteria_extra'])) {
|
||||
// check for if it is in valid range( 1753-01-01 ~ 12/31/9999 )
|
||||
$error[] = "$d[sp_criteria_extra] is not a valid date/time string";
|
||||
}
|
||||
}
|
||||
} else if ($column->getType() == PropelColumnTypes::INTEGER) {
|
||||
if (!is_numeric($d['sp_criteria_value'])) {
|
||||
$error[] = "The value has to be numeric";
|
||||
}
|
||||
// length check
|
||||
if (intval($d['sp_criteria_value']) >= pow(2,31)) {
|
||||
$error[] = "The value should be less then 2147483648";
|
||||
}
|
||||
} else if ($column->getType() == PropelColumnTypes::VARCHAR) {
|
||||
if (strlen($d['sp_criteria_value']) > $column->getSize()) {
|
||||
$error[] = "The value should be less ".$column->getSize()." characters";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($d['sp_criteria_value'] == "") {
|
||||
$error[] = "Value cannot be empty";
|
||||
}
|
||||
if(count($error) > 0){
|
||||
$errors[] = array("element"=>"sp_criteria_field_".$key, "msg"=>$error);
|
||||
}
|
||||
}
|
||||
$result = count($errors) > 0 ? 1 :0;
|
||||
if ($result == 0) {
|
||||
$this->storeCriteriaIntoDb($data);
|
||||
}
|
||||
|
||||
//get number of files that meet the criteria
|
||||
$files = $this->getListofFilesMeetCriteria();
|
||||
|
||||
return array("result"=>$result, "errors"=>$errors, "poolCount"=>$files["count"]);
|
||||
}
|
||||
|
||||
public function storeCriteriaIntoDb($p_criteriaData){
|
||||
// delete criteria under $p_playlistId
|
||||
CcPlaylistcriteriaQuery::create()->findByDbPlaylistId($this->id)->delete();
|
||||
|
||||
foreach( $p_criteriaData['criteria'] as $d){
|
||||
$qry = new CcPlaylistcriteria();
|
||||
$qry->setDbCriteria($d['sp_criteria_field'])
|
||||
->setDbModifier($d['sp_criteria_modifier'])
|
||||
->setDbValue($d['sp_criteria_value'])
|
||||
->setDbPlaylistId($this->id);
|
||||
|
||||
if (isset($d['sp_criteria_extra'])) {
|
||||
$qry->setDbExtra($d['sp_criteria_extra']);
|
||||
}
|
||||
$qry->save();
|
||||
}
|
||||
|
||||
// insert limit info
|
||||
$qry = new CcPlaylistcriteria();
|
||||
$qry->setDbCriteria("limit")
|
||||
->setDbModifier($p_criteriaData['etc']['sp_limit_options'])
|
||||
->setDbValue($p_criteriaData['etc']['sp_limit_value'])
|
||||
->setDbPlaylistId($this->id)
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* generate list of tracks. This function saves creiteria and generate
|
||||
* tracks.
|
||||
* @param array $p_criteria
|
||||
*/
|
||||
public function generateSmartPlaylist($p_criteria, $returnList=false)
|
||||
{
|
||||
$result = $this->saveSmartPlaylistCriteria($p_criteria);
|
||||
if ($result['result'] != 0) {
|
||||
return $result;
|
||||
} else {
|
||||
$insertList = $this->getListOfFilesUnderLimit();
|
||||
$this->deleteAllFilesFromPlaylist();
|
||||
$this->addAudioClips(array_keys($insertList));
|
||||
return array("result"=>0);
|
||||
}
|
||||
}
|
||||
|
||||
public function getListOfFilesUnderLimit()
|
||||
{
|
||||
$info = $this->getListofFilesMeetCriteria();
|
||||
$files = $info['files'];
|
||||
$limit = $info['limit'];
|
||||
|
||||
$insertList = array();
|
||||
$totalTime = 0;
|
||||
|
||||
// this moves the pointer to the first element in the collection
|
||||
$files->getFirst();
|
||||
$iterator = $files->getIterator();
|
||||
while ($iterator->valid() && $totalTime < $limit['time']) {
|
||||
$id = $iterator->current()->getDbId();
|
||||
$length = Application_Common_DateHelper::calculateLengthInSeconds($iterator->current()->getDbLength());
|
||||
$insertList[$id] = $length;
|
||||
$totalTime += $length;
|
||||
if ( !is_null($limit['items']) && $limit['items'] == count($insertList)) {
|
||||
break;
|
||||
}
|
||||
|
||||
$iterator->next();
|
||||
}
|
||||
return $insertList;
|
||||
}
|
||||
|
||||
// this function return list of propel object
|
||||
public function getListofFilesMeetCriteria()
|
||||
{
|
||||
$out = CcPlaylistcriteriaQuery::create()->findByDbPlaylistId($this->id);
|
||||
$storedCrit = array();
|
||||
foreach ($out as $crit) {
|
||||
$criteria = $crit->getDbCriteria();
|
||||
$modifier = $crit->getDbModifier();
|
||||
$value = $crit->getDbValue();
|
||||
$extra = $crit->getDbExtra();
|
||||
|
||||
if($criteria == "limit"){
|
||||
$storedCrit["limit"] = array("value"=>$value, "modifier"=>$modifier);
|
||||
}else{
|
||||
$storedCrit["crit"][] = array("criteria"=>$criteria, "value"=>$value, "modifier"=>$modifier, "extra"=>$extra);
|
||||
}
|
||||
}
|
||||
|
||||
$qry = CcFilesQuery::create();
|
||||
|
||||
if (isset($storedCrit["crit"])) {
|
||||
foreach ($storedCrit["crit"] as $criteria) {
|
||||
$spCriteriaPhpName = self::$criteria2PeerMap[$criteria['criteria']];
|
||||
$spCriteria = $criteria['criteria'];
|
||||
|
||||
$spCriteriaModifier = $criteria['modifier'];
|
||||
$spCriteriaValue = $criteria['value'];
|
||||
if ($spCriteriaModifier == "starts with") {
|
||||
$spCriteriaValue = "$spCriteriaValue%";
|
||||
} else if ($spCriteriaModifier == "ends with") {
|
||||
$spCriteriaValue = "%$spCriteriaValue";
|
||||
} else if ($spCriteriaModifier == "contains" || $spCriteriaModifier == "does not contain") {
|
||||
$spCriteriaValue = "%$spCriteriaValue%";
|
||||
} else if ($spCriteriaModifier == "is in the range") {
|
||||
$spCriteriaValue = "$spCriteria > '$spCriteriaValue' AND $spCriteria < '$criteria[extra]'";
|
||||
}
|
||||
$spCriteriaModifier = self::$modifier2CriteriaMap[$spCriteriaModifier];
|
||||
try{
|
||||
$qry->filterBy($spCriteriaPhpName, $spCriteriaValue, $spCriteriaModifier);
|
||||
$qry->addAscendingOrderByColumn('random()');
|
||||
}catch (Exception $e){
|
||||
Logging::log($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
// construct limit restriction
|
||||
$limits = array();
|
||||
if (isset($storedCrit['limit'])) {
|
||||
if ($storedCrit['limit']['modifier'] == "items") {
|
||||
$limits['time'] = 1440 * 60;
|
||||
$limits['items'] = $storedCrit['limit']['value'];
|
||||
} else {
|
||||
$limits['time'] = $storedCrit['limit']['modifier'] == "hours" ? intval($storedCrit['limit']['value']) * 60 * 60 : intval($storedCrit['limit']['value'] * 60);
|
||||
$limits['items'] = null;
|
||||
}
|
||||
}
|
||||
try{
|
||||
$out = $qry->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find();
|
||||
return array("files"=>$out, "limit"=>$limits, "count"=>$out->count());
|
||||
}catch(Exception $e){
|
||||
Logging::log($e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static function organizeSmartPlyalistCriteria($p_criteria)
|
||||
{
|
||||
$fieldNames = array('sp_criteria_field', 'sp_criteria_modifier', 'sp_criteria_value', 'sp_criteria_extra');
|
||||
$output = array();
|
||||
foreach ($p_criteria as $ele) {
|
||||
$index = strrpos($ele['name'], '_');
|
||||
$fieldName = substr($ele['name'], 0, $index);
|
||||
if (in_array($fieldName, $fieldNames)) {
|
||||
$rowNum = intval(substr($ele['name'], $index+1));
|
||||
$output['criteria'][$rowNum][$fieldName] = trim($ele['value']);
|
||||
}else{
|
||||
$output['etc'][$ele['name']] = $ele['value'];
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
// smart playlist functions end
|
||||
|
||||
} // class Playlist
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_block' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlock extends BaseCcBlock {
|
||||
|
||||
} // CcBlock
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_block' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockPeer extends BaseCcBlockPeer {
|
||||
|
||||
} // CcBlockPeer
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_block' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockQuery extends BaseCcBlockQuery {
|
||||
|
||||
} // CcBlockQuery
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_blockcontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockcontents extends BaseCcBlockcontents {
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [fadein] column value.
|
||||
*
|
||||
* @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 getDbFadein($format = "s.u")
|
||||
{
|
||||
return parent::getDbFadein($format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [optionally formatted] temporal [fadein] column value.
|
||||
*
|
||||
* @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 getDbFadeout($format = "s.u")
|
||||
{
|
||||
return parent::getDbFadeout($format);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
|
||||
*
|
||||
* @return CcPlaylistcontents The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbFadein($v)
|
||||
{
|
||||
if ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
}
|
||||
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
|
||||
$dt = DateTime::createFromFormat("s.u", $v);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
$dt = new DateTime($v);
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||
}
|
||||
}
|
||||
|
||||
$this->fadein = $dt->format('H:i:s.u');
|
||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
||||
|
||||
return $this;
|
||||
} // setDbFadein()
|
||||
|
||||
/**
|
||||
*
|
||||
* @param String in format SS.uuuuuu, Datetime, or DateTime accepted string.
|
||||
*
|
||||
* @return CcPlaylistcontents The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbFadeout($v)
|
||||
{
|
||||
if ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
}
|
||||
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
|
||||
$dt = DateTime::createFromFormat("s.u", $v);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
$dt = new DateTime($v);
|
||||
} catch (Exception $x) {
|
||||
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
|
||||
}
|
||||
}
|
||||
|
||||
$this->fadeout = $dt->format('H:i:s.u');
|
||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
||||
|
||||
return $this;
|
||||
} // setDbFadeout()
|
||||
|
||||
} // CcBlockcontents
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_blockcontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockcontentsPeer extends BaseCcBlockcontentsPeer {
|
||||
|
||||
} // CcBlockcontentsPeer
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_blockcontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockcontentsQuery extends BaseCcBlockcontentsQuery {
|
||||
|
||||
} // CcBlockcontentsQuery
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_blockcriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockcriteria extends BaseCcBlockcriteria {
|
||||
|
||||
} // CcBlockcriteria
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_blockcriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockcriteriaPeer extends BaseCcBlockcriteriaPeer {
|
||||
|
||||
} // CcBlockcriteriaPeer
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'cc_blockcriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package propel.generator.airtime
|
||||
*/
|
||||
class CcBlockcriteriaQuery extends BaseCcBlockcriteriaQuery {
|
||||
|
||||
} // CcBlockcriteriaQuery
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_block' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcBlockTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcBlockTableMap';
|
||||
|
||||
/**
|
||||
* 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_block');
|
||||
$this->setPhpName('CcBlock');
|
||||
$this->setClassname('CcBlock');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_block_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
||||
$this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('TYPE', 'DbType', 'VARCHAR', false, 7, 'static');
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), null, null);
|
||||
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'aggregate_column' => array('name' => 'length', 'expression' => 'SUM(cliplength)', 'foreign_table' => 'cc_blockcontents', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
|
||||
} // CcBlockTableMap
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_blockcontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcBlockcontentsTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcBlockcontentsTableMap';
|
||||
|
||||
/**
|
||||
* 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_blockcontents');
|
||||
$this->setPhpName('CcBlockcontents');
|
||||
$this->setClassname('CcBlockcontents');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_blockcontents_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null);
|
||||
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CLIPLENGTH', 'DbCliplength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUEIN', 'DbCuein', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUEOUT', 'DbCueout', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('FADEIN', 'DbFadein', 'TIME', false, null, '00:00:00');
|
||||
$this->addColumn('FADEOUT', 'DbFadeout', 'TIME', false, null, '00:00:00');
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'aggregate_column_relation' => array('foreign_table' => 'cc_block', 'update_method' => 'updateDbLength', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
|
||||
} // CcBlockcontentsTableMap
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_blockcriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcBlockcriteriaTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcBlockcriteriaTableMap';
|
||||
|
||||
/**
|
||||
* 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_blockcriteria');
|
||||
$this->setPhpName('CcBlockcriteria');
|
||||
$this->setClassname('CcBlockcriteria');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_blockcriteria_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('CRITERIA', 'DbCriteria', 'VARCHAR', true, 16, null);
|
||||
$this->addColumn('MODIFIER', 'DbModifier', 'VARCHAR', true, 16, null);
|
||||
$this->addColumn('VALUE', 'DbValue', 'VARCHAR', true, 512, null);
|
||||
$this->addColumn('EXTRA', 'DbExtra', 'VARCHAR', false, 512, null);
|
||||
$this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', true, null, null);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
} // CcBlockcriteriaTableMap
|
|
@ -114,6 +114,7 @@ class CcFilesTableMap extends TableMap {
|
|||
$this->addRelation('CcMusicDirs', 'CcMusicDirs', RelationMap::MANY_TO_ONE, array('directory' => 'id', ), null, null);
|
||||
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ class CcPlaylistTableMap extends TableMap {
|
|||
{
|
||||
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), null, null);
|
||||
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcPlaylistcriteria', 'CcPlaylistcriteria', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,7 @@ class CcPlaylistcontentsTableMap extends TableMap {
|
|||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null);
|
||||
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||
$this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null);
|
||||
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CLIPLENGTH', 'DbCliplength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUEIN', 'DbCuein', 'VARCHAR', false, null, '00:00:00');
|
||||
|
@ -56,6 +57,7 @@ class CcPlaylistcontentsTableMap extends TableMap {
|
|||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ class CcPlaylistcriteriaTableMap extends TableMap {
|
|||
$this->addColumn('VALUE', 'DbValue', 'VARCHAR', true, 512, null);
|
||||
$this->addColumn('EXTRA', 'DbExtra', 'VARCHAR', false, 512, null);
|
||||
$this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', true, null, null);
|
||||
$this->addColumn('SET_NUMBER', 'DbSetNumber', 'INTEGER', true, null, null);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_section' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcSectionTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcSectionTableMap';
|
||||
|
||||
/**
|
||||
* 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_section');
|
||||
$this->setPhpName('CcSection');
|
||||
$this->setClassname('CcSection');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_section_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
|
||||
$this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addColumn('UTIME', 'DbUtime', 'TIMESTAMP', false, 6, null);
|
||||
$this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
|
||||
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
|
||||
$this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('TYPE', 'DbType', 'VARCHAR', false, 7, 'static');
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), null, null);
|
||||
$this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'section_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcSectioncontents', 'CcSectioncontents', RelationMap::ONE_TO_MANY, array('id' => 'section_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcSectioncriteria', 'CcSectioncriteria', RelationMap::ONE_TO_MANY, array('id' => 'section_id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'aggregate_column' => array('name' => 'length', 'expression' => 'SUM(cliplength)', 'foreign_table' => 'cc_sectioncontents', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
|
||||
} // CcSectionTableMap
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_sectioncontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcSectioncontentsTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcSectioncontentsTableMap';
|
||||
|
||||
/**
|
||||
* 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_sectioncontents');
|
||||
$this->setPhpName('CcSectioncontents');
|
||||
$this->setClassname('CcSectioncontents');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_sectioncontents_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('SECTION_ID', 'DbSectionId', 'INTEGER', 'cc_section', 'ID', false, null, null);
|
||||
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
|
||||
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
|
||||
$this->addColumn('CLIPLENGTH', 'DbCliplength', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUEIN', 'DbCuein', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('CUEOUT', 'DbCueout', 'VARCHAR', false, null, '00:00:00');
|
||||
$this->addColumn('FADEIN', 'DbFadein', 'TIME', false, null, '00:00:00');
|
||||
$this->addColumn('FADEOUT', 'DbFadeout', 'TIME', false, null, '00:00:00');
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcSection', 'CcSection', RelationMap::MANY_TO_ONE, array('section_id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the list of behaviors registered for this table
|
||||
*
|
||||
* @return array Associative array (name => parameters) of behaviors
|
||||
*/
|
||||
public function getBehaviors()
|
||||
{
|
||||
return array(
|
||||
'aggregate_column_relation' => array('foreign_table' => 'cc_section', 'update_method' => 'updateDbLength', ),
|
||||
);
|
||||
} // getBehaviors()
|
||||
|
||||
} // CcSectioncontentsTableMap
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'cc_sectioncriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package propel.generator.airtime.map
|
||||
*/
|
||||
class CcSectioncriteriaTableMap extends TableMap {
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'airtime.map.CcSectioncriteriaTableMap';
|
||||
|
||||
/**
|
||||
* 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_sectioncriteria');
|
||||
$this->setPhpName('CcSectioncriteria');
|
||||
$this->setClassname('CcSectioncriteria');
|
||||
$this->setPackage('airtime');
|
||||
$this->setUseIdGenerator(true);
|
||||
$this->setPrimaryKeyMethodInfo('cc_sectioncriteria_id_seq');
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
|
||||
$this->addColumn('CRITERIA', 'DbCriteria', 'VARCHAR', true, 16, null);
|
||||
$this->addColumn('MODIFIER', 'DbModifier', 'VARCHAR', true, 16, null);
|
||||
$this->addColumn('VALUE', 'DbValue', 'VARCHAR', true, 512, null);
|
||||
$this->addColumn('EXTRA', 'DbExtra', 'VARCHAR', false, 512, null);
|
||||
$this->addForeignKey('SECTION_ID', 'DbPlaylistId', 'INTEGER', 'cc_section', 'ID', true, null, null);
|
||||
// validators
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('CcSection', 'CcSection', RelationMap::MANY_TO_ONE, array('section_id' => 'id', ), 'CASCADE', null);
|
||||
} // buildRelations()
|
||||
|
||||
} // CcSectioncriteriaTableMap
|
|
@ -64,6 +64,7 @@ class CcSubjsTableMap extends TableMap {
|
|||
$this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null);
|
||||
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null);
|
||||
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), null, null);
|
||||
$this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 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);
|
||||
$this->addRelation('CcSubjsToken', 'CcSubjsToken', RelationMap::ONE_TO_MANY, array('id' => 'user_id', ), 'CASCADE', null);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,646 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'cc_block' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method CcBlockQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcBlockQuery orderByDbName($order = Criteria::ASC) Order by the name column
|
||||
* @method CcBlockQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
|
||||
* @method CcBlockQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
|
||||
* @method CcBlockQuery orderByDbCreatorId($order = Criteria::ASC) Order by the creator_id column
|
||||
* @method CcBlockQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
|
||||
* @method CcBlockQuery orderByDbLength($order = Criteria::ASC) Order by the length column
|
||||
* @method CcBlockQuery orderByDbType($order = Criteria::ASC) Order by the type column
|
||||
*
|
||||
* @method CcBlockQuery groupByDbId() Group by the id column
|
||||
* @method CcBlockQuery groupByDbName() Group by the name column
|
||||
* @method CcBlockQuery groupByDbMtime() Group by the mtime column
|
||||
* @method CcBlockQuery groupByDbUtime() Group by the utime column
|
||||
* @method CcBlockQuery groupByDbCreatorId() Group by the creator_id column
|
||||
* @method CcBlockQuery groupByDbDescription() Group by the description column
|
||||
* @method CcBlockQuery groupByDbLength() Group by the length column
|
||||
* @method CcBlockQuery groupByDbType() Group by the type column
|
||||
*
|
||||
* @method CcBlockQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcBlockQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcBlockQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcBlockQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
|
||||
* @method CcBlockQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
|
||||
* @method CcBlockQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
|
||||
*
|
||||
* @method CcBlockQuery leftJoinCcPlaylistcontents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlaylistcontents relation
|
||||
* @method CcBlockQuery rightJoinCcPlaylistcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylistcontents relation
|
||||
* @method CcBlockQuery innerJoinCcPlaylistcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylistcontents relation
|
||||
*
|
||||
* @method CcBlockQuery leftJoinCcBlockcontents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlockcontents relation
|
||||
* @method CcBlockQuery rightJoinCcBlockcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlockcontents relation
|
||||
* @method CcBlockQuery innerJoinCcBlockcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlockcontents relation
|
||||
*
|
||||
* @method CcBlockQuery leftJoinCcBlockcriteria($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlockcriteria relation
|
||||
* @method CcBlockQuery rightJoinCcBlockcriteria($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlockcriteria relation
|
||||
* @method CcBlockQuery innerJoinCcBlockcriteria($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlockcriteria relation
|
||||
*
|
||||
* @method CcBlock findOne(PropelPDO $con = null) Return the first CcBlock matching the query
|
||||
* @method CcBlock findOneOrCreate(PropelPDO $con = null) Return the first CcBlock matching the query, or a new CcBlock object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcBlock findOneByDbId(int $id) Return the first CcBlock filtered by the id column
|
||||
* @method CcBlock findOneByDbName(string $name) Return the first CcBlock filtered by the name column
|
||||
* @method CcBlock findOneByDbMtime(string $mtime) Return the first CcBlock filtered by the mtime column
|
||||
* @method CcBlock findOneByDbUtime(string $utime) Return the first CcBlock filtered by the utime column
|
||||
* @method CcBlock findOneByDbCreatorId(int $creator_id) Return the first CcBlock filtered by the creator_id column
|
||||
* @method CcBlock findOneByDbDescription(string $description) Return the first CcBlock filtered by the description column
|
||||
* @method CcBlock findOneByDbLength(string $length) Return the first CcBlock filtered by the length column
|
||||
* @method CcBlock findOneByDbType(string $type) Return the first CcBlock filtered by the type column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcBlock objects filtered by the id column
|
||||
* @method array findByDbName(string $name) Return CcBlock objects filtered by the name column
|
||||
* @method array findByDbMtime(string $mtime) Return CcBlock objects filtered by the mtime column
|
||||
* @method array findByDbUtime(string $utime) Return CcBlock objects filtered by the utime column
|
||||
* @method array findByDbCreatorId(int $creator_id) Return CcBlock objects filtered by the creator_id column
|
||||
* @method array findByDbDescription(string $description) Return CcBlock objects filtered by the description column
|
||||
* @method array findByDbLength(string $length) Return CcBlock objects filtered by the length column
|
||||
* @method array findByDbType(string $type) Return CcBlock objects filtered by the type column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcBlockQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCcBlockQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'airtime', $modelName = 'CcBlock', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CcBlockQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CcBlockQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CcBlockQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CcBlockQuery();
|
||||
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 CcBlock|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ((null !== ($obj = CcBlockPeer::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 CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
return $this->addUsingAlias(CcBlockPeer::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 CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
return $this->addUsingAlias(CcBlockPeer::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* @param int|array $dbId The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbId($dbId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbId) && null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::ID, $dbId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the name column
|
||||
*
|
||||
* @param string $dbName The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbName($dbName = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbName)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbName)) {
|
||||
$dbName = str_replace('*', '%', $dbName);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::NAME, $dbName, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the mtime column
|
||||
*
|
||||
* @param string|array $dbMtime The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbMtime($dbMtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbMtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbMtime['min'])) {
|
||||
$this->addUsingAlias(CcBlockPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbMtime['max'])) {
|
||||
$this->addUsingAlias(CcBlockPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::MTIME, $dbMtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the utime column
|
||||
*
|
||||
* @param string|array $dbUtime The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbUtime($dbUtime = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbUtime)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbUtime['min'])) {
|
||||
$this->addUsingAlias(CcBlockPeer::UTIME, $dbUtime['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbUtime['max'])) {
|
||||
$this->addUsingAlias(CcBlockPeer::UTIME, $dbUtime['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::UTIME, $dbUtime, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the creator_id column
|
||||
*
|
||||
* @param int|array $dbCreatorId 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 CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCreatorId($dbCreatorId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbCreatorId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbCreatorId['min'])) {
|
||||
$this->addUsingAlias(CcBlockPeer::CREATOR_ID, $dbCreatorId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbCreatorId['max'])) {
|
||||
$this->addUsingAlias(CcBlockPeer::CREATOR_ID, $dbCreatorId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::CREATOR_ID, $dbCreatorId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the description column
|
||||
*
|
||||
* @param string $dbDescription The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbDescription($dbDescription = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbDescription)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbDescription)) {
|
||||
$dbDescription = str_replace('*', '%', $dbDescription);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::DESCRIPTION, $dbDescription, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the length column
|
||||
*
|
||||
* @param string $dbLength The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbLength($dbLength = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbLength)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbLength)) {
|
||||
$dbLength = str_replace('*', '%', $dbLength);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::LENGTH, $dbLength, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the type column
|
||||
*
|
||||
* @param string $dbType 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 CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbType($dbType = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbType)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbType)) {
|
||||
$dbType = str_replace('*', '%', $dbType);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockPeer::TYPE, $dbType, $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 CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcSubjs($ccSubjs, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockPeer::CREATOR_ID, $ccSubjs->getDbId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcSubjs relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcBlockQuery 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 CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockPeer::ID, $ccPlaylistcontents->getDbBlockId(), $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 CcBlockQuery 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');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcBlockcontents object
|
||||
*
|
||||
* @param CcBlockcontents $ccBlockcontents the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcBlockcontents($ccBlockcontents, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockPeer::ID, $ccBlockcontents->getDbBlockId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlockcontents relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcBlockcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlockcontents');
|
||||
|
||||
// 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, 'CcBlockcontents');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlockcontents relation CcBlockcontents 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 CcBlockcontentsQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlockcontents($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlockcontents', 'CcBlockcontentsQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcBlockcriteria object
|
||||
*
|
||||
* @param CcBlockcriteria $ccBlockcriteria the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcBlockcriteria($ccBlockcriteria, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockPeer::ID, $ccBlockcriteria->getDbBlockId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlockcriteria relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcBlockcriteria($relationAlias = '', $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlockcriteria');
|
||||
|
||||
// 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, 'CcBlockcriteria');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlockcriteria relation CcBlockcriteria 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 CcBlockcriteriaQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockcriteriaQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlockcriteria($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlockcriteria', 'CcBlockcriteriaQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CcBlock $ccBlock Object to remove from the list of results
|
||||
*
|
||||
* @return CcBlockQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($ccBlock = null)
|
||||
{
|
||||
if ($ccBlock) {
|
||||
$this->addUsingAlias(CcBlockPeer::ID, $ccBlock->getDbId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
} // BaseCcBlockQuery
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,640 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'cc_blockcontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method CcBlockcontentsQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcBlockcontentsQuery orderByDbBlockId($order = Criteria::ASC) Order by the block_id column
|
||||
* @method CcBlockcontentsQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column
|
||||
* @method CcBlockcontentsQuery orderByDbPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method CcBlockcontentsQuery orderByDbCliplength($order = Criteria::ASC) Order by the cliplength column
|
||||
* @method CcBlockcontentsQuery orderByDbCuein($order = Criteria::ASC) Order by the cuein column
|
||||
* @method CcBlockcontentsQuery orderByDbCueout($order = Criteria::ASC) Order by the cueout column
|
||||
* @method CcBlockcontentsQuery orderByDbFadein($order = Criteria::ASC) Order by the fadein column
|
||||
* @method CcBlockcontentsQuery orderByDbFadeout($order = Criteria::ASC) Order by the fadeout column
|
||||
*
|
||||
* @method CcBlockcontentsQuery groupByDbId() Group by the id column
|
||||
* @method CcBlockcontentsQuery groupByDbBlockId() Group by the block_id column
|
||||
* @method CcBlockcontentsQuery groupByDbFileId() Group by the file_id column
|
||||
* @method CcBlockcontentsQuery groupByDbPosition() Group by the position column
|
||||
* @method CcBlockcontentsQuery groupByDbCliplength() Group by the cliplength column
|
||||
* @method CcBlockcontentsQuery groupByDbCuein() Group by the cuein column
|
||||
* @method CcBlockcontentsQuery groupByDbCueout() Group by the cueout column
|
||||
* @method CcBlockcontentsQuery groupByDbFadein() Group by the fadein column
|
||||
* @method CcBlockcontentsQuery groupByDbFadeout() Group by the fadeout column
|
||||
*
|
||||
* @method CcBlockcontentsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcBlockcontentsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcBlockcontentsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcBlockcontentsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
|
||||
* @method CcBlockcontentsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
|
||||
* @method CcBlockcontentsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
|
||||
*
|
||||
* @method CcBlockcontentsQuery leftJoinCcBlock($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcBlockcontentsQuery rightJoinCcBlock($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcBlockcontentsQuery innerJoinCcBlock($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlock relation
|
||||
*
|
||||
* @method CcBlockcontents findOne(PropelPDO $con = null) Return the first CcBlockcontents matching the query
|
||||
* @method CcBlockcontents findOneOrCreate(PropelPDO $con = null) Return the first CcBlockcontents matching the query, or a new CcBlockcontents object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcBlockcontents findOneByDbId(int $id) Return the first CcBlockcontents filtered by the id column
|
||||
* @method CcBlockcontents findOneByDbBlockId(int $block_id) Return the first CcBlockcontents filtered by the block_id column
|
||||
* @method CcBlockcontents findOneByDbFileId(int $file_id) Return the first CcBlockcontents filtered by the file_id column
|
||||
* @method CcBlockcontents findOneByDbPosition(int $position) Return the first CcBlockcontents filtered by the position column
|
||||
* @method CcBlockcontents findOneByDbCliplength(string $cliplength) Return the first CcBlockcontents filtered by the cliplength column
|
||||
* @method CcBlockcontents findOneByDbCuein(string $cuein) Return the first CcBlockcontents filtered by the cuein column
|
||||
* @method CcBlockcontents findOneByDbCueout(string $cueout) Return the first CcBlockcontents filtered by the cueout column
|
||||
* @method CcBlockcontents findOneByDbFadein(string $fadein) Return the first CcBlockcontents filtered by the fadein column
|
||||
* @method CcBlockcontents findOneByDbFadeout(string $fadeout) Return the first CcBlockcontents filtered by the fadeout column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcBlockcontents objects filtered by the id column
|
||||
* @method array findByDbBlockId(int $block_id) Return CcBlockcontents objects filtered by the block_id column
|
||||
* @method array findByDbFileId(int $file_id) Return CcBlockcontents objects filtered by the file_id column
|
||||
* @method array findByDbPosition(int $position) Return CcBlockcontents objects filtered by the position column
|
||||
* @method array findByDbCliplength(string $cliplength) Return CcBlockcontents objects filtered by the cliplength column
|
||||
* @method array findByDbCuein(string $cuein) Return CcBlockcontents objects filtered by the cuein column
|
||||
* @method array findByDbCueout(string $cueout) Return CcBlockcontents objects filtered by the cueout column
|
||||
* @method array findByDbFadein(string $fadein) Return CcBlockcontents objects filtered by the fadein column
|
||||
* @method array findByDbFadeout(string $fadeout) Return CcBlockcontents objects filtered by the fadeout column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcBlockcontentsQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCcBlockcontentsQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'airtime', $modelName = 'CcBlockcontents', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CcBlockcontentsQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CcBlockcontentsQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CcBlockcontentsQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CcBlockcontentsQuery();
|
||||
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 CcBlockcontents|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ((null !== ($obj = CcBlockcontentsPeer::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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* @param int|array $dbId The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbId($dbId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbId) && null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::ID, $dbId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the block_id column
|
||||
*
|
||||
* @param int|array $dbBlockId 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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbBlockId($dbBlockId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbBlockId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbBlockId['min'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbBlockId['max'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $dbBlockId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the file_id column
|
||||
*
|
||||
* @param int|array $dbFileId 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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbFileId($dbFileId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbFileId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbFileId['min'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbFileId['max'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $dbFileId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
* @param int|array $dbPosition 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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbPosition($dbPosition = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbPosition)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbPosition['min'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbPosition['max'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::POSITION, $dbPosition, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the cliplength column
|
||||
*
|
||||
* @param string $dbCliplength 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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCliplength($dbCliplength = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbCliplength)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbCliplength)) {
|
||||
$dbCliplength = str_replace('*', '%', $dbCliplength);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::CLIPLENGTH, $dbCliplength, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the cuein column
|
||||
*
|
||||
* @param string $dbCuein The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCuein($dbCuein = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbCuein)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbCuein)) {
|
||||
$dbCuein = str_replace('*', '%', $dbCuein);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::CUEIN, $dbCuein, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the cueout column
|
||||
*
|
||||
* @param string $dbCueout The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCueout($dbCueout = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbCueout)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbCueout)) {
|
||||
$dbCueout = str_replace('*', '%', $dbCueout);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::CUEOUT, $dbCueout, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the fadein column
|
||||
*
|
||||
* @param string|array $dbFadein 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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbFadein($dbFadein = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbFadein)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbFadein['min'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::FADEIN, $dbFadein['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbFadein['max'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::FADEIN, $dbFadein['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::FADEIN, $dbFadein, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the fadeout column
|
||||
*
|
||||
* @param string|array $dbFadeout 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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbFadeout($dbFadeout = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbFadeout)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbFadeout['min'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::FADEOUT, $dbFadeout['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbFadeout['max'])) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::FADEOUT, $dbFadeout['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcontentsPeer::FADEOUT, $dbFadeout, $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 CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcFiles($ccFiles, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $ccFiles->getDbId(), $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 CcBlockcontentsQuery 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 CcBlock object
|
||||
*
|
||||
* @param CcBlock $ccBlock the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcBlock($ccBlock, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlock relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlock');
|
||||
|
||||
// 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, 'CcBlock');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CcBlockcontents $ccBlockcontents Object to remove from the list of results
|
||||
*
|
||||
* @return CcBlockcontentsQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($ccBlockcontents = null)
|
||||
{
|
||||
if ($ccBlockcontents) {
|
||||
$this->addUsingAlias(CcBlockcontentsPeer::ID, $ccBlockcontents->getDbId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to execute before every DELETE statement
|
||||
*
|
||||
* @param PropelPDO $con The connection object used by the query
|
||||
*/
|
||||
protected function basePreDelete(PropelPDO $con)
|
||||
{
|
||||
// aggregate_column_relation behavior
|
||||
$this->findRelatedCcBlocks($con);
|
||||
|
||||
return $this->preDelete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to execute after every DELETE statement
|
||||
*
|
||||
* @param int $affectedRows the number of deleted rows
|
||||
* @param PropelPDO $con The connection object used by the query
|
||||
*/
|
||||
protected function basePostDelete($affectedRows, PropelPDO $con)
|
||||
{
|
||||
// aggregate_column_relation behavior
|
||||
$this->updateRelatedCcBlocks($con);
|
||||
|
||||
return $this->postDelete($affectedRows, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to execute before every UPDATE statement
|
||||
*
|
||||
* @param array $values The associatiove array of columns and values for the update
|
||||
* @param PropelPDO $con The connection object used by the query
|
||||
* @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), ortherwise it is a series of save() calls on all the found objects
|
||||
*/
|
||||
protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false)
|
||||
{
|
||||
// aggregate_column_relation behavior
|
||||
$this->findRelatedCcBlocks($con);
|
||||
|
||||
return $this->preUpdate($values, $con, $forceIndividualSaves);
|
||||
}
|
||||
|
||||
/**
|
||||
* Code to execute after every UPDATE statement
|
||||
*
|
||||
* @param int $affectedRows the number of udated rows
|
||||
* @param PropelPDO $con The connection object used by the query
|
||||
*/
|
||||
protected function basePostUpdate($affectedRows, PropelPDO $con)
|
||||
{
|
||||
// aggregate_column_relation behavior
|
||||
$this->updateRelatedCcBlocks($con);
|
||||
|
||||
return $this->postUpdate($affectedRows, $con);
|
||||
}
|
||||
|
||||
// aggregate_column_relation behavior
|
||||
|
||||
/**
|
||||
* Finds the related CcBlock objects and keep them for later
|
||||
*
|
||||
* @param PropelPDO $con A connection object
|
||||
*/
|
||||
protected function findRelatedCcBlocks($con)
|
||||
{
|
||||
$criteria = clone $this;
|
||||
if ($this->useAliasInSQL) {
|
||||
$alias = $this->getModelAlias();
|
||||
$criteria->removeAlias($alias);
|
||||
} else {
|
||||
$alias = '';
|
||||
}
|
||||
$this->ccBlocks = CcBlockQuery::create()
|
||||
->joinCcBlockcontents($alias)
|
||||
->mergeWith($criteria)
|
||||
->find($con);
|
||||
}
|
||||
|
||||
protected function updateRelatedCcBlocks($con)
|
||||
{
|
||||
foreach ($this->ccBlocks as $ccBlock) {
|
||||
$ccBlock->updateDbLength($con);
|
||||
}
|
||||
$this->ccBlocks = array();
|
||||
}
|
||||
|
||||
} // BaseCcBlockcontentsQuery
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,993 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base static class for performing query and update operations on the 'cc_blockcriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcBlockcriteriaPeer {
|
||||
|
||||
/** the default database name for this class */
|
||||
const DATABASE_NAME = 'airtime';
|
||||
|
||||
/** the table name for this class */
|
||||
const TABLE_NAME = 'cc_blockcriteria';
|
||||
|
||||
/** the related Propel class for this table */
|
||||
const OM_CLASS = 'CcBlockcriteria';
|
||||
|
||||
/** A class that can be returned by this peer. */
|
||||
const CLASS_DEFAULT = 'airtime.CcBlockcriteria';
|
||||
|
||||
/** the related TableMap class for this table */
|
||||
const TM_CLASS = 'CcBlockcriteriaTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/** the column name for the ID field */
|
||||
const ID = 'cc_blockcriteria.ID';
|
||||
|
||||
/** the column name for the CRITERIA field */
|
||||
const CRITERIA = 'cc_blockcriteria.CRITERIA';
|
||||
|
||||
/** the column name for the MODIFIER field */
|
||||
const MODIFIER = 'cc_blockcriteria.MODIFIER';
|
||||
|
||||
/** the column name for the VALUE field */
|
||||
const VALUE = 'cc_blockcriteria.VALUE';
|
||||
|
||||
/** the column name for the EXTRA field */
|
||||
const EXTRA = 'cc_blockcriteria.EXTRA';
|
||||
|
||||
/** the column name for the BLOCK_ID field */
|
||||
const BLOCK_ID = 'cc_blockcriteria.BLOCK_ID';
|
||||
|
||||
/**
|
||||
* An identiy map to hold any loaded instances of CcBlockcriteria objects.
|
||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||
* queries.
|
||||
* @var array CcBlockcriteria[]
|
||||
*/
|
||||
public static $instances = array();
|
||||
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbCriteria', 'DbModifier', 'DbValue', 'DbExtra', 'DbBlockId', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbCriteria', 'dbModifier', 'dbValue', 'dbExtra', 'dbBlockId', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::CRITERIA, self::MODIFIER, self::VALUE, self::EXTRA, self::BLOCK_ID, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'CRITERIA', 'MODIFIER', 'VALUE', 'EXTRA', 'BLOCK_ID', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'criteria', 'modifier', 'value', 'extra', 'block_id', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbCriteria' => 1, 'DbModifier' => 2, 'DbValue' => 3, 'DbExtra' => 4, 'DbBlockId' => 5, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbCriteria' => 1, 'dbModifier' => 2, 'dbValue' => 3, 'dbExtra' => 4, 'dbBlockId' => 5, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::CRITERIA => 1, self::MODIFIER => 2, self::VALUE => 3, self::EXTRA => 4, self::BLOCK_ID => 5, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'CRITERIA' => 1, 'MODIFIER' => 2, 'VALUE' => 3, 'EXTRA' => 4, 'BLOCK_ID' => 5, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'criteria' => 1, 'modifier' => 2, 'value' => 3, 'extra' => 4, 'block_id' => 5, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* 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. CcBlockcriteriaPeer::COLUMN_NAME).
|
||||
* @return string
|
||||
*/
|
||||
public static function alias($alias, $column)
|
||||
{
|
||||
return str_replace(CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::ID);
|
||||
$criteria->addSelectColumn(CcBlockcriteriaPeer::CRITERIA);
|
||||
$criteria->addSelectColumn(CcBlockcriteriaPeer::MODIFIER);
|
||||
$criteria->addSelectColumn(CcBlockcriteriaPeer::VALUE);
|
||||
$criteria->addSelectColumn(CcBlockcriteriaPeer::EXTRA);
|
||||
$criteria->addSelectColumn(CcBlockcriteriaPeer::BLOCK_ID);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.CRITERIA');
|
||||
$criteria->addSelectColumn($alias . '.MODIFIER');
|
||||
$criteria->addSelectColumn($alias . '.VALUE');
|
||||
$criteria->addSelectColumn($alias . '.EXTRA');
|
||||
$criteria->addSelectColumn($alias . '.BLOCK_ID');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(CcBlockcriteriaPeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::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 CcBlockcriteria
|
||||
* @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 = CcBlockcriteriaPeer::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 CcBlockcriteriaPeer::populateObjects(CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
$criteria = clone $criteria;
|
||||
CcBlockcriteriaPeer::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 CcBlockcriteria $value A CcBlockcriteria object.
|
||||
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
|
||||
*/
|
||||
public static function addInstanceToPool(CcBlockcriteria $obj, $key = null)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled()) {
|
||||
if ($key === null) {
|
||||
$key = (string) $obj->getDbId();
|
||||
} // if key === null
|
||||
self::$instances[$key] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from the instance pool.
|
||||
*
|
||||
* Propel keeps cached copies of objects in an instance pool when they are retrieved
|
||||
* from the database. In some cases -- especially when you override doDelete
|
||||
* methods in your stub classes -- you may need to explicitly remove objects
|
||||
* from the cache in order to prevent returning objects that no longer exist.
|
||||
*
|
||||
* @param mixed $value A CcBlockcriteria object or a primary key value.
|
||||
*/
|
||||
public static function removeInstanceFromPool($value)
|
||||
{
|
||||
if (Propel::isInstancePoolingEnabled() && $value !== null) {
|
||||
if (is_object($value) && $value instanceof CcBlockcriteria) {
|
||||
$key = (string) $value->getDbId();
|
||||
} elseif (is_scalar($value)) {
|
||||
// assume we've been passed a primary key
|
||||
$key = (string) $value;
|
||||
} else {
|
||||
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcBlockcriteria 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 CcBlockcriteria 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_blockcriteria
|
||||
* 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 = CcBlockcriteriaPeer::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key = CcBlockcriteriaPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj = CcBlockcriteriaPeer::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;
|
||||
CcBlockcriteriaPeer::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 (CcBlockcriteria object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $startcol = 0)
|
||||
{
|
||||
$key = CcBlockcriteriaPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||
if (null !== ($obj = CcBlockcriteriaPeer::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 + CcBlockcriteriaPeer::NUM_COLUMNS;
|
||||
} else {
|
||||
$cls = CcBlockcriteriaPeer::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $startcol);
|
||||
CcBlockcriteriaPeer::addInstanceToPool($obj, $key);
|
||||
}
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinCcBlock(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(CcBlockcriteriaPeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcBlockcriteriaPeer::BLOCK_ID, CcBlockPeer::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 CcBlockcriteria objects pre-filled with their CcBlock 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 CcBlockcriteria objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinCcBlock(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);
|
||||
}
|
||||
|
||||
CcBlockcriteriaPeer::addSelectColumns($criteria);
|
||||
$startcol = (CcBlockcriteriaPeer::NUM_COLUMNS - CcBlockcriteriaPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
CcBlockPeer::addSelectColumns($criteria);
|
||||
|
||||
$criteria->addJoin(CcBlockcriteriaPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key1 = CcBlockcriteriaPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj1 = CcBlockcriteriaPeer::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 = CcBlockcriteriaPeer::getOMClass(false);
|
||||
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($row);
|
||||
CcBlockcriteriaPeer::addInstanceToPool($obj1, $key1);
|
||||
} // if $obj1 already loaded
|
||||
|
||||
$key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcBlockPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcBlockPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol);
|
||||
CcBlockPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if obj2 already loaded
|
||||
|
||||
// Add the $obj1 (CcBlockcriteria) to $obj2 (CcBlock)
|
||||
$obj2->addCcBlockcriteria($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(CcBlockcriteriaPeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcBlockcriteriaPeer::BLOCK_ID, CcBlockPeer::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 CcBlockcriteria 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 CcBlockcriteria 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);
|
||||
}
|
||||
|
||||
CcBlockcriteriaPeer::addSelectColumns($criteria);
|
||||
$startcol2 = (CcBlockcriteriaPeer::NUM_COLUMNS - CcBlockcriteriaPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcBlockPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcBlockcriteriaPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key1 = CcBlockcriteriaPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj1 = CcBlockcriteriaPeer::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 = CcBlockcriteriaPeer::getOMClass(false);
|
||||
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($row);
|
||||
CcBlockcriteriaPeer::addInstanceToPool($obj1, $key1);
|
||||
} // if obj1 already loaded
|
||||
|
||||
// Add objects for joined CcBlock rows
|
||||
|
||||
$key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol2);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcBlockPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcBlockPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol2);
|
||||
CcBlockPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if obj2 loaded
|
||||
|
||||
// Add the $obj1 (CcBlockcriteria) to the collection in $obj2 (CcBlock)
|
||||
$obj2->addCcBlockcriteria($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(BaseCcBlockcriteriaPeer::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(BaseCcBlockcriteriaPeer::TABLE_NAME))
|
||||
{
|
||||
$dbMap->addTableObject(new CcBlockcriteriaTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ? CcBlockcriteriaPeer::CLASS_DEFAULT : CcBlockcriteriaPeer::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform an INSERT on the database, given a CcBlockcriteria or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or CcBlockcriteria 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(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // build Criteria from CcBlockcriteria object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(CcBlockcriteriaPeer::ID) && $criteria->keyContainsValue(CcBlockcriteriaPeer::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcBlockcriteriaPeer::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 CcBlockcriteria or Criteria object.
|
||||
*
|
||||
* @param mixed $values Criteria or CcBlockcriteria 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(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
|
||||
}
|
||||
|
||||
$selectCriteria = new Criteria(self::DATABASE_NAME);
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
$criteria = clone $values; // rename for clarity
|
||||
|
||||
$comparison = $criteria->getComparison(CcBlockcriteriaPeer::ID);
|
||||
$value = $criteria->remove(CcBlockcriteriaPeer::ID);
|
||||
if ($value) {
|
||||
$selectCriteria->add(CcBlockcriteriaPeer::ID, $value, $comparison);
|
||||
} else {
|
||||
$selectCriteria->setPrimaryTableName(CcBlockcriteriaPeer::TABLE_NAME);
|
||||
}
|
||||
|
||||
} else { // $values is CcBlockcriteria 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_blockcriteria 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(CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::TABLE_NAME, $con, CcBlockcriteriaPeer::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).
|
||||
CcBlockcriteriaPeer::clearInstancePool();
|
||||
CcBlockcriteriaPeer::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method perform a DELETE on the database, given a CcBlockcriteria or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or CcBlockcriteria 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(CcBlockcriteriaPeer::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.
|
||||
CcBlockcriteriaPeer::clearInstancePool();
|
||||
// rename for clarity
|
||||
$criteria = clone $values;
|
||||
} elseif ($values instanceof CcBlockcriteria) { // it's a model object
|
||||
// invalidate the cache for this single object
|
||||
CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::ID, (array) $values, Criteria::IN);
|
||||
// invalidate the cache for this object(s)
|
||||
foreach ((array) $values as $singleval) {
|
||||
CcBlockcriteriaPeer::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);
|
||||
CcBlockcriteriaPeer::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all modified columns of given CcBlockcriteria 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 CcBlockcriteria $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(CcBlockcriteria $obj, $cols = null)
|
||||
{
|
||||
$columns = array();
|
||||
|
||||
if ($cols) {
|
||||
$dbMap = Propel::getDatabaseMap(CcBlockcriteriaPeer::DATABASE_NAME);
|
||||
$tableMap = $dbMap->getTable(CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::DATABASE_NAME, CcBlockcriteriaPeer::TABLE_NAME, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param int $pk the primary key.
|
||||
* @param PropelPDO $con the connection to use
|
||||
* @return CcBlockcriteria
|
||||
*/
|
||||
public static function retrieveByPK($pk, PropelPDO $con = null)
|
||||
{
|
||||
|
||||
if (null !== ($obj = CcBlockcriteriaPeer::getInstanceFromPool((string) $pk))) {
|
||||
return $obj;
|
||||
}
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(CcBlockcriteriaPeer::DATABASE_NAME);
|
||||
$criteria->add(CcBlockcriteriaPeer::ID, $pk);
|
||||
|
||||
$v = CcBlockcriteriaPeer::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(CcBlockcriteriaPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria(CcBlockcriteriaPeer::DATABASE_NAME);
|
||||
$criteria->add(CcBlockcriteriaPeer::ID, $pks, Criteria::IN);
|
||||
$objs = CcBlockcriteriaPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
}
|
||||
|
||||
} // BaseCcBlockcriteriaPeer
|
||||
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
BaseCcBlockcriteriaPeer::buildTableMap();
|
||||
|
|
@ -0,0 +1,372 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'cc_blockcriteria' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method CcBlockcriteriaQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcBlockcriteriaQuery orderByDbCriteria($order = Criteria::ASC) Order by the criteria column
|
||||
* @method CcBlockcriteriaQuery orderByDbModifier($order = Criteria::ASC) Order by the modifier column
|
||||
* @method CcBlockcriteriaQuery orderByDbValue($order = Criteria::ASC) Order by the value column
|
||||
* @method CcBlockcriteriaQuery orderByDbExtra($order = Criteria::ASC) Order by the extra column
|
||||
* @method CcBlockcriteriaQuery orderByDbBlockId($order = Criteria::ASC) Order by the block_id column
|
||||
*
|
||||
* @method CcBlockcriteriaQuery groupByDbId() Group by the id column
|
||||
* @method CcBlockcriteriaQuery groupByDbCriteria() Group by the criteria column
|
||||
* @method CcBlockcriteriaQuery groupByDbModifier() Group by the modifier column
|
||||
* @method CcBlockcriteriaQuery groupByDbValue() Group by the value column
|
||||
* @method CcBlockcriteriaQuery groupByDbExtra() Group by the extra column
|
||||
* @method CcBlockcriteriaQuery groupByDbBlockId() Group by the block_id column
|
||||
*
|
||||
* @method CcBlockcriteriaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcBlockcriteriaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method CcBlockcriteriaQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method CcBlockcriteriaQuery leftJoinCcBlock($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcBlockcriteriaQuery rightJoinCcBlock($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcBlockcriteriaQuery innerJoinCcBlock($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlock relation
|
||||
*
|
||||
* @method CcBlockcriteria findOne(PropelPDO $con = null) Return the first CcBlockcriteria matching the query
|
||||
* @method CcBlockcriteria findOneOrCreate(PropelPDO $con = null) Return the first CcBlockcriteria matching the query, or a new CcBlockcriteria object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method CcBlockcriteria findOneByDbId(int $id) Return the first CcBlockcriteria filtered by the id column
|
||||
* @method CcBlockcriteria findOneByDbCriteria(string $criteria) Return the first CcBlockcriteria filtered by the criteria column
|
||||
* @method CcBlockcriteria findOneByDbModifier(string $modifier) Return the first CcBlockcriteria filtered by the modifier column
|
||||
* @method CcBlockcriteria findOneByDbValue(string $value) Return the first CcBlockcriteria filtered by the value column
|
||||
* @method CcBlockcriteria findOneByDbExtra(string $extra) Return the first CcBlockcriteria filtered by the extra column
|
||||
* @method CcBlockcriteria findOneByDbBlockId(int $block_id) Return the first CcBlockcriteria filtered by the block_id column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcBlockcriteria objects filtered by the id column
|
||||
* @method array findByDbCriteria(string $criteria) Return CcBlockcriteria objects filtered by the criteria column
|
||||
* @method array findByDbModifier(string $modifier) Return CcBlockcriteria objects filtered by the modifier column
|
||||
* @method array findByDbValue(string $value) Return CcBlockcriteria objects filtered by the value column
|
||||
* @method array findByDbExtra(string $extra) Return CcBlockcriteria objects filtered by the extra column
|
||||
* @method array findByDbBlockId(int $block_id) Return CcBlockcriteria objects filtered by the block_id column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
abstract class BaseCcBlockcriteriaQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of BaseCcBlockcriteriaQuery object.
|
||||
*
|
||||
* @param string $dbName The dabase name
|
||||
* @param string $modelName The phpName of a model, e.g. 'Book'
|
||||
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
|
||||
*/
|
||||
public function __construct($dbName = 'airtime', $modelName = 'CcBlockcriteria', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new CcBlockcriteriaQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return CcBlockcriteriaQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof CcBlockcriteriaQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new CcBlockcriteriaQuery();
|
||||
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 CcBlockcriteria|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ((null !== ($obj = CcBlockcriteriaPeer::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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::ID, $keys, Criteria::IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the id column
|
||||
*
|
||||
* @param int|array $dbId The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbId($dbId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbId) && null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::ID, $dbId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the criteria column
|
||||
*
|
||||
* @param string $dbCriteria 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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbCriteria($dbCriteria = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbCriteria)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbCriteria)) {
|
||||
$dbCriteria = str_replace('*', '%', $dbCriteria);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::CRITERIA, $dbCriteria, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the modifier column
|
||||
*
|
||||
* @param string $dbModifier 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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbModifier($dbModifier = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbModifier)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbModifier)) {
|
||||
$dbModifier = str_replace('*', '%', $dbModifier);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::MODIFIER, $dbModifier, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the value column
|
||||
*
|
||||
* @param string $dbValue 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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbValue($dbValue = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbValue)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbValue)) {
|
||||
$dbValue = str_replace('*', '%', $dbValue);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::VALUE, $dbValue, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the extra column
|
||||
*
|
||||
* @param string $dbExtra 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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbExtra($dbExtra = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($dbExtra)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $dbExtra)) {
|
||||
$dbExtra = str_replace('*', '%', $dbExtra);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::EXTRA, $dbExtra, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the block_id column
|
||||
*
|
||||
* @param int|array $dbBlockId 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 CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbBlockId($dbBlockId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbBlockId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbBlockId['min'])) {
|
||||
$this->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbBlockId['max'])) {
|
||||
$this->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $dbBlockId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcBlock object
|
||||
*
|
||||
* @param CcBlock $ccBlock the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcBlock($ccBlock, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlock relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcBlock($relationAlias = '', $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlock');
|
||||
|
||||
// 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, 'CcBlock');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param CcBlockcriteria $ccBlockcriteria Object to remove from the list of results
|
||||
*
|
||||
* @return CcBlockcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($ccBlockcriteria = null)
|
||||
{
|
||||
if ($ccBlockcriteria) {
|
||||
$this->addUsingAlias(CcBlockcriteriaPeer::ID, $ccBlockcriteria->getDbId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
} // BaseCcBlockcriteriaQuery
|
|
@ -436,6 +436,11 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $collCcPlaylistcontentss;
|
||||
|
||||
/**
|
||||
* @var array CcBlockcontents[] Collection to store aggregation of CcBlockcontents objects.
|
||||
*/
|
||||
protected $collCcBlockcontentss;
|
||||
|
||||
/**
|
||||
* @var array CcSchedule[] Collection to store aggregation of CcSchedule objects.
|
||||
*/
|
||||
|
@ -2829,6 +2834,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
|
||||
$this->collCcPlaylistcontentss = null;
|
||||
|
||||
$this->collCcBlockcontentss = null;
|
||||
|
||||
$this->collCcSchedules = null;
|
||||
|
||||
} // if (deep)
|
||||
|
@ -2999,6 +3006,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcBlockcontentss !== null) {
|
||||
foreach ($this->collCcBlockcontentss as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcSchedules !== null) {
|
||||
foreach ($this->collCcSchedules as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
|
@ -3112,6 +3127,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcBlockcontentss !== null) {
|
||||
foreach ($this->collCcBlockcontentss as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcSchedules !== null) {
|
||||
foreach ($this->collCcSchedules as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
|
@ -3969,6 +3992,12 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcBlockcontentss() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcBlockcontents($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcSchedules() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcSchedule($relObj->copy($deepCopy));
|
||||
|
@ -4387,6 +4416,31 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this CcFiles is new, it will return
|
||||
* an empty collection; or if this CcFiles has previously
|
||||
* been saved, it will retrieve related CcPlaylistcontentss from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in CcFiles.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects
|
||||
*/
|
||||
public function getCcPlaylistcontentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = CcPlaylistcontentsQuery::create(null, $criteria);
|
||||
$query->joinWith('CcBlock', $join_behavior);
|
||||
|
||||
return $this->getCcPlaylistcontentss($query, $con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
|
@ -4411,6 +4465,140 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
return $this->getCcPlaylistcontentss($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcBlockcontentss collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addCcBlockcontentss()
|
||||
*/
|
||||
public function clearCcBlockcontentss()
|
||||
{
|
||||
$this->collCcBlockcontentss = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCcBlockcontentss collection.
|
||||
*
|
||||
* By default this just sets the collCcBlockcontentss collection to an empty array (like clearcollCcBlockcontentss());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCcBlockcontentss()
|
||||
{
|
||||
$this->collCcBlockcontentss = new PropelObjectCollection();
|
||||
$this->collCcBlockcontentss->setModel('CcBlockcontents');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcBlockcontents objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcFiles is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcBlockcontents[] List of CcBlockcontents objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCcBlockcontentss($criteria = null, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcBlockcontentss || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcBlockcontentss) {
|
||||
// return empty collection
|
||||
$this->initCcBlockcontentss();
|
||||
} else {
|
||||
$collCcBlockcontentss = CcBlockcontentsQuery::create(null, $criteria)
|
||||
->filterByCcFiles($this)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcBlockcontentss;
|
||||
}
|
||||
$this->collCcBlockcontentss = $collCcBlockcontentss;
|
||||
}
|
||||
}
|
||||
return $this->collCcBlockcontentss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related CcBlockcontents objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param PropelPDO $con
|
||||
* @return int Count of related CcBlockcontents objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCcBlockcontentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcBlockcontentss || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcBlockcontentss) {
|
||||
return 0;
|
||||
} else {
|
||||
$query = CcBlockcontentsQuery::create(null, $criteria);
|
||||
if($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
return $query
|
||||
->filterByCcFiles($this)
|
||||
->count($con);
|
||||
}
|
||||
} else {
|
||||
return count($this->collCcBlockcontentss);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a CcBlockcontents object to this object
|
||||
* through the CcBlockcontents foreign key attribute.
|
||||
*
|
||||
* @param CcBlockcontents $l CcBlockcontents
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function addCcBlockcontents(CcBlockcontents $l)
|
||||
{
|
||||
if ($this->collCcBlockcontentss === null) {
|
||||
$this->initCcBlockcontentss();
|
||||
}
|
||||
if (!$this->collCcBlockcontentss->contains($l)) { // only add it if the **same** object is not already associated
|
||||
$this->collCcBlockcontentss[]= $l;
|
||||
$l->setCcFiles($this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this CcFiles is new, it will return
|
||||
* an empty collection; or if this CcFiles has previously
|
||||
* been saved, it will retrieve related CcBlockcontentss from storage.
|
||||
*
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in CcFiles.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return PropelCollection|array CcBlockcontents[] List of CcBlockcontents objects
|
||||
*/
|
||||
public function getCcBlockcontentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$query = CcBlockcontentsQuery::create(null, $criteria);
|
||||
$query->joinWith('CcBlock', $join_behavior);
|
||||
|
||||
return $this->getCcBlockcontentss($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcSchedules collection
|
||||
*
|
||||
|
@ -4645,6 +4833,11 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcBlockcontentss) {
|
||||
foreach ((array) $this->collCcBlockcontentss as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcSchedules) {
|
||||
foreach ((array) $this->collCcSchedules as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
|
@ -4654,6 +4847,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent
|
|||
|
||||
$this->collCcShowInstancess = null;
|
||||
$this->collCcPlaylistcontentss = null;
|
||||
$this->collCcBlockcontentss = null;
|
||||
$this->collCcSchedules = null;
|
||||
$this->aCcSubjs = null;
|
||||
$this->aCcMusicDirs = null;
|
||||
|
|
|
@ -659,6 +659,9 @@ abstract class BaseCcFilesPeer {
|
|||
// Invalidate objects in CcPlaylistcontentsPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcPlaylistcontentsPeer::clearInstancePool();
|
||||
// Invalidate objects in CcBlockcontentsPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcBlockcontentsPeer::clearInstancePool();
|
||||
// Invalidate objects in CcSchedulePeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcSchedulePeer::clearInstancePool();
|
||||
|
|
|
@ -156,6 +156,10 @@
|
|||
* @method CcFilesQuery rightJoinCcPlaylistcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylistcontents relation
|
||||
* @method CcFilesQuery innerJoinCcPlaylistcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylistcontents relation
|
||||
*
|
||||
* @method CcFilesQuery leftJoinCcBlockcontents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlockcontents relation
|
||||
* @method CcFilesQuery rightJoinCcBlockcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlockcontents relation
|
||||
* @method CcFilesQuery innerJoinCcBlockcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlockcontents relation
|
||||
*
|
||||
* @method CcFilesQuery leftJoinCcSchedule($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSchedule relation
|
||||
* @method CcFilesQuery rightJoinCcSchedule($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSchedule relation
|
||||
* @method CcFilesQuery innerJoinCcSchedule($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSchedule relation
|
||||
|
@ -2172,6 +2176,70 @@ abstract class BaseCcFilesQuery extends ModelCriteria
|
|||
->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcBlockcontents object
|
||||
*
|
||||
* @param CcBlockcontents $ccBlockcontents the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByCcBlockcontents($ccBlockcontents, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcFilesPeer::ID, $ccBlockcontents->getDbFileId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlockcontents relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return CcFilesQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinCcBlockcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlockcontents');
|
||||
|
||||
// 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, 'CcBlockcontents');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlockcontents relation CcBlockcontents 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 CcBlockcontentsQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlockcontents($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlockcontents', 'CcBlockcontentsQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcSchedule object
|
||||
*
|
||||
|
|
|
@ -85,11 +85,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $collCcPlaylistcontentss;
|
||||
|
||||
/**
|
||||
* @var array CcPlaylistcriteria[] Collection to store aggregation of CcPlaylistcriteria objects.
|
||||
*/
|
||||
protected $collCcPlaylistcriterias;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
|
@ -603,8 +598,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$this->aCcSubjs = null;
|
||||
$this->collCcPlaylistcontentss = null;
|
||||
|
||||
$this->collCcPlaylistcriterias = null;
|
||||
|
||||
} // if (deep)
|
||||
}
|
||||
|
||||
|
@ -758,14 +751,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcPlaylistcriterias !== null) {
|
||||
foreach ($this->collCcPlaylistcriterias as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->alreadyInSave = false;
|
||||
|
||||
}
|
||||
|
@ -857,14 +842,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcPlaylistcriterias !== null) {
|
||||
foreach ($this->collCcPlaylistcriterias as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->alreadyInValidation = false;
|
||||
}
|
||||
|
@ -1145,12 +1122,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcPlaylistcriterias() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcPlaylistcriteria($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
} // if ($deepCopy)
|
||||
|
||||
|
||||
|
@ -1379,113 +1350,29 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
return $this->getCcPlaylistcontentss($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcPlaylistcriterias collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addCcPlaylistcriterias()
|
||||
*/
|
||||
public function clearCcPlaylistcriterias()
|
||||
{
|
||||
$this->collCcPlaylistcriterias = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCcPlaylistcriterias collection.
|
||||
* If this collection has already been initialized with
|
||||
* an identical criteria, it returns the collection.
|
||||
* Otherwise if this CcPlaylist is new, it will return
|
||||
* an empty collection; or if this CcPlaylist has previously
|
||||
* been saved, it will retrieve related CcPlaylistcontentss from storage.
|
||||
*
|
||||
* By default this just sets the collCcPlaylistcriterias collection to an empty array (like clearcollCcPlaylistcriterias());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCcPlaylistcriterias()
|
||||
{
|
||||
$this->collCcPlaylistcriterias = new PropelObjectCollection();
|
||||
$this->collCcPlaylistcriterias->setModel('CcPlaylistcriteria');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcPlaylistcriteria objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcPlaylist is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
* This method is protected by default in order to keep the public
|
||||
* api reasonable. You can provide public methods for those you
|
||||
* actually need in CcPlaylist.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcPlaylistcriteria[] List of CcPlaylistcriteria objects
|
||||
* @throws PropelException
|
||||
* @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
|
||||
* @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects
|
||||
*/
|
||||
public function getCcPlaylistcriterias($criteria = null, PropelPDO $con = null)
|
||||
public function getCcPlaylistcontentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
if(null === $this->collCcPlaylistcriterias || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcPlaylistcriterias) {
|
||||
// return empty collection
|
||||
$this->initCcPlaylistcriterias();
|
||||
} else {
|
||||
$collCcPlaylistcriterias = CcPlaylistcriteriaQuery::create(null, $criteria)
|
||||
->filterByCcPlaylist($this)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcPlaylistcriterias;
|
||||
}
|
||||
$this->collCcPlaylistcriterias = $collCcPlaylistcriterias;
|
||||
}
|
||||
}
|
||||
return $this->collCcPlaylistcriterias;
|
||||
}
|
||||
$query = CcPlaylistcontentsQuery::create(null, $criteria);
|
||||
$query->joinWith('CcBlock', $join_behavior);
|
||||
|
||||
/**
|
||||
* Returns the number of related CcPlaylistcriteria objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param PropelPDO $con
|
||||
* @return int Count of related CcPlaylistcriteria objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCcPlaylistcriterias(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcPlaylistcriterias || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcPlaylistcriterias) {
|
||||
return 0;
|
||||
} else {
|
||||
$query = CcPlaylistcriteriaQuery::create(null, $criteria);
|
||||
if($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
return $query
|
||||
->filterByCcPlaylist($this)
|
||||
->count($con);
|
||||
}
|
||||
} else {
|
||||
return count($this->collCcPlaylistcriterias);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a CcPlaylistcriteria object to this object
|
||||
* through the CcPlaylistcriteria foreign key attribute.
|
||||
*
|
||||
* @param CcPlaylistcriteria $l CcPlaylistcriteria
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function addCcPlaylistcriteria(CcPlaylistcriteria $l)
|
||||
{
|
||||
if ($this->collCcPlaylistcriterias === null) {
|
||||
$this->initCcPlaylistcriterias();
|
||||
}
|
||||
if (!$this->collCcPlaylistcriterias->contains($l)) { // only add it if the **same** object is not already associated
|
||||
$this->collCcPlaylistcriterias[]= $l;
|
||||
$l->setCcPlaylist($this);
|
||||
}
|
||||
return $this->getCcPlaylistcontentss($query, $con);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1527,15 +1414,9 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
|
|||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcPlaylistcriterias) {
|
||||
foreach ((array) $this->collCcPlaylistcriterias as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
} // if ($deep)
|
||||
|
||||
$this->collCcPlaylistcontentss = null;
|
||||
$this->collCcPlaylistcriterias = null;
|
||||
$this->aCcSubjs = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -376,9 +376,6 @@ abstract class BaseCcPlaylistPeer {
|
|||
// Invalidate objects in CcPlaylistcontentsPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcPlaylistcontentsPeer::clearInstancePool();
|
||||
// Invalidate objects in CcPlaylistcriteriaPeer instance pool,
|
||||
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
|
||||
CcPlaylistcriteriaPeer::clearInstancePool();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,10 +36,6 @@
|
|||
* @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 CcPlaylistQuery leftJoinCcPlaylistcriteria($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlaylistcriteria relation
|
||||
* @method CcPlaylistQuery rightJoinCcPlaylistcriteria($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylistcriteria relation
|
||||
* @method CcPlaylistQuery innerJoinCcPlaylistcriteria($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylistcriteria 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
|
||||
*
|
||||
|
@ -495,70 +491,6 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
|
|||
->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcPlaylistcriteria object
|
||||
*
|
||||
* @param CcPlaylistcriteria $ccPlaylistcriteria 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 filterByCcPlaylistcriteria($ccPlaylistcriteria, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylistcriteria->getDbPlaylistId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcPlaylistcriteria 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 joinCcPlaylistcriteria($relationAlias = '', $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcPlaylistcriteria');
|
||||
|
||||
// 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, 'CcPlaylistcriteria');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcPlaylistcriteria relation CcPlaylistcriteria 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 CcPlaylistcriteriaQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcPlaylistcriteriaQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcPlaylistcriteria($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcriteria', 'CcPlaylistcriteriaQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
|
|
|
@ -42,6 +42,12 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $file_id;
|
||||
|
||||
/**
|
||||
* The value for the block_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $block_id;
|
||||
|
||||
/**
|
||||
* The value for the position field.
|
||||
* @var int
|
||||
|
@ -88,6 +94,11 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $aCcFiles;
|
||||
|
||||
/**
|
||||
* @var CcBlock
|
||||
*/
|
||||
protected $aCcBlock;
|
||||
|
||||
/**
|
||||
* @var CcPlaylist
|
||||
*/
|
||||
|
@ -165,6 +176,16 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
return $this->file_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [block_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDbBlockId()
|
||||
{
|
||||
return $this->block_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [position] column value.
|
||||
*
|
||||
|
@ -339,6 +360,30 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbFileId()
|
||||
|
||||
/**
|
||||
* Set the value of [block_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return CcPlaylistcontents The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbBlockId($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->block_id !== $v) {
|
||||
$this->block_id = $v;
|
||||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::BLOCK_ID;
|
||||
}
|
||||
|
||||
if ($this->aCcBlock !== null && $this->aCcBlock->getDbId() !== $v) {
|
||||
$this->aCcBlock = null;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbBlockId()
|
||||
|
||||
/**
|
||||
* Set the value of [position] column.
|
||||
*
|
||||
|
@ -574,12 +619,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
|
||||
$this->playlist_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
|
||||
$this->file_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
|
||||
$this->position = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
|
||||
$this->cliplength = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
|
||||
$this->cuein = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
||||
$this->cueout = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||
$this->fadein = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||
$this->fadeout = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
||||
$this->block_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
|
||||
$this->position = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
|
||||
$this->cliplength = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
|
||||
$this->cuein = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
|
||||
$this->cueout = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
|
||||
$this->fadein = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
|
||||
$this->fadeout = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -588,7 +634,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 9; // 9 = CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 10; // 10 = CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcPlaylistcontents object", $e);
|
||||
|
@ -617,6 +663,9 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) {
|
||||
$this->aCcFiles = null;
|
||||
}
|
||||
if ($this->aCcBlock !== null && $this->block_id !== $this->aCcBlock->getDbId()) {
|
||||
$this->aCcBlock = null;
|
||||
}
|
||||
} // ensureConsistency
|
||||
|
||||
/**
|
||||
|
@ -657,6 +706,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
if ($deep) { // also de-associate any related objects?
|
||||
|
||||
$this->aCcFiles = null;
|
||||
$this->aCcBlock = null;
|
||||
$this->aCcPlaylist = null;
|
||||
} // if (deep)
|
||||
}
|
||||
|
@ -782,6 +832,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
$this->setCcFiles($this->aCcFiles);
|
||||
}
|
||||
|
||||
if ($this->aCcBlock !== null) {
|
||||
if ($this->aCcBlock->isModified() || $this->aCcBlock->isNew()) {
|
||||
$affectedRows += $this->aCcBlock->save($con);
|
||||
}
|
||||
$this->setCcBlock($this->aCcBlock);
|
||||
}
|
||||
|
||||
if ($this->aCcPlaylist !== null) {
|
||||
if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) {
|
||||
$affectedRows += $this->aCcPlaylist->save($con);
|
||||
|
@ -889,6 +946,12 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->aCcBlock !== null) {
|
||||
if (!$this->aCcBlock->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $this->aCcBlock->getValidationFailures());
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->aCcPlaylist !== null) {
|
||||
if (!$this->aCcPlaylist->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures());
|
||||
|
@ -944,21 +1007,24 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
return $this->getDbFileId();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getDbPosition();
|
||||
return $this->getDbBlockId();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getDbCliplength();
|
||||
return $this->getDbPosition();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getDbCuein();
|
||||
return $this->getDbCliplength();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getDbCueout();
|
||||
return $this->getDbCuein();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getDbFadein();
|
||||
return $this->getDbCueout();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getDbFadein();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getDbFadeout();
|
||||
break;
|
||||
default:
|
||||
|
@ -988,17 +1054,21 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
$keys[0] => $this->getDbId(),
|
||||
$keys[1] => $this->getDbPlaylistId(),
|
||||
$keys[2] => $this->getDbFileId(),
|
||||
$keys[3] => $this->getDbPosition(),
|
||||
$keys[4] => $this->getDbCliplength(),
|
||||
$keys[5] => $this->getDbCuein(),
|
||||
$keys[6] => $this->getDbCueout(),
|
||||
$keys[7] => $this->getDbFadein(),
|
||||
$keys[8] => $this->getDbFadeout(),
|
||||
$keys[3] => $this->getDbBlockId(),
|
||||
$keys[4] => $this->getDbPosition(),
|
||||
$keys[5] => $this->getDbCliplength(),
|
||||
$keys[6] => $this->getDbCuein(),
|
||||
$keys[7] => $this->getDbCueout(),
|
||||
$keys[8] => $this->getDbFadein(),
|
||||
$keys[9] => $this->getDbFadeout(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aCcFiles) {
|
||||
$result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true);
|
||||
}
|
||||
if (null !== $this->aCcBlock) {
|
||||
$result['CcBlock'] = $this->aCcBlock->toArray($keyType, $includeLazyLoadColumns, true);
|
||||
}
|
||||
if (null !== $this->aCcPlaylist) {
|
||||
$result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, true);
|
||||
}
|
||||
|
@ -1043,21 +1113,24 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
$this->setDbFileId($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setDbPosition($value);
|
||||
$this->setDbBlockId($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setDbCliplength($value);
|
||||
$this->setDbPosition($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setDbCuein($value);
|
||||
$this->setDbCliplength($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setDbCueout($value);
|
||||
$this->setDbCuein($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setDbFadein($value);
|
||||
$this->setDbCueout($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setDbFadein($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setDbFadeout($value);
|
||||
break;
|
||||
} // switch()
|
||||
|
@ -1087,12 +1160,13 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
|
||||
if (array_key_exists($keys[1], $arr)) $this->setDbPlaylistId($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setDbFileId($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setDbPosition($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDbCliplength($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDbCuein($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbCueout($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setDbFadein($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setDbFadeout($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setDbBlockId($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDbPosition($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDbCliplength($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbCuein($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setDbCueout($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setDbFadein($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setDbFadeout($arr[$keys[9]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1107,6 +1181,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcPlaylistcontentsPeer::ID)) $criteria->add(CcPlaylistcontentsPeer::ID, $this->id);
|
||||
if ($this->isColumnModified(CcPlaylistcontentsPeer::PLAYLIST_ID)) $criteria->add(CcPlaylistcontentsPeer::PLAYLIST_ID, $this->playlist_id);
|
||||
if ($this->isColumnModified(CcPlaylistcontentsPeer::FILE_ID)) $criteria->add(CcPlaylistcontentsPeer::FILE_ID, $this->file_id);
|
||||
if ($this->isColumnModified(CcPlaylistcontentsPeer::BLOCK_ID)) $criteria->add(CcPlaylistcontentsPeer::BLOCK_ID, $this->block_id);
|
||||
if ($this->isColumnModified(CcPlaylistcontentsPeer::POSITION)) $criteria->add(CcPlaylistcontentsPeer::POSITION, $this->position);
|
||||
if ($this->isColumnModified(CcPlaylistcontentsPeer::CLIPLENGTH)) $criteria->add(CcPlaylistcontentsPeer::CLIPLENGTH, $this->cliplength);
|
||||
if ($this->isColumnModified(CcPlaylistcontentsPeer::CUEIN)) $criteria->add(CcPlaylistcontentsPeer::CUEIN, $this->cuein);
|
||||
|
@ -1176,6 +1251,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
{
|
||||
$copyObj->setDbPlaylistId($this->playlist_id);
|
||||
$copyObj->setDbFileId($this->file_id);
|
||||
$copyObj->setDbBlockId($this->block_id);
|
||||
$copyObj->setDbPosition($this->position);
|
||||
$copyObj->setDbCliplength($this->cliplength);
|
||||
$copyObj->setDbCuein($this->cuein);
|
||||
|
@ -1274,6 +1350,55 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
return $this->aCcFiles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a CcBlock object.
|
||||
*
|
||||
* @param CcBlock $v
|
||||
* @return CcPlaylistcontents The current object (for fluent API support)
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function setCcBlock(CcBlock $v = null)
|
||||
{
|
||||
if ($v === null) {
|
||||
$this->setDbBlockId(NULL);
|
||||
} else {
|
||||
$this->setDbBlockId($v->getDbId());
|
||||
}
|
||||
|
||||
$this->aCcBlock = $v;
|
||||
|
||||
// Add binding for other direction of this n:n relationship.
|
||||
// If this object has already been added to the CcBlock object, it will not be re-added.
|
||||
if ($v !== null) {
|
||||
$v->addCcPlaylistcontents($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the associated CcBlock object
|
||||
*
|
||||
* @param PropelPDO Optional Connection object.
|
||||
* @return CcBlock The associated CcBlock object.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCcBlock(PropelPDO $con = null)
|
||||
{
|
||||
if ($this->aCcBlock === null && ($this->block_id !== null)) {
|
||||
$this->aCcBlock = CcBlockQuery::create()->findPk($this->block_id, $con);
|
||||
/* The following can be used additionally to
|
||||
guarantee the related object contains a reference
|
||||
to this object. This level of coupling may, however, be
|
||||
undesirable since it could result in an only partially populated collection
|
||||
in the referenced object.
|
||||
$this->aCcBlock->addCcPlaylistcontentss($this);
|
||||
*/
|
||||
}
|
||||
return $this->aCcBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declares an association between this object and a CcPlaylist object.
|
||||
*
|
||||
|
@ -1335,6 +1460,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
$this->id = null;
|
||||
$this->playlist_id = null;
|
||||
$this->file_id = null;
|
||||
$this->block_id = null;
|
||||
$this->position = null;
|
||||
$this->cliplength = null;
|
||||
$this->cuein = null;
|
||||
|
@ -1365,6 +1491,7 @@ abstract class BaseCcPlaylistcontents extends BaseObject implements Persistent
|
|||
} // if ($deep)
|
||||
|
||||
$this->aCcFiles = null;
|
||||
$this->aCcBlock = null;
|
||||
$this->aCcPlaylist = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
const TM_CLASS = 'CcPlaylistcontentsTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 9;
|
||||
const NUM_COLUMNS = 10;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -40,6 +40,9 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
/** the column name for the FILE_ID field */
|
||||
const FILE_ID = 'cc_playlistcontents.FILE_ID';
|
||||
|
||||
/** the column name for the BLOCK_ID field */
|
||||
const BLOCK_ID = 'cc_playlistcontents.BLOCK_ID';
|
||||
|
||||
/** the column name for the POSITION field */
|
||||
const POSITION = 'cc_playlistcontents.POSITION';
|
||||
|
||||
|
@ -74,12 +77,12 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPlaylistId', 'DbFileId', 'DbPosition', 'DbCliplength', 'DbCuein', 'DbCueout', 'DbFadein', 'DbFadeout', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbFileId', 'dbPosition', 'dbCliplength', 'dbCuein', 'dbCueout', 'dbFadein', 'dbFadeout', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::FILE_ID, self::POSITION, self::CLIPLENGTH, self::CUEIN, self::CUEOUT, self::FADEIN, self::FADEOUT, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'FILE_ID', 'POSITION', 'CLIPLENGTH', 'CUEIN', 'CUEOUT', 'FADEIN', 'FADEOUT', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'file_id', 'position', 'cliplength', 'cuein', 'cueout', 'fadein', 'fadeout', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPlaylistId', 'DbFileId', 'DbBlockId', 'DbPosition', 'DbCliplength', 'DbCuein', 'DbCueout', 'DbFadein', 'DbFadeout', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbFileId', 'dbBlockId', 'dbPosition', 'dbCliplength', 'dbCuein', 'dbCueout', 'dbFadein', 'dbFadeout', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::FILE_ID, self::BLOCK_ID, self::POSITION, self::CLIPLENGTH, self::CUEIN, self::CUEOUT, self::FADEIN, self::FADEOUT, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'FILE_ID', 'BLOCK_ID', 'POSITION', 'CLIPLENGTH', 'CUEIN', 'CUEOUT', 'FADEIN', 'FADEOUT', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'file_id', 'block_id', 'position', 'cliplength', 'cuein', 'cueout', 'fadein', 'fadeout', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -89,12 +92,12 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPlaylistId' => 1, 'DbFileId' => 2, 'DbPosition' => 3, 'DbCliplength' => 4, 'DbCuein' => 5, 'DbCueout' => 6, 'DbFadein' => 7, 'DbFadeout' => 8, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbFileId' => 2, 'dbPosition' => 3, 'dbCliplength' => 4, 'dbCuein' => 5, 'dbCueout' => 6, 'dbFadein' => 7, 'dbFadeout' => 8, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::FILE_ID => 2, self::POSITION => 3, self::CLIPLENGTH => 4, self::CUEIN => 5, self::CUEOUT => 6, self::FADEIN => 7, self::FADEOUT => 8, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'FILE_ID' => 2, 'POSITION' => 3, 'CLIPLENGTH' => 4, 'CUEIN' => 5, 'CUEOUT' => 6, 'FADEIN' => 7, 'FADEOUT' => 8, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'file_id' => 2, 'position' => 3, 'cliplength' => 4, 'cuein' => 5, 'cueout' => 6, 'fadein' => 7, 'fadeout' => 8, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPlaylistId' => 1, 'DbFileId' => 2, 'DbBlockId' => 3, 'DbPosition' => 4, 'DbCliplength' => 5, 'DbCuein' => 6, 'DbCueout' => 7, 'DbFadein' => 8, 'DbFadeout' => 9, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbFileId' => 2, 'dbBlockId' => 3, 'dbPosition' => 4, 'dbCliplength' => 5, 'dbCuein' => 6, 'dbCueout' => 7, 'dbFadein' => 8, 'dbFadeout' => 9, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::FILE_ID => 2, self::BLOCK_ID => 3, self::POSITION => 4, self::CLIPLENGTH => 5, self::CUEIN => 6, self::CUEOUT => 7, self::FADEIN => 8, self::FADEOUT => 9, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'FILE_ID' => 2, 'BLOCK_ID' => 3, 'POSITION' => 4, 'CLIPLENGTH' => 5, 'CUEIN' => 6, 'CUEOUT' => 7, 'FADEIN' => 8, 'FADEOUT' => 9, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'file_id' => 2, 'block_id' => 3, 'position' => 4, 'cliplength' => 5, 'cuein' => 6, 'cueout' => 7, 'fadein' => 8, 'fadeout' => 9, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -169,6 +172,7 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::ID);
|
||||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::PLAYLIST_ID);
|
||||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::FILE_ID);
|
||||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::BLOCK_ID);
|
||||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::POSITION);
|
||||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::CLIPLENGTH);
|
||||
$criteria->addSelectColumn(CcPlaylistcontentsPeer::CUEIN);
|
||||
|
@ -179,6 +183,7 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.PLAYLIST_ID');
|
||||
$criteria->addSelectColumn($alias . '.FILE_ID');
|
||||
$criteria->addSelectColumn($alias . '.BLOCK_ID');
|
||||
$criteria->addSelectColumn($alias . '.POSITION');
|
||||
$criteria->addSelectColumn($alias . '.CLIPLENGTH');
|
||||
$criteria->addSelectColumn($alias . '.CUEIN');
|
||||
|
@ -520,6 +525,56 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinCcBlock(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(CcPlaylistcontentsPeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$count = (int) $row[0];
|
||||
} else {
|
||||
$count = 0; // no rows returned; we infer that means 0 matches.
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related CcPlaylist table
|
||||
*
|
||||
|
@ -636,6 +691,72 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of CcPlaylistcontents objects pre-filled with their CcBlock 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 CcPlaylistcontents objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinCcBlock(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);
|
||||
}
|
||||
|
||||
CcPlaylistcontentsPeer::addSelectColumns($criteria);
|
||||
$startcol = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
CcBlockPeer::addSelectColumns($criteria);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false);
|
||||
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($row);
|
||||
CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1);
|
||||
} // if $obj1 already loaded
|
||||
|
||||
$key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcBlockPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcBlockPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol);
|
||||
CcBlockPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if obj2 already loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to $obj2 (CcBlock)
|
||||
$obj2->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row was not null
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of CcPlaylistcontents objects pre-filled with their CcPlaylist objects.
|
||||
* @param Criteria $criteria
|
||||
|
@ -740,6 +861,8 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
@ -778,11 +901,16 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
CcFilesPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcBlockPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcPlaylistPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
$startcol5 = $startcol4 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
|
@ -820,24 +948,42 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
$obj2->addCcPlaylistcontents($obj1);
|
||||
} // if joined row not null
|
||||
|
||||
// Add objects for joined CcPlaylist rows
|
||||
// Add objects for joined CcBlock rows
|
||||
|
||||
$key3 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
$key3 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcPlaylistPeer::getInstanceFromPool($key3);
|
||||
$obj3 = CcBlockPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcPlaylistPeer::getOMClass(false);
|
||||
$cls = CcBlockPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcPlaylistPeer::addInstanceToPool($obj3, $key3);
|
||||
CcBlockPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if obj3 loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcPlaylist)
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcBlock)
|
||||
$obj3->addCcPlaylistcontents($obj1);
|
||||
} // if joined row not null
|
||||
|
||||
// Add objects for joined CcPlaylist rows
|
||||
|
||||
$key4 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol4);
|
||||
if ($key4 !== null) {
|
||||
$obj4 = CcPlaylistPeer::getInstanceFromPool($key4);
|
||||
if (!$obj4) {
|
||||
|
||||
$cls = CcPlaylistPeer::getOMClass(false);
|
||||
|
||||
$obj4 = new $cls();
|
||||
$obj4->hydrate($row, $startcol4);
|
||||
CcPlaylistPeer::addInstanceToPool($obj4, $key4);
|
||||
} // if obj4 loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj4 (CcPlaylist)
|
||||
$obj4->addCcPlaylistcontents($obj1);
|
||||
} // if joined row not null
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
|
@ -881,6 +1027,60 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
$con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$count = (int) $row[0];
|
||||
} else {
|
||||
$count = 0; // no rows returned; we infer that means 0 matches.
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinAllExceptCcBlock(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(CcPlaylistcontentsPeer::TABLE_NAME);
|
||||
|
||||
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
|
||||
$criteria->setDistinct();
|
||||
}
|
||||
|
||||
if (!$criteria->hasSelectClause()) {
|
||||
CcPlaylistcontentsPeer::addSelectColumns($criteria);
|
||||
}
|
||||
|
||||
$criteria->clearOrderByColumns(); // ORDER BY should not affect count
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
|
||||
}
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
@ -933,6 +1133,8 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$stmt = BasePeer::doCount($criteria, $con);
|
||||
|
||||
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
|
@ -969,8 +1171,13 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
CcPlaylistcontentsPeer::addSelectColumns($criteria);
|
||||
$startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcBlockPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcPlaylistPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
$startcol4 = $startcol3 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior);
|
||||
|
||||
|
@ -992,23 +1199,139 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1);
|
||||
} // if obj1 already loaded
|
||||
|
||||
// Add objects for joined CcPlaylist rows
|
||||
// Add objects for joined CcBlock rows
|
||||
|
||||
$key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol2);
|
||||
$key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol2);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcPlaylistPeer::getInstanceFromPool($key2);
|
||||
$obj2 = CcBlockPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcPlaylistPeer::getOMClass(false);
|
||||
$cls = CcBlockPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol2);
|
||||
CcPlaylistPeer::addInstanceToPool($obj2, $key2);
|
||||
CcBlockPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if $obj2 already loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcPlaylist)
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcBlock)
|
||||
$obj2->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
// Add objects for joined CcPlaylist rows
|
||||
|
||||
$key3 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcPlaylistPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcPlaylistPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcPlaylistPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if $obj3 already loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcPlaylist)
|
||||
$obj3->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
$results[] = $obj1;
|
||||
}
|
||||
$stmt->closeCursor();
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects a collection of CcPlaylistcontents objects pre-filled with all related objects except CcBlock.
|
||||
*
|
||||
* @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 CcPlaylistcontents objects.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doSelectJoinAllExceptCcBlock(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$criteria = clone $criteria;
|
||||
|
||||
// Set the correct dbName if it has not been overridden
|
||||
// $criteria->getDbName() will return the same object if not set to another value
|
||||
// so == check is okay and faster
|
||||
if ($criteria->getDbName() == Propel::getDefaultDB()) {
|
||||
$criteria->setDbName(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
CcPlaylistcontentsPeer::addSelectColumns($criteria);
|
||||
$startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcFilesPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcPlaylistPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior);
|
||||
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
|
||||
$key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0);
|
||||
if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false);
|
||||
|
||||
$obj1 = new $cls();
|
||||
$obj1->hydrate($row);
|
||||
CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1);
|
||||
} // if obj1 already loaded
|
||||
|
||||
// Add objects for joined CcFiles rows
|
||||
|
||||
$key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2);
|
||||
if ($key2 !== null) {
|
||||
$obj2 = CcFilesPeer::getInstanceFromPool($key2);
|
||||
if (!$obj2) {
|
||||
|
||||
$cls = CcFilesPeer::getOMClass(false);
|
||||
|
||||
$obj2 = new $cls();
|
||||
$obj2->hydrate($row, $startcol2);
|
||||
CcFilesPeer::addInstanceToPool($obj2, $key2);
|
||||
} // if $obj2 already loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcFiles)
|
||||
$obj2->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
// Add objects for joined CcPlaylist rows
|
||||
|
||||
$key3 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcPlaylistPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcPlaylistPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcPlaylistPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if $obj3 already loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcPlaylist)
|
||||
$obj3->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
$results[] = $obj1;
|
||||
|
@ -1045,8 +1368,13 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
CcFilesPeer::addSelectColumns($criteria);
|
||||
$startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
CcBlockPeer::addSelectColumns($criteria);
|
||||
$startcol4 = $startcol3 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior);
|
||||
|
||||
$criteria->addJoin(CcPlaylistcontentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior);
|
||||
|
||||
|
||||
$stmt = BasePeer::doSelect($criteria, $con);
|
||||
$results = array();
|
||||
|
@ -1082,6 +1410,25 @@ abstract class BaseCcPlaylistcontentsPeer {
|
|||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcFiles)
|
||||
$obj2->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
// Add objects for joined CcBlock rows
|
||||
|
||||
$key3 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol3);
|
||||
if ($key3 !== null) {
|
||||
$obj3 = CcBlockPeer::getInstanceFromPool($key3);
|
||||
if (!$obj3) {
|
||||
|
||||
$cls = CcBlockPeer::getOMClass(false);
|
||||
|
||||
$obj3 = new $cls();
|
||||
$obj3->hydrate($row, $startcol3);
|
||||
CcBlockPeer::addInstanceToPool($obj3, $key3);
|
||||
} // if $obj3 already loaded
|
||||
|
||||
// Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcBlock)
|
||||
$obj3->addCcPlaylistcontents($obj1);
|
||||
|
||||
} // if joined row is not null
|
||||
|
||||
$results[] = $obj1;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* @method CcPlaylistcontentsQuery orderByDbId($order = Criteria::ASC) Order by the id column
|
||||
* @method CcPlaylistcontentsQuery orderByDbPlaylistId($order = Criteria::ASC) Order by the playlist_id column
|
||||
* @method CcPlaylistcontentsQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column
|
||||
* @method CcPlaylistcontentsQuery orderByDbBlockId($order = Criteria::ASC) Order by the block_id column
|
||||
* @method CcPlaylistcontentsQuery orderByDbPosition($order = Criteria::ASC) Order by the position column
|
||||
* @method CcPlaylistcontentsQuery orderByDbCliplength($order = Criteria::ASC) Order by the cliplength column
|
||||
* @method CcPlaylistcontentsQuery orderByDbCuein($order = Criteria::ASC) Order by the cuein column
|
||||
|
@ -19,6 +20,7 @@
|
|||
* @method CcPlaylistcontentsQuery groupByDbId() Group by the id column
|
||||
* @method CcPlaylistcontentsQuery groupByDbPlaylistId() Group by the playlist_id column
|
||||
* @method CcPlaylistcontentsQuery groupByDbFileId() Group by the file_id column
|
||||
* @method CcPlaylistcontentsQuery groupByDbBlockId() Group by the block_id column
|
||||
* @method CcPlaylistcontentsQuery groupByDbPosition() Group by the position column
|
||||
* @method CcPlaylistcontentsQuery groupByDbCliplength() Group by the cliplength column
|
||||
* @method CcPlaylistcontentsQuery groupByDbCuein() Group by the cuein column
|
||||
|
@ -34,6 +36,10 @@
|
|||
* @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 leftJoinCcBlock($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcPlaylistcontentsQuery rightJoinCcBlock($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcPlaylistcontentsQuery innerJoinCcBlock($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlock 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
|
||||
|
@ -44,6 +50,7 @@
|
|||
* @method CcPlaylistcontents findOneByDbId(int $id) Return the first CcPlaylistcontents filtered by the id column
|
||||
* @method CcPlaylistcontents findOneByDbPlaylistId(int $playlist_id) Return the first CcPlaylistcontents filtered by the playlist_id column
|
||||
* @method CcPlaylistcontents findOneByDbFileId(int $file_id) Return the first CcPlaylistcontents filtered by the file_id column
|
||||
* @method CcPlaylistcontents findOneByDbBlockId(int $block_id) Return the first CcPlaylistcontents filtered by the block_id column
|
||||
* @method CcPlaylistcontents findOneByDbPosition(int $position) Return the first CcPlaylistcontents filtered by the position column
|
||||
* @method CcPlaylistcontents findOneByDbCliplength(string $cliplength) Return the first CcPlaylistcontents filtered by the cliplength column
|
||||
* @method CcPlaylistcontents findOneByDbCuein(string $cuein) Return the first CcPlaylistcontents filtered by the cuein column
|
||||
|
@ -54,6 +61,7 @@
|
|||
* @method array findByDbId(int $id) Return CcPlaylistcontents objects filtered by the id column
|
||||
* @method array findByDbPlaylistId(int $playlist_id) Return CcPlaylistcontents objects filtered by the playlist_id column
|
||||
* @method array findByDbFileId(int $file_id) Return CcPlaylistcontents objects filtered by the file_id column
|
||||
* @method array findByDbBlockId(int $block_id) Return CcPlaylistcontents objects filtered by the block_id column
|
||||
* @method array findByDbPosition(int $position) Return CcPlaylistcontents objects filtered by the position column
|
||||
* @method array findByDbCliplength(string $cliplength) Return CcPlaylistcontents objects filtered by the cliplength column
|
||||
* @method array findByDbCuein(string $cuein) Return CcPlaylistcontents objects filtered by the cuein column
|
||||
|
@ -248,6 +256,37 @@ abstract class BaseCcPlaylistcontentsQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the block_id column
|
||||
*
|
||||
* @param int|array $dbBlockId 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 filterByDbBlockId($dbBlockId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbBlockId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbBlockId['min'])) {
|
||||
$this->addUsingAlias(CcPlaylistcontentsPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbBlockId['max'])) {
|
||||
$this->addUsingAlias(CcPlaylistcontentsPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcPlaylistcontentsPeer::BLOCK_ID, $dbBlockId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the position column
|
||||
*
|
||||
|
@ -471,6 +510,70 @@ abstract class BaseCcPlaylistcontentsQuery extends ModelCriteria
|
|||
->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcBlock object
|
||||
*
|
||||
* @param CcBlock $ccBlock 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 filterByCcBlock($ccBlock, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcPlaylistcontentsPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlock 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 joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlock');
|
||||
|
||||
// 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, 'CcBlock');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcPlaylist object
|
||||
*
|
||||
|
|
|
@ -60,6 +60,12 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $playlist_id;
|
||||
|
||||
/**
|
||||
* The value for the set_number field.
|
||||
* @var int
|
||||
*/
|
||||
protected $set_number;
|
||||
|
||||
/**
|
||||
* @var CcPlaylist
|
||||
*/
|
||||
|
@ -139,6 +145,16 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
return $this->playlist_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [set_number] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDbSetNumber()
|
||||
{
|
||||
return $this->set_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [id] column.
|
||||
*
|
||||
|
@ -263,6 +279,26 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
return $this;
|
||||
} // setDbPlaylistId()
|
||||
|
||||
/**
|
||||
* Set the value of [set_number] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return CcPlaylistcriteria The current object (for fluent API support)
|
||||
*/
|
||||
public function setDbSetNumber($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->set_number !== $v) {
|
||||
$this->set_number = $v;
|
||||
$this->modifiedColumns[] = CcPlaylistcriteriaPeer::SET_NUMBER;
|
||||
}
|
||||
|
||||
return $this;
|
||||
} // setDbSetNumber()
|
||||
|
||||
/**
|
||||
* Indicates whether the columns in this object are only set to default values.
|
||||
*
|
||||
|
@ -301,6 +337,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
$this->value = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
|
||||
$this->extra = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
|
||||
$this->playlist_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
|
||||
$this->set_number = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
@ -309,7 +346,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 6; // 6 = CcPlaylistcriteriaPeer::NUM_COLUMNS - CcPlaylistcriteriaPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 7; // 7 = CcPlaylistcriteriaPeer::NUM_COLUMNS - CcPlaylistcriteriaPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating CcPlaylistcriteria object", $e);
|
||||
|
@ -654,6 +691,9 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
case 5:
|
||||
return $this->getDbPlaylistId();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getDbSetNumber();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
|
@ -684,6 +724,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
$keys[3] => $this->getDbValue(),
|
||||
$keys[4] => $this->getDbExtra(),
|
||||
$keys[5] => $this->getDbPlaylistId(),
|
||||
$keys[6] => $this->getDbSetNumber(),
|
||||
);
|
||||
if ($includeForeignObjects) {
|
||||
if (null !== $this->aCcPlaylist) {
|
||||
|
@ -738,6 +779,9 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
case 5:
|
||||
$this->setDbPlaylistId($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setDbSetNumber($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
|
@ -768,6 +812,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
if (array_key_exists($keys[3], $arr)) $this->setDbValue($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setDbExtra($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setDbPlaylistId($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setDbSetNumber($arr[$keys[6]]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -785,6 +830,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
if ($this->isColumnModified(CcPlaylistcriteriaPeer::VALUE)) $criteria->add(CcPlaylistcriteriaPeer::VALUE, $this->value);
|
||||
if ($this->isColumnModified(CcPlaylistcriteriaPeer::EXTRA)) $criteria->add(CcPlaylistcriteriaPeer::EXTRA, $this->extra);
|
||||
if ($this->isColumnModified(CcPlaylistcriteriaPeer::PLAYLIST_ID)) $criteria->add(CcPlaylistcriteriaPeer::PLAYLIST_ID, $this->playlist_id);
|
||||
if ($this->isColumnModified(CcPlaylistcriteriaPeer::SET_NUMBER)) $criteria->add(CcPlaylistcriteriaPeer::SET_NUMBER, $this->set_number);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
@ -851,6 +897,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
$copyObj->setDbValue($this->value);
|
||||
$copyObj->setDbExtra($this->extra);
|
||||
$copyObj->setDbPlaylistId($this->playlist_id);
|
||||
$copyObj->setDbSetNumber($this->set_number);
|
||||
|
||||
$copyObj->setNew(true);
|
||||
$copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value
|
||||
|
@ -954,6 +1001,7 @@ abstract class BaseCcPlaylistcriteria extends BaseObject implements Persistent
|
|||
$this->value = null;
|
||||
$this->extra = null;
|
||||
$this->playlist_id = null;
|
||||
$this->set_number = null;
|
||||
$this->alreadyInSave = false;
|
||||
$this->alreadyInValidation = false;
|
||||
$this->clearAllReferences();
|
||||
|
|
|
@ -26,7 +26,7 @@ abstract class BaseCcPlaylistcriteriaPeer {
|
|||
const TM_CLASS = 'CcPlaylistcriteriaTableMap';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 6;
|
||||
const NUM_COLUMNS = 7;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
@ -49,6 +49,9 @@ abstract class BaseCcPlaylistcriteriaPeer {
|
|||
/** the column name for the PLAYLIST_ID field */
|
||||
const PLAYLIST_ID = 'cc_playlistcriteria.PLAYLIST_ID';
|
||||
|
||||
/** the column name for the SET_NUMBER field */
|
||||
const SET_NUMBER = 'cc_playlistcriteria.SET_NUMBER';
|
||||
|
||||
/**
|
||||
* An identiy map to hold any loaded instances of CcPlaylistcriteria objects.
|
||||
* This must be public so that other peer classes can access this when hydrating from JOIN
|
||||
|
@ -65,12 +68,12 @@ abstract class BaseCcPlaylistcriteriaPeer {
|
|||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbCriteria', 'DbModifier', 'DbValue', 'DbExtra', 'DbPlaylistId', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbCriteria', 'dbModifier', 'dbValue', 'dbExtra', 'dbPlaylistId', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::CRITERIA, self::MODIFIER, self::VALUE, self::EXTRA, self::PLAYLIST_ID, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'CRITERIA', 'MODIFIER', 'VALUE', 'EXTRA', 'PLAYLIST_ID', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'criteria', 'modifier', 'value', 'extra', 'playlist_id', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbCriteria', 'DbModifier', 'DbValue', 'DbExtra', 'DbPlaylistId', 'DbSetNumber', ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbCriteria', 'dbModifier', 'dbValue', 'dbExtra', 'dbPlaylistId', 'dbSetNumber', ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID, self::CRITERIA, self::MODIFIER, self::VALUE, self::EXTRA, self::PLAYLIST_ID, self::SET_NUMBER, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'CRITERIA', 'MODIFIER', 'VALUE', 'EXTRA', 'PLAYLIST_ID', 'SET_NUMBER', ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id', 'criteria', 'modifier', 'value', 'extra', 'playlist_id', 'set_number', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -80,12 +83,12 @@ abstract class BaseCcPlaylistcriteriaPeer {
|
|||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbCriteria' => 1, 'DbModifier' => 2, 'DbValue' => 3, 'DbExtra' => 4, 'DbPlaylistId' => 5, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbCriteria' => 1, 'dbModifier' => 2, 'dbValue' => 3, 'dbExtra' => 4, 'dbPlaylistId' => 5, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::CRITERIA => 1, self::MODIFIER => 2, self::VALUE => 3, self::EXTRA => 4, self::PLAYLIST_ID => 5, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'CRITERIA' => 1, 'MODIFIER' => 2, 'VALUE' => 3, 'EXTRA' => 4, 'PLAYLIST_ID' => 5, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'criteria' => 1, 'modifier' => 2, 'value' => 3, 'extra' => 4, 'playlist_id' => 5, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
||||
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbCriteria' => 1, 'DbModifier' => 2, 'DbValue' => 3, 'DbExtra' => 4, 'DbPlaylistId' => 5, 'DbSetNumber' => 6, ),
|
||||
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbCriteria' => 1, 'dbModifier' => 2, 'dbValue' => 3, 'dbExtra' => 4, 'dbPlaylistId' => 5, 'dbSetNumber' => 6, ),
|
||||
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::CRITERIA => 1, self::MODIFIER => 2, self::VALUE => 3, self::EXTRA => 4, self::PLAYLIST_ID => 5, self::SET_NUMBER => 6, ),
|
||||
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'CRITERIA' => 1, 'MODIFIER' => 2, 'VALUE' => 3, 'EXTRA' => 4, 'PLAYLIST_ID' => 5, 'SET_NUMBER' => 6, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'criteria' => 1, 'modifier' => 2, 'value' => 3, 'extra' => 4, 'playlist_id' => 5, 'set_number' => 6, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -163,6 +166,7 @@ abstract class BaseCcPlaylistcriteriaPeer {
|
|||
$criteria->addSelectColumn(CcPlaylistcriteriaPeer::VALUE);
|
||||
$criteria->addSelectColumn(CcPlaylistcriteriaPeer::EXTRA);
|
||||
$criteria->addSelectColumn(CcPlaylistcriteriaPeer::PLAYLIST_ID);
|
||||
$criteria->addSelectColumn(CcPlaylistcriteriaPeer::SET_NUMBER);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.CRITERIA');
|
||||
|
@ -170,6 +174,7 @@ abstract class BaseCcPlaylistcriteriaPeer {
|
|||
$criteria->addSelectColumn($alias . '.VALUE');
|
||||
$criteria->addSelectColumn($alias . '.EXTRA');
|
||||
$criteria->addSelectColumn($alias . '.PLAYLIST_ID');
|
||||
$criteria->addSelectColumn($alias . '.SET_NUMBER');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
* @method CcPlaylistcriteriaQuery orderByDbValue($order = Criteria::ASC) Order by the value column
|
||||
* @method CcPlaylistcriteriaQuery orderByDbExtra($order = Criteria::ASC) Order by the extra column
|
||||
* @method CcPlaylistcriteriaQuery orderByDbPlaylistId($order = Criteria::ASC) Order by the playlist_id column
|
||||
* @method CcPlaylistcriteriaQuery orderByDbSetNumber($order = Criteria::ASC) Order by the set_number column
|
||||
*
|
||||
* @method CcPlaylistcriteriaQuery groupByDbId() Group by the id column
|
||||
* @method CcPlaylistcriteriaQuery groupByDbCriteria() Group by the criteria column
|
||||
|
@ -19,6 +20,7 @@
|
|||
* @method CcPlaylistcriteriaQuery groupByDbValue() Group by the value column
|
||||
* @method CcPlaylistcriteriaQuery groupByDbExtra() Group by the extra column
|
||||
* @method CcPlaylistcriteriaQuery groupByDbPlaylistId() Group by the playlist_id column
|
||||
* @method CcPlaylistcriteriaQuery groupByDbSetNumber() Group by the set_number column
|
||||
*
|
||||
* @method CcPlaylistcriteriaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method CcPlaylistcriteriaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
|
@ -37,6 +39,7 @@
|
|||
* @method CcPlaylistcriteria findOneByDbValue(string $value) Return the first CcPlaylistcriteria filtered by the value column
|
||||
* @method CcPlaylistcriteria findOneByDbExtra(string $extra) Return the first CcPlaylistcriteria filtered by the extra column
|
||||
* @method CcPlaylistcriteria findOneByDbPlaylistId(int $playlist_id) Return the first CcPlaylistcriteria filtered by the playlist_id column
|
||||
* @method CcPlaylistcriteria findOneByDbSetNumber(int $set_number) Return the first CcPlaylistcriteria filtered by the set_number column
|
||||
*
|
||||
* @method array findByDbId(int $id) Return CcPlaylistcriteria objects filtered by the id column
|
||||
* @method array findByDbCriteria(string $criteria) Return CcPlaylistcriteria objects filtered by the criteria column
|
||||
|
@ -44,6 +47,7 @@
|
|||
* @method array findByDbValue(string $value) Return CcPlaylistcriteria objects filtered by the value column
|
||||
* @method array findByDbExtra(string $extra) Return CcPlaylistcriteria objects filtered by the extra column
|
||||
* @method array findByDbPlaylistId(int $playlist_id) Return CcPlaylistcriteria objects filtered by the playlist_id column
|
||||
* @method array findByDbSetNumber(int $set_number) Return CcPlaylistcriteria objects filtered by the set_number column
|
||||
*
|
||||
* @package propel.generator.airtime.om
|
||||
*/
|
||||
|
@ -289,6 +293,37 @@ abstract class BaseCcPlaylistcriteriaQuery extends ModelCriteria
|
|||
return $this->addUsingAlias(CcPlaylistcriteriaPeer::PLAYLIST_ID, $dbPlaylistId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the set_number column
|
||||
*
|
||||
* @param int|array $dbSetNumber 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 CcPlaylistcriteriaQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDbSetNumber($dbSetNumber = null, $comparison = null)
|
||||
{
|
||||
if (is_array($dbSetNumber)) {
|
||||
$useMinMax = false;
|
||||
if (isset($dbSetNumber['min'])) {
|
||||
$this->addUsingAlias(CcPlaylistcriteriaPeer::SET_NUMBER, $dbSetNumber['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($dbSetNumber['max'])) {
|
||||
$this->addUsingAlias(CcPlaylistcriteriaPeer::SET_NUMBER, $dbSetNumber['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcPlaylistcriteriaPeer::SET_NUMBER, $dbSetNumber, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcPlaylist object
|
||||
*
|
||||
|
|
|
@ -133,6 +133,11 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
*/
|
||||
protected $collCcPlaylists;
|
||||
|
||||
/**
|
||||
* @var array CcBlock[] Collection to store aggregation of CcBlock objects.
|
||||
*/
|
||||
protected $collCcBlocks;
|
||||
|
||||
/**
|
||||
* @var array CcPref[] Collection to store aggregation of CcPref objects.
|
||||
*/
|
||||
|
@ -831,6 +836,8 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
|
||||
$this->collCcPlaylists = null;
|
||||
|
||||
$this->collCcBlocks = null;
|
||||
|
||||
$this->collCcPrefs = null;
|
||||
|
||||
$this->collCcSesss = null;
|
||||
|
@ -1010,6 +1017,14 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcBlocks !== null) {
|
||||
foreach ($this->collCcBlocks as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
$affectedRows += $referrerFK->save($con);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcPrefs !== null) {
|
||||
foreach ($this->collCcPrefs as $referrerFK) {
|
||||
if (!$referrerFK->isDeleted()) {
|
||||
|
@ -1145,6 +1160,14 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->collCcBlocks !== null) {
|
||||
foreach ($this->collCcBlocks as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->collCcPrefs !== null) {
|
||||
foreach ($this->collCcPrefs as $referrerFK) {
|
||||
if (!$referrerFK->validate($columns)) {
|
||||
|
@ -1517,6 +1540,12 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcBlocks() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcBlock($relObj->copy($deepCopy));
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getCcPrefs() as $relObj) {
|
||||
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
|
||||
$copyObj->addCcPref($relObj->copy($deepCopy));
|
||||
|
@ -2175,6 +2204,115 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcBlocks collection
|
||||
*
|
||||
* This does not modify the database; however, it will remove any associated objects, causing
|
||||
* them to be refetched by subsequent calls to accessor method.
|
||||
*
|
||||
* @return void
|
||||
* @see addCcBlocks()
|
||||
*/
|
||||
public function clearCcBlocks()
|
||||
{
|
||||
$this->collCcBlocks = null; // important to set this to NULL since that means it is uninitialized
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the collCcBlocks collection.
|
||||
*
|
||||
* By default this just sets the collCcBlocks collection to an empty array (like clearcollCcBlocks());
|
||||
* however, you may wish to override this method in your stub class to provide setting appropriate
|
||||
* to your application -- for example, setting the initial array to the values stored in database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCcBlocks()
|
||||
{
|
||||
$this->collCcBlocks = new PropelObjectCollection();
|
||||
$this->collCcBlocks->setModel('CcBlock');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of CcBlock objects which contain a foreign key that references this object.
|
||||
*
|
||||
* If the $criteria is not null, it is used to always fetch the results from the database.
|
||||
* Otherwise the results are fetched from the database the first time, then cached.
|
||||
* Next time the same method is called without $criteria, the cached collection is returned.
|
||||
* If this CcSubjs is new, it will return
|
||||
* an empty collection or the current collection; the criteria is ignored on a new object.
|
||||
*
|
||||
* @param Criteria $criteria optional Criteria object to narrow the query
|
||||
* @param PropelPDO $con optional connection object
|
||||
* @return PropelCollection|array CcBlock[] List of CcBlock objects
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function getCcBlocks($criteria = null, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcBlocks || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcBlocks) {
|
||||
// return empty collection
|
||||
$this->initCcBlocks();
|
||||
} else {
|
||||
$collCcBlocks = CcBlockQuery::create(null, $criteria)
|
||||
->filterByCcSubjs($this)
|
||||
->find($con);
|
||||
if (null !== $criteria) {
|
||||
return $collCcBlocks;
|
||||
}
|
||||
$this->collCcBlocks = $collCcBlocks;
|
||||
}
|
||||
}
|
||||
return $this->collCcBlocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of related CcBlock objects.
|
||||
*
|
||||
* @param Criteria $criteria
|
||||
* @param boolean $distinct
|
||||
* @param PropelPDO $con
|
||||
* @return int Count of related CcBlock objects.
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function countCcBlocks(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
|
||||
{
|
||||
if(null === $this->collCcBlocks || null !== $criteria) {
|
||||
if ($this->isNew() && null === $this->collCcBlocks) {
|
||||
return 0;
|
||||
} else {
|
||||
$query = CcBlockQuery::create(null, $criteria);
|
||||
if($distinct) {
|
||||
$query->distinct();
|
||||
}
|
||||
return $query
|
||||
->filterByCcSubjs($this)
|
||||
->count($con);
|
||||
}
|
||||
} else {
|
||||
return count($this->collCcBlocks);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called to associate a CcBlock object to this object
|
||||
* through the CcBlock foreign key attribute.
|
||||
*
|
||||
* @param CcBlock $l CcBlock
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function addCcBlock(CcBlock $l)
|
||||
{
|
||||
if ($this->collCcBlocks === null) {
|
||||
$this->initCcBlocks();
|
||||
}
|
||||
if (!$this->collCcBlocks->contains($l)) { // only add it if the **same** object is not already associated
|
||||
$this->collCcBlocks[]= $l;
|
||||
$l->setCcSubjs($this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears out the collCcPrefs collection
|
||||
*
|
||||
|
@ -2566,6 +2704,11 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcBlocks) {
|
||||
foreach ((array) $this->collCcBlocks as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
}
|
||||
}
|
||||
if ($this->collCcPrefs) {
|
||||
foreach ((array) $this->collCcPrefs as $o) {
|
||||
$o->clearAllReferences($deep);
|
||||
|
@ -2588,6 +2731,7 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
|
|||
$this->collCcPermss = null;
|
||||
$this->collCcShowHostss = null;
|
||||
$this->collCcPlaylists = null;
|
||||
$this->collCcBlocks = null;
|
||||
$this->collCcPrefs = null;
|
||||
$this->collCcSesss = null;
|
||||
$this->collCcSubjsTokens = null;
|
||||
|
|
|
@ -58,6 +58,10 @@
|
|||
* @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 leftJoinCcBlock($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcSubjsQuery rightJoinCcBlock($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlock relation
|
||||
* @method CcSubjsQuery innerJoinCcBlock($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlock 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
|
||||
|
@ -837,6 +841,70 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
|
|||
->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcBlock object
|
||||
*
|
||||
* @param CcBlock $ccBlock 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 filterByCcBlock($ccBlock, $comparison = null)
|
||||
{
|
||||
return $this
|
||||
->addUsingAlias(CcSubjsPeer::ID, $ccBlock->getDbCreatorId(), $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the CcBlock 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 joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('CcBlock');
|
||||
|
||||
// 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, 'CcBlock');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinCcBlock($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related CcPref object
|
||||
*
|
||||
|
|
|
@ -3,5 +3,9 @@
|
|||
</div>
|
||||
|
||||
<div id="side_playlist" class="pl-content ui-widget ui-widget-content block-shadow omega-block padded">
|
||||
<?php echo $this->render('playlist/playlist.phtml') ?>
|
||||
<?php if ($this->type == 'block') {
|
||||
echo $this->render('playlist/smart-block.phtml');
|
||||
} else {
|
||||
echo $this->render('playlist/playlist.phtml');
|
||||
} ?>
|
||||
</div>
|
|
@ -7,8 +7,8 @@
|
|||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($this->obj)) : ?>
|
||||
<input id="pl_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"></input>
|
||||
<input id="pl_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
|
||||
<input id="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"></input>
|
||||
<input id="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
|
||||
<input id='obj_type' type='hidden' value='playlist'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="spl_name">
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($this->obj)) : ?>
|
||||
<input id="bl_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"></input>
|
||||
<input id="bl_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
|
||||
<input id="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"></input>
|
||||
<input id="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
|
||||
<input id='obj_type' type='hidden' value='block'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="bl_name">
|
||||
|
@ -49,7 +49,7 @@
|
|||
<div class="clear"></div>
|
||||
<div class="" style="clear:both; float:none; width:100%;">
|
||||
<ul id="spl_sortable">
|
||||
<?php //echo $this->render('playlist/update.phtml') ?>
|
||||
<?php echo $this->render('playlist/update.phtml') ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -238,6 +238,7 @@
|
|||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="playlist_id" phpName="DbPlaylistId" type="INTEGER" required="false"/>
|
||||
<column name="file_id" phpName="DbFileId" type="INTEGER" required="false"/>
|
||||
<column name="block_id" phpName="DbBlockId" type="INTEGER" required="false"/>
|
||||
<column name="position" phpName="DbPosition" type="INTEGER" required="false"/>
|
||||
<column name="cliplength" phpName="DbCliplength" type="VARCHAR" sqlType="interval" required="false" defaultValue="00:00:00"/>
|
||||
<column name="cuein" phpName="DbCuein" type="VARCHAR" sqlType="interval" required="false" defaultValue="00:00:00"/>
|
||||
|
@ -247,19 +248,57 @@
|
|||
<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_block" name="cc_playlistcontents_block_id_fkey" onDelete="CASCADE">
|
||||
<reference local="block_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_playlistcriteria" phpName="CcPlaylistcriteria">
|
||||
<table name="cc_block" phpName="CcBlock">
|
||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
|
||||
<column name="mtime" phpName="DbMtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="utime" phpName="DbUtime" type="TIMESTAMP" size="6" required="false"/>
|
||||
<column name="creator_id" phpName="DbCreatorId" type="INTEGER" required="false"/>
|
||||
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
|
||||
<column name="length" phpName="DbLength" type="VARCHAR" sqlType="interval" defaultValue="00:00:00"/>
|
||||
<column name="type" phpName="DbType" type="VARCHAR" size="7" defaultValue="static"/>
|
||||
<behavior name="aggregate_column">
|
||||
<parameter name="name" value="length" />
|
||||
<parameter name="foreign_table" value="cc_blockcontents" />
|
||||
<parameter name="expression" value="SUM(cliplength)" />
|
||||
</behavior>
|
||||
<foreign-key foreignTable="cc_subjs" name="cc_block_createdby_fkey">
|
||||
<reference local="creator_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<table name="cc_blockcontents" phpName="CcBlockcontents">
|
||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="block_id" phpName="DbBlockId" type="INTEGER" required="false"/>
|
||||
<column name="file_id" phpName="DbFileId" type="INTEGER" required="false"/>
|
||||
<column name="position" phpName="DbPosition" type="INTEGER" required="false"/>
|
||||
<column name="cliplength" phpName="DbCliplength" type="VARCHAR" sqlType="interval" required="false" defaultValue="00:00:00"/>
|
||||
<column name="cuein" phpName="DbCuein" type="VARCHAR" sqlType="interval" required="false" defaultValue="00:00:00"/>
|
||||
<column name="cueout" phpName="DbCueout" type="VARCHAR" sqlType="interval" required="false" defaultValue="00:00:00"/>
|
||||
<column name="fadein" phpName="DbFadein" type="TIME" required="false" defaultValue="00:00:00"/>
|
||||
<column name="fadeout" phpName="DbFadeout" type="TIME" required="false" defaultValue="00:00:00"/>
|
||||
<foreign-key foreignTable="cc_files" name="cc_blockcontents_file_id_fkey" onDelete="CASCADE">
|
||||
<reference local="file_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="cc_block" name="cc_blockcontents_block_id_fkey" onDelete="CASCADE">
|
||||
<reference local="block_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<table name="cc_blockcriteria" phpName="CcBlockcriteria">
|
||||
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
|
||||
<column name="criteria" phpName="DbCriteria" type="VARCHAR" size="16" required="true"/>
|
||||
<column name="modifier" phpName="DbModifier" type="VARCHAR" size="16" required="true"/>
|
||||
<column name="value" phpName="DbValue" type="VARCHAR" size="512" required="true"/>
|
||||
<column name="extra" phpName="DbExtra" type="VARCHAR" size="512" required="false"/>
|
||||
<column name="playlist_id" phpName="DbPlaylistId" type="INTEGER" required="true"/>
|
||||
<foreign-key foreignTable="cc_playlist" name="cc_playlistcontents_playlist_id_fkey" onDelete="CASCADE">
|
||||
<reference local="playlist_id" foreign="id"/>
|
||||
<column name="block_id" phpName="DbBlockId" type="INTEGER" required="true"/>
|
||||
<foreign-key foreignTable="cc_block" name="cc_blockcontents_block_id_fkey" onDelete="CASCADE">
|
||||
<reference local="block_id" foreign="id"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
<table name="cc_pref" phpName="CcPref">
|
||||
|
|
|
@ -321,6 +321,7 @@ CREATE TABLE "cc_playlistcontents"
|
|||
"id" serial NOT NULL,
|
||||
"playlist_id" INTEGER,
|
||||
"file_id" INTEGER,
|
||||
"block_id" INTEGER,
|
||||
"position" INTEGER,
|
||||
"cliplength" interval default '00:00:00',
|
||||
"cuein" interval default '00:00:00',
|
||||
|
@ -335,24 +336,73 @@ COMMENT ON TABLE "cc_playlistcontents" IS '';
|
|||
|
||||
SET search_path TO public;
|
||||
-----------------------------------------------------------------------------
|
||||
-- cc_playlistcriteria
|
||||
-- cc_block
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE "cc_playlistcriteria" CASCADE;
|
||||
DROP TABLE "cc_block" CASCADE;
|
||||
|
||||
|
||||
CREATE TABLE "cc_playlistcriteria"
|
||||
CREATE TABLE "cc_block"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"name" VARCHAR(255) default '' NOT NULL,
|
||||
"mtime" TIMESTAMP(6),
|
||||
"utime" TIMESTAMP(6),
|
||||
"creator_id" INTEGER,
|
||||
"description" VARCHAR(512),
|
||||
"length" interval default '00:00:00',
|
||||
"type" VARCHAR(7) default 'static',
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "cc_block" IS '';
|
||||
|
||||
|
||||
SET search_path TO public;
|
||||
-----------------------------------------------------------------------------
|
||||
-- cc_blockcontents
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE "cc_blockcontents" CASCADE;
|
||||
|
||||
|
||||
CREATE TABLE "cc_blockcontents"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"block_id" INTEGER,
|
||||
"file_id" INTEGER,
|
||||
"position" INTEGER,
|
||||
"cliplength" interval default '00:00:00',
|
||||
"cuein" interval default '00:00:00',
|
||||
"cueout" interval default '00:00:00',
|
||||
"fadein" TIME default '00:00:00',
|
||||
"fadeout" TIME default '00:00:00',
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "cc_blockcontents" IS '';
|
||||
|
||||
|
||||
SET search_path TO public;
|
||||
-----------------------------------------------------------------------------
|
||||
-- cc_blockcriteria
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
DROP TABLE "cc_blockcriteria" CASCADE;
|
||||
|
||||
|
||||
CREATE TABLE "cc_blockcriteria"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"criteria" VARCHAR(16) NOT NULL,
|
||||
"modifier" VARCHAR(16) NOT NULL,
|
||||
"value" VARCHAR(512) NOT NULL,
|
||||
"extra" VARCHAR(512),
|
||||
"playlist_id" INTEGER NOT NULL,
|
||||
"block_id" INTEGER NOT NULL,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
COMMENT ON TABLE "cc_playlistcriteria" IS '';
|
||||
COMMENT ON TABLE "cc_blockcriteria" IS '';
|
||||
|
||||
|
||||
SET search_path TO public;
|
||||
|
@ -627,9 +677,17 @@ ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_createdby_fkey" FOREIGN KE
|
|||
|
||||
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_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("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_playlistcriteria" ADD CONSTRAINT "cc_playlistcontents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE;
|
||||
ALTER TABLE "cc_block" ADD CONSTRAINT "cc_block_createdby_fkey" FOREIGN KEY ("creator_id") REFERENCES "cc_subjs" ("id");
|
||||
|
||||
ALTER TABLE "cc_blockcontents" ADD CONSTRAINT "cc_blockcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_blockcontents" ADD CONSTRAINT "cc_blockcontents_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_blockcriteria" ADD CONSTRAINT "cc_blockcontents_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("id") ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_pref" ADD CONSTRAINT "cc_pref_subjid_fkey" FOREIGN KEY ("subjid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
|
||||
|
||||
|
|
|
@ -307,15 +307,15 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
function getId() {
|
||||
return parseInt($("#pl_id").val(), 10);
|
||||
return parseInt($("#obj_id").val(), 10);
|
||||
}
|
||||
|
||||
function getModified() {
|
||||
return parseInt($("#pl_lastMod").val(), 10);
|
||||
return parseInt($("#obj_lastMod").val(), 10);
|
||||
}
|
||||
|
||||
function setModified(modified) {
|
||||
$("#pl_lastMod").val(modified);
|
||||
$("#obj_lastMod").val(modified);
|
||||
}
|
||||
|
||||
function openPlaylist(json) {
|
||||
|
|
|
@ -119,30 +119,30 @@ function setSmartPlaylistEvents() {
|
|||
|
||||
form.find('button[id="save_button"]').live("click", function(event){
|
||||
var data = $('form').serializeArray(),
|
||||
save_action = 'Playlist/smart-playlist-criteria-save',
|
||||
playlist_id = $('input[id="pl_id"]').val();
|
||||
save_action = 'Playlist/smart-block-criteria-save',
|
||||
obj_id = $('input[id="obj_id"]').val();
|
||||
|
||||
$.post(save_action, {format: "json", data: data, pl_id: playlist_id}, function(data){
|
||||
$.post(save_action, {format: "json", data: data, obj_id: obj_id}, function(data){
|
||||
callback(data, "save");
|
||||
});
|
||||
});
|
||||
|
||||
form.find('button[id="generate_button"]').live("click", function(event){
|
||||
var data = $('form').serializeArray(),
|
||||
generate_action = 'Playlist/smart-playlist-generate',
|
||||
playlist_id = $('input[id="pl_id"]').val();
|
||||
generate_action = 'Playlist/smart-block-generate',
|
||||
obj_id = $('input[id="obj_id"]').val();
|
||||
|
||||
$.post(generate_action, {format: "json", data: data, pl_id: playlist_id}, function(data){
|
||||
$.post(generate_action, {format: "json", data: data, obj_id: obj_id}, function(data){
|
||||
callback(data, "generate");
|
||||
});
|
||||
});
|
||||
|
||||
form.find('button[id="shuffle_button"]').live("click", function(event){
|
||||
var data = $('form').serializeArray(),
|
||||
shuffle_action = 'Playlist/smart-playlist-shuffle',
|
||||
playlist_id = $('input[id="pl_id"]').val();
|
||||
shuffle_action = 'Playlist/smart-block-shuffle',
|
||||
obj_id = $('input[id="obj_id"]').val();
|
||||
|
||||
$.post(shuffle_action, {format: "json", data: data, pl_id: playlist_id}, function(data){
|
||||
$.post(shuffle_action, {format: "json", data: data, obj_id: obj_id}, function(data){
|
||||
callback(data, "shuffle");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue