CC-2559 : Remove files from cc_schedule that are no longer watched

adding foreign key to file_id column of cc_schedule table.
This commit is contained in:
Naomi Aro 2011-07-18 15:54:05 +02:00
parent 4588ebd105
commit b7819211ac
11 changed files with 808 additions and 2 deletions

View file

@ -138,6 +138,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 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
*
* @method CcFiles findOne(PropelPDO $con = null) Return the first CcFiles matching the query
* @method CcFiles findOneOrCreate(PropelPDO $con = null) Return the first CcFiles matching the query, or a new CcFiles object populated from the query conditions when no match is found
*
@ -1885,6 +1889,70 @@ abstract class BaseCcFilesQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery');
}
/**
* Filter the query by a related CcSchedule object
*
* @param CcSchedule $ccSchedule 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 filterByCcSchedule($ccSchedule, $comparison = null)
{
return $this
->addUsingAlias(CcFilesPeer::ID, $ccSchedule->getDbFileId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcSchedule 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 joinCcSchedule($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcSchedule');
// 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, 'CcSchedule');
}
return $this;
}
/**
* Use the CcSchedule relation CcSchedule 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 CcScheduleQuery A secondary query class using the current class as primary query
*/
public function useCcScheduleQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinCcSchedule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcSchedule', 'CcScheduleQuery');
}
/**
* Exclude object from result
*