BaseCcPlayoutHistoryQuery.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_playout_history' table.
  4. *
  5. *
  6. *
  7. * @method CcPlayoutHistoryQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcPlayoutHistoryQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column
  9. * @method CcPlayoutHistoryQuery orderByDbStarts($order = Criteria::ASC) Order by the starts column
  10. * @method CcPlayoutHistoryQuery orderByDbEnds($order = Criteria::ASC) Order by the ends column
  11. * @method CcPlayoutHistoryQuery orderByDbInstanceId($order = Criteria::ASC) Order by the instance_id column
  12. *
  13. * @method CcPlayoutHistoryQuery groupByDbId() Group by the id column
  14. * @method CcPlayoutHistoryQuery groupByDbFileId() Group by the file_id column
  15. * @method CcPlayoutHistoryQuery groupByDbStarts() Group by the starts column
  16. * @method CcPlayoutHistoryQuery groupByDbEnds() Group by the ends column
  17. * @method CcPlayoutHistoryQuery groupByDbInstanceId() Group by the instance_id column
  18. *
  19. * @method CcPlayoutHistoryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  20. * @method CcPlayoutHistoryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  21. * @method CcPlayoutHistoryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  22. *
  23. * @method CcPlayoutHistoryQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
  24. * @method CcPlayoutHistoryQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
  25. * @method CcPlayoutHistoryQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
  26. *
  27. * @method CcPlayoutHistoryQuery leftJoinCcShowInstances($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowInstances relation
  28. * @method CcPlayoutHistoryQuery rightJoinCcShowInstances($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowInstances relation
  29. * @method CcPlayoutHistoryQuery innerJoinCcShowInstances($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowInstances relation
  30. *
  31. * @method CcPlayoutHistoryQuery leftJoinCcPlayoutHistoryMetaData($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlayoutHistoryMetaData relation
  32. * @method CcPlayoutHistoryQuery rightJoinCcPlayoutHistoryMetaData($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlayoutHistoryMetaData relation
  33. * @method CcPlayoutHistoryQuery innerJoinCcPlayoutHistoryMetaData($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlayoutHistoryMetaData relation
  34. *
  35. * @method CcPlayoutHistory findOne(PropelPDO $con = null) Return the first CcPlayoutHistory matching the query
  36. * @method CcPlayoutHistory findOneOrCreate(PropelPDO $con = null) Return the first CcPlayoutHistory matching the query, or a new CcPlayoutHistory object populated from the query conditions when no match is found
  37. *
  38. * @method CcPlayoutHistory findOneByDbId(int $id) Return the first CcPlayoutHistory filtered by the id column
  39. * @method CcPlayoutHistory findOneByDbFileId(int $file_id) Return the first CcPlayoutHistory filtered by the file_id column
  40. * @method CcPlayoutHistory findOneByDbStarts(string $starts) Return the first CcPlayoutHistory filtered by the starts column
  41. * @method CcPlayoutHistory findOneByDbEnds(string $ends) Return the first CcPlayoutHistory filtered by the ends column
  42. * @method CcPlayoutHistory findOneByDbInstanceId(int $instance_id) Return the first CcPlayoutHistory filtered by the instance_id column
  43. *
  44. * @method array findByDbId(int $id) Return CcPlayoutHistory objects filtered by the id column
  45. * @method array findByDbFileId(int $file_id) Return CcPlayoutHistory objects filtered by the file_id column
  46. * @method array findByDbStarts(string $starts) Return CcPlayoutHistory objects filtered by the starts column
  47. * @method array findByDbEnds(string $ends) Return CcPlayoutHistory objects filtered by the ends column
  48. * @method array findByDbInstanceId(int $instance_id) Return CcPlayoutHistory objects filtered by the instance_id column
  49. *
  50. * @package propel.generator.airtime.om
  51. */
  52. abstract class BaseCcPlayoutHistoryQuery extends ModelCriteria
  53. {
  54. /**
  55. * Initializes internal state of BaseCcPlayoutHistoryQuery object.
  56. *
  57. * @param string $dbName The dabase name
  58. * @param string $modelName The phpName of a model, e.g. 'Book'
  59. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  60. */
  61. public function __construct($dbName = 'airtime', $modelName = 'CcPlayoutHistory', $modelAlias = null)
  62. {
  63. parent::__construct($dbName, $modelName, $modelAlias);
  64. }
  65. /**
  66. * Returns a new CcPlayoutHistoryQuery object.
  67. *
  68. * @param string $modelAlias The alias of a model in the query
  69. * @param Criteria $criteria Optional Criteria to build the query from
  70. *
  71. * @return CcPlayoutHistoryQuery
  72. */
  73. public static function create($modelAlias = null, $criteria = null)
  74. {
  75. if ($criteria instanceof CcPlayoutHistoryQuery) {
  76. return $criteria;
  77. }
  78. $query = new CcPlayoutHistoryQuery();
  79. if (null !== $modelAlias) {
  80. $query->setModelAlias($modelAlias);
  81. }
  82. if ($criteria instanceof Criteria) {
  83. $query->mergeWith($criteria);
  84. }
  85. return $query;
  86. }
  87. /**
  88. * Find object by primary key
  89. * Use instance pooling to avoid a database query if the object exists
  90. * <code>
  91. * $obj = $c->findPk(12, $con);
  92. * </code>
  93. * @param mixed $key Primary key to use for the query
  94. * @param PropelPDO $con an optional connection object
  95. *
  96. * @return CcPlayoutHistory|array|mixed the result, formatted by the current formatter
  97. */
  98. public function findPk($key, $con = null)
  99. {
  100. if ((null !== ($obj = CcPlayoutHistoryPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  101. // the object is alredy in the instance pool
  102. return $obj;
  103. } else {
  104. // the object has not been requested yet, or the formatter is not an object formatter
  105. $criteria = $this->isKeepQuery() ? clone $this : $this;
  106. $stmt = $criteria
  107. ->filterByPrimaryKey($key)
  108. ->getSelectStatement($con);
  109. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  110. }
  111. }
  112. /**
  113. * Find objects by primary key
  114. * <code>
  115. * $objs = $c->findPks(array(12, 56, 832), $con);
  116. * </code>
  117. * @param array $keys Primary keys to use for the query
  118. * @param PropelPDO $con an optional connection object
  119. *
  120. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  121. */
  122. public function findPks($keys, $con = null)
  123. {
  124. $criteria = $this->isKeepQuery() ? clone $this : $this;
  125. return $this
  126. ->filterByPrimaryKeys($keys)
  127. ->find($con);
  128. }
  129. /**
  130. * Filter the query by primary key
  131. *
  132. * @param mixed $key Primary key to use for the query
  133. *
  134. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  135. */
  136. public function filterByPrimaryKey($key)
  137. {
  138. return $this->addUsingAlias(CcPlayoutHistoryPeer::ID, $key, Criteria::EQUAL);
  139. }
  140. /**
  141. * Filter the query by a list of primary keys
  142. *
  143. * @param array $keys The list of primary key to use for the query
  144. *
  145. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  146. */
  147. public function filterByPrimaryKeys($keys)
  148. {
  149. return $this->addUsingAlias(CcPlayoutHistoryPeer::ID, $keys, Criteria::IN);
  150. }
  151. /**
  152. * Filter the query on the id column
  153. *
  154. * @param int|array $dbId The value to use as filter.
  155. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  156. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  157. *
  158. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  159. */
  160. public function filterByDbId($dbId = null, $comparison = null)
  161. {
  162. if (is_array($dbId) && null === $comparison) {
  163. $comparison = Criteria::IN;
  164. }
  165. return $this->addUsingAlias(CcPlayoutHistoryPeer::ID, $dbId, $comparison);
  166. }
  167. /**
  168. * Filter the query on the file_id column
  169. *
  170. * @param int|array $dbFileId The value to use as filter.
  171. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  172. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  173. *
  174. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  175. */
  176. public function filterByDbFileId($dbFileId = null, $comparison = null)
  177. {
  178. if (is_array($dbFileId)) {
  179. $useMinMax = false;
  180. if (isset($dbFileId['min'])) {
  181. $this->addUsingAlias(CcPlayoutHistoryPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL);
  182. $useMinMax = true;
  183. }
  184. if (isset($dbFileId['max'])) {
  185. $this->addUsingAlias(CcPlayoutHistoryPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL);
  186. $useMinMax = true;
  187. }
  188. if ($useMinMax) {
  189. return $this;
  190. }
  191. if (null === $comparison) {
  192. $comparison = Criteria::IN;
  193. }
  194. }
  195. return $this->addUsingAlias(CcPlayoutHistoryPeer::FILE_ID, $dbFileId, $comparison);
  196. }
  197. /**
  198. * Filter the query on the starts column
  199. *
  200. * @param string|array $dbStarts The value to use as filter.
  201. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  202. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  203. *
  204. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  205. */
  206. public function filterByDbStarts($dbStarts = null, $comparison = null)
  207. {
  208. if (is_array($dbStarts)) {
  209. $useMinMax = false;
  210. if (isset($dbStarts['min'])) {
  211. $this->addUsingAlias(CcPlayoutHistoryPeer::STARTS, $dbStarts['min'], Criteria::GREATER_EQUAL);
  212. $useMinMax = true;
  213. }
  214. if (isset($dbStarts['max'])) {
  215. $this->addUsingAlias(CcPlayoutHistoryPeer::STARTS, $dbStarts['max'], Criteria::LESS_EQUAL);
  216. $useMinMax = true;
  217. }
  218. if ($useMinMax) {
  219. return $this;
  220. }
  221. if (null === $comparison) {
  222. $comparison = Criteria::IN;
  223. }
  224. }
  225. return $this->addUsingAlias(CcPlayoutHistoryPeer::STARTS, $dbStarts, $comparison);
  226. }
  227. /**
  228. * Filter the query on the ends column
  229. *
  230. * @param string|array $dbEnds The value to use as filter.
  231. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  232. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  233. *
  234. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  235. */
  236. public function filterByDbEnds($dbEnds = null, $comparison = null)
  237. {
  238. if (is_array($dbEnds)) {
  239. $useMinMax = false;
  240. if (isset($dbEnds['min'])) {
  241. $this->addUsingAlias(CcPlayoutHistoryPeer::ENDS, $dbEnds['min'], Criteria::GREATER_EQUAL);
  242. $useMinMax = true;
  243. }
  244. if (isset($dbEnds['max'])) {
  245. $this->addUsingAlias(CcPlayoutHistoryPeer::ENDS, $dbEnds['max'], Criteria::LESS_EQUAL);
  246. $useMinMax = true;
  247. }
  248. if ($useMinMax) {
  249. return $this;
  250. }
  251. if (null === $comparison) {
  252. $comparison = Criteria::IN;
  253. }
  254. }
  255. return $this->addUsingAlias(CcPlayoutHistoryPeer::ENDS, $dbEnds, $comparison);
  256. }
  257. /**
  258. * Filter the query on the instance_id column
  259. *
  260. * @param int|array $dbInstanceId The value to use as filter.
  261. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  262. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  263. *
  264. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  265. */
  266. public function filterByDbInstanceId($dbInstanceId = null, $comparison = null)
  267. {
  268. if (is_array($dbInstanceId)) {
  269. $useMinMax = false;
  270. if (isset($dbInstanceId['min'])) {
  271. $this->addUsingAlias(CcPlayoutHistoryPeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL);
  272. $useMinMax = true;
  273. }
  274. if (isset($dbInstanceId['max'])) {
  275. $this->addUsingAlias(CcPlayoutHistoryPeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL);
  276. $useMinMax = true;
  277. }
  278. if ($useMinMax) {
  279. return $this;
  280. }
  281. if (null === $comparison) {
  282. $comparison = Criteria::IN;
  283. }
  284. }
  285. return $this->addUsingAlias(CcPlayoutHistoryPeer::INSTANCE_ID, $dbInstanceId, $comparison);
  286. }
  287. /**
  288. * Filter the query by a related CcFiles object
  289. *
  290. * @param CcFiles $ccFiles the related object to use as filter
  291. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  292. *
  293. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  294. */
  295. public function filterByCcFiles($ccFiles, $comparison = null)
  296. {
  297. return $this
  298. ->addUsingAlias(CcPlayoutHistoryPeer::FILE_ID, $ccFiles->getDbId(), $comparison);
  299. }
  300. /**
  301. * Adds a JOIN clause to the query using the CcFiles relation
  302. *
  303. * @param string $relationAlias optional alias for the relation
  304. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  305. *
  306. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  307. */
  308. public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  309. {
  310. $tableMap = $this->getTableMap();
  311. $relationMap = $tableMap->getRelation('CcFiles');
  312. // create a ModelJoin object for this join
  313. $join = new ModelJoin();
  314. $join->setJoinType($joinType);
  315. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  316. if ($previousJoin = $this->getPreviousJoin()) {
  317. $join->setPreviousJoin($previousJoin);
  318. }
  319. // add the ModelJoin to the current object
  320. if($relationAlias) {
  321. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  322. $this->addJoinObject($join, $relationAlias);
  323. } else {
  324. $this->addJoinObject($join, 'CcFiles');
  325. }
  326. return $this;
  327. }
  328. /**
  329. * Use the CcFiles relation CcFiles object
  330. *
  331. * @see useQuery()
  332. *
  333. * @param string $relationAlias optional alias for the relation,
  334. * to be used as main alias in the secondary query
  335. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  336. *
  337. * @return CcFilesQuery A secondary query class using the current class as primary query
  338. */
  339. public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  340. {
  341. return $this
  342. ->joinCcFiles($relationAlias, $joinType)
  343. ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
  344. }
  345. /**
  346. * Filter the query by a related CcShowInstances object
  347. *
  348. * @param CcShowInstances $ccShowInstances the related object to use as filter
  349. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  350. *
  351. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  352. */
  353. public function filterByCcShowInstances($ccShowInstances, $comparison = null)
  354. {
  355. return $this
  356. ->addUsingAlias(CcPlayoutHistoryPeer::INSTANCE_ID, $ccShowInstances->getDbId(), $comparison);
  357. }
  358. /**
  359. * Adds a JOIN clause to the query using the CcShowInstances relation
  360. *
  361. * @param string $relationAlias optional alias for the relation
  362. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  363. *
  364. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  365. */
  366. public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  367. {
  368. $tableMap = $this->getTableMap();
  369. $relationMap = $tableMap->getRelation('CcShowInstances');
  370. // create a ModelJoin object for this join
  371. $join = new ModelJoin();
  372. $join->setJoinType($joinType);
  373. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  374. if ($previousJoin = $this->getPreviousJoin()) {
  375. $join->setPreviousJoin($previousJoin);
  376. }
  377. // add the ModelJoin to the current object
  378. if($relationAlias) {
  379. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  380. $this->addJoinObject($join, $relationAlias);
  381. } else {
  382. $this->addJoinObject($join, 'CcShowInstances');
  383. }
  384. return $this;
  385. }
  386. /**
  387. * Use the CcShowInstances relation CcShowInstances object
  388. *
  389. * @see useQuery()
  390. *
  391. * @param string $relationAlias optional alias for the relation,
  392. * to be used as main alias in the secondary query
  393. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  394. *
  395. * @return CcShowInstancesQuery A secondary query class using the current class as primary query
  396. */
  397. public function useCcShowInstancesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  398. {
  399. return $this
  400. ->joinCcShowInstances($relationAlias, $joinType)
  401. ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery');
  402. }
  403. /**
  404. * Filter the query by a related CcPlayoutHistoryMetaData object
  405. *
  406. * @param CcPlayoutHistoryMetaData $ccPlayoutHistoryMetaData the related object to use as filter
  407. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  408. *
  409. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  410. */
  411. public function filterByCcPlayoutHistoryMetaData($ccPlayoutHistoryMetaData, $comparison = null)
  412. {
  413. return $this
  414. ->addUsingAlias(CcPlayoutHistoryPeer::ID, $ccPlayoutHistoryMetaData->getDbHistoryId(), $comparison);
  415. }
  416. /**
  417. * Adds a JOIN clause to the query using the CcPlayoutHistoryMetaData relation
  418. *
  419. * @param string $relationAlias optional alias for the relation
  420. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  421. *
  422. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  423. */
  424. public function joinCcPlayoutHistoryMetaData($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  425. {
  426. $tableMap = $this->getTableMap();
  427. $relationMap = $tableMap->getRelation('CcPlayoutHistoryMetaData');
  428. // create a ModelJoin object for this join
  429. $join = new ModelJoin();
  430. $join->setJoinType($joinType);
  431. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  432. if ($previousJoin = $this->getPreviousJoin()) {
  433. $join->setPreviousJoin($previousJoin);
  434. }
  435. // add the ModelJoin to the current object
  436. if($relationAlias) {
  437. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  438. $this->addJoinObject($join, $relationAlias);
  439. } else {
  440. $this->addJoinObject($join, 'CcPlayoutHistoryMetaData');
  441. }
  442. return $this;
  443. }
  444. /**
  445. * Use the CcPlayoutHistoryMetaData relation CcPlayoutHistoryMetaData object
  446. *
  447. * @see useQuery()
  448. *
  449. * @param string $relationAlias optional alias for the relation,
  450. * to be used as main alias in the secondary query
  451. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  452. *
  453. * @return CcPlayoutHistoryMetaDataQuery A secondary query class using the current class as primary query
  454. */
  455. public function useCcPlayoutHistoryMetaDataQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  456. {
  457. return $this
  458. ->joinCcPlayoutHistoryMetaData($relationAlias, $joinType)
  459. ->useQuery($relationAlias ? $relationAlias : 'CcPlayoutHistoryMetaData', 'CcPlayoutHistoryMetaDataQuery');
  460. }
  461. /**
  462. * Exclude object from result
  463. *
  464. * @param CcPlayoutHistory $ccPlayoutHistory Object to remove from the list of results
  465. *
  466. * @return CcPlayoutHistoryQuery The current query, for fluid interface
  467. */
  468. public function prune($ccPlayoutHistory = null)
  469. {
  470. if ($ccPlayoutHistory) {
  471. $this->addUsingAlias(CcPlayoutHistoryPeer::ID, $ccPlayoutHistory->getDbId(), Criteria::NOT_EQUAL);
  472. }
  473. return $this;
  474. }
  475. } // BaseCcPlayoutHistoryQuery