BaseCcBlockcontentsQuery.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_blockcontents' table.
  4. *
  5. *
  6. *
  7. * @method CcBlockcontentsQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcBlockcontentsQuery orderByDbBlockId($order = Criteria::ASC) Order by the block_id column
  9. * @method CcBlockcontentsQuery orderByDbFileId($order = Criteria::ASC) Order by the file_id column
  10. * @method CcBlockcontentsQuery orderByDbPosition($order = Criteria::ASC) Order by the position column
  11. * @method CcBlockcontentsQuery orderByDbTrackOffset($order = Criteria::ASC) Order by the trackoffset column
  12. * @method CcBlockcontentsQuery orderByDbCliplength($order = Criteria::ASC) Order by the cliplength column
  13. * @method CcBlockcontentsQuery orderByDbCuein($order = Criteria::ASC) Order by the cuein column
  14. * @method CcBlockcontentsQuery orderByDbCueout($order = Criteria::ASC) Order by the cueout column
  15. * @method CcBlockcontentsQuery orderByDbFadein($order = Criteria::ASC) Order by the fadein column
  16. * @method CcBlockcontentsQuery orderByDbFadeout($order = Criteria::ASC) Order by the fadeout column
  17. *
  18. * @method CcBlockcontentsQuery groupByDbId() Group by the id column
  19. * @method CcBlockcontentsQuery groupByDbBlockId() Group by the block_id column
  20. * @method CcBlockcontentsQuery groupByDbFileId() Group by the file_id column
  21. * @method CcBlockcontentsQuery groupByDbPosition() Group by the position column
  22. * @method CcBlockcontentsQuery groupByDbTrackOffset() Group by the trackoffset column
  23. * @method CcBlockcontentsQuery groupByDbCliplength() Group by the cliplength column
  24. * @method CcBlockcontentsQuery groupByDbCuein() Group by the cuein column
  25. * @method CcBlockcontentsQuery groupByDbCueout() Group by the cueout column
  26. * @method CcBlockcontentsQuery groupByDbFadein() Group by the fadein column
  27. * @method CcBlockcontentsQuery groupByDbFadeout() Group by the fadeout column
  28. *
  29. * @method CcBlockcontentsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  30. * @method CcBlockcontentsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  31. * @method CcBlockcontentsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  32. *
  33. * @method CcBlockcontentsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
  34. * @method CcBlockcontentsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
  35. * @method CcBlockcontentsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
  36. *
  37. * @method CcBlockcontentsQuery leftJoinCcBlock($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlock relation
  38. * @method CcBlockcontentsQuery rightJoinCcBlock($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlock relation
  39. * @method CcBlockcontentsQuery innerJoinCcBlock($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlock relation
  40. *
  41. * @method CcBlockcontents findOne(PropelPDO $con = null) Return the first CcBlockcontents matching the query
  42. * @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
  43. *
  44. * @method CcBlockcontents findOneByDbId(int $id) Return the first CcBlockcontents filtered by the id column
  45. * @method CcBlockcontents findOneByDbBlockId(int $block_id) Return the first CcBlockcontents filtered by the block_id column
  46. * @method CcBlockcontents findOneByDbFileId(int $file_id) Return the first CcBlockcontents filtered by the file_id column
  47. * @method CcBlockcontents findOneByDbPosition(int $position) Return the first CcBlockcontents filtered by the position column
  48. * @method CcBlockcontents findOneByDbTrackOffset(double $trackoffset) Return the first CcBlockcontents filtered by the trackoffset column
  49. * @method CcBlockcontents findOneByDbCliplength(string $cliplength) Return the first CcBlockcontents filtered by the cliplength column
  50. * @method CcBlockcontents findOneByDbCuein(string $cuein) Return the first CcBlockcontents filtered by the cuein column
  51. * @method CcBlockcontents findOneByDbCueout(string $cueout) Return the first CcBlockcontents filtered by the cueout column
  52. * @method CcBlockcontents findOneByDbFadein(string $fadein) Return the first CcBlockcontents filtered by the fadein column
  53. * @method CcBlockcontents findOneByDbFadeout(string $fadeout) Return the first CcBlockcontents filtered by the fadeout column
  54. *
  55. * @method array findByDbId(int $id) Return CcBlockcontents objects filtered by the id column
  56. * @method array findByDbBlockId(int $block_id) Return CcBlockcontents objects filtered by the block_id column
  57. * @method array findByDbFileId(int $file_id) Return CcBlockcontents objects filtered by the file_id column
  58. * @method array findByDbPosition(int $position) Return CcBlockcontents objects filtered by the position column
  59. * @method array findByDbTrackOffset(double $trackoffset) Return CcBlockcontents objects filtered by the trackoffset column
  60. * @method array findByDbCliplength(string $cliplength) Return CcBlockcontents objects filtered by the cliplength column
  61. * @method array findByDbCuein(string $cuein) Return CcBlockcontents objects filtered by the cuein column
  62. * @method array findByDbCueout(string $cueout) Return CcBlockcontents objects filtered by the cueout column
  63. * @method array findByDbFadein(string $fadein) Return CcBlockcontents objects filtered by the fadein column
  64. * @method array findByDbFadeout(string $fadeout) Return CcBlockcontents objects filtered by the fadeout column
  65. *
  66. * @package propel.generator.airtime.om
  67. */
  68. abstract class BaseCcBlockcontentsQuery extends ModelCriteria
  69. {
  70. /**
  71. * Initializes internal state of BaseCcBlockcontentsQuery object.
  72. *
  73. * @param string $dbName The dabase name
  74. * @param string $modelName The phpName of a model, e.g. 'Book'
  75. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  76. */
  77. public function __construct($dbName = 'airtime', $modelName = 'CcBlockcontents', $modelAlias = null)
  78. {
  79. parent::__construct($dbName, $modelName, $modelAlias);
  80. }
  81. /**
  82. * Returns a new CcBlockcontentsQuery object.
  83. *
  84. * @param string $modelAlias The alias of a model in the query
  85. * @param Criteria $criteria Optional Criteria to build the query from
  86. *
  87. * @return CcBlockcontentsQuery
  88. */
  89. public static function create($modelAlias = null, $criteria = null)
  90. {
  91. if ($criteria instanceof CcBlockcontentsQuery) {
  92. return $criteria;
  93. }
  94. $query = new CcBlockcontentsQuery();
  95. if (null !== $modelAlias) {
  96. $query->setModelAlias($modelAlias);
  97. }
  98. if ($criteria instanceof Criteria) {
  99. $query->mergeWith($criteria);
  100. }
  101. return $query;
  102. }
  103. /**
  104. * Find object by primary key
  105. * Use instance pooling to avoid a database query if the object exists
  106. * <code>
  107. * $obj = $c->findPk(12, $con);
  108. * </code>
  109. * @param mixed $key Primary key to use for the query
  110. * @param PropelPDO $con an optional connection object
  111. *
  112. * @return CcBlockcontents|array|mixed the result, formatted by the current formatter
  113. */
  114. public function findPk($key, $con = null)
  115. {
  116. if ((null !== ($obj = CcBlockcontentsPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  117. // the object is alredy in the instance pool
  118. return $obj;
  119. } else {
  120. // the object has not been requested yet, or the formatter is not an object formatter
  121. $criteria = $this->isKeepQuery() ? clone $this : $this;
  122. $stmt = $criteria
  123. ->filterByPrimaryKey($key)
  124. ->getSelectStatement($con);
  125. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  126. }
  127. }
  128. /**
  129. * Find objects by primary key
  130. * <code>
  131. * $objs = $c->findPks(array(12, 56, 832), $con);
  132. * </code>
  133. * @param array $keys Primary keys to use for the query
  134. * @param PropelPDO $con an optional connection object
  135. *
  136. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  137. */
  138. public function findPks($keys, $con = null)
  139. {
  140. $criteria = $this->isKeepQuery() ? clone $this : $this;
  141. return $this
  142. ->filterByPrimaryKeys($keys)
  143. ->find($con);
  144. }
  145. /**
  146. * Filter the query by primary key
  147. *
  148. * @param mixed $key Primary key to use for the query
  149. *
  150. * @return CcBlockcontentsQuery The current query, for fluid interface
  151. */
  152. public function filterByPrimaryKey($key)
  153. {
  154. return $this->addUsingAlias(CcBlockcontentsPeer::ID, $key, Criteria::EQUAL);
  155. }
  156. /**
  157. * Filter the query by a list of primary keys
  158. *
  159. * @param array $keys The list of primary key to use for the query
  160. *
  161. * @return CcBlockcontentsQuery The current query, for fluid interface
  162. */
  163. public function filterByPrimaryKeys($keys)
  164. {
  165. return $this->addUsingAlias(CcBlockcontentsPeer::ID, $keys, Criteria::IN);
  166. }
  167. /**
  168. * Filter the query on the id column
  169. *
  170. * @param int|array $dbId 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 CcBlockcontentsQuery The current query, for fluid interface
  175. */
  176. public function filterByDbId($dbId = null, $comparison = null)
  177. {
  178. if (is_array($dbId) && null === $comparison) {
  179. $comparison = Criteria::IN;
  180. }
  181. return $this->addUsingAlias(CcBlockcontentsPeer::ID, $dbId, $comparison);
  182. }
  183. /**
  184. * Filter the query on the block_id column
  185. *
  186. * @param int|array $dbBlockId The value to use as filter.
  187. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  188. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  189. *
  190. * @return CcBlockcontentsQuery The current query, for fluid interface
  191. */
  192. public function filterByDbBlockId($dbBlockId = null, $comparison = null)
  193. {
  194. if (is_array($dbBlockId)) {
  195. $useMinMax = false;
  196. if (isset($dbBlockId['min'])) {
  197. $this->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL);
  198. $useMinMax = true;
  199. }
  200. if (isset($dbBlockId['max'])) {
  201. $this->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL);
  202. $useMinMax = true;
  203. }
  204. if ($useMinMax) {
  205. return $this;
  206. }
  207. if (null === $comparison) {
  208. $comparison = Criteria::IN;
  209. }
  210. }
  211. return $this->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $dbBlockId, $comparison);
  212. }
  213. /**
  214. * Filter the query on the file_id column
  215. *
  216. * @param int|array $dbFileId The value to use as filter.
  217. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  218. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  219. *
  220. * @return CcBlockcontentsQuery The current query, for fluid interface
  221. */
  222. public function filterByDbFileId($dbFileId = null, $comparison = null)
  223. {
  224. if (is_array($dbFileId)) {
  225. $useMinMax = false;
  226. if (isset($dbFileId['min'])) {
  227. $this->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL);
  228. $useMinMax = true;
  229. }
  230. if (isset($dbFileId['max'])) {
  231. $this->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL);
  232. $useMinMax = true;
  233. }
  234. if ($useMinMax) {
  235. return $this;
  236. }
  237. if (null === $comparison) {
  238. $comparison = Criteria::IN;
  239. }
  240. }
  241. return $this->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $dbFileId, $comparison);
  242. }
  243. /**
  244. * Filter the query on the position column
  245. *
  246. * @param int|array $dbPosition The value to use as filter.
  247. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  248. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  249. *
  250. * @return CcBlockcontentsQuery The current query, for fluid interface
  251. */
  252. public function filterByDbPosition($dbPosition = null, $comparison = null)
  253. {
  254. if (is_array($dbPosition)) {
  255. $useMinMax = false;
  256. if (isset($dbPosition['min'])) {
  257. $this->addUsingAlias(CcBlockcontentsPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL);
  258. $useMinMax = true;
  259. }
  260. if (isset($dbPosition['max'])) {
  261. $this->addUsingAlias(CcBlockcontentsPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL);
  262. $useMinMax = true;
  263. }
  264. if ($useMinMax) {
  265. return $this;
  266. }
  267. if (null === $comparison) {
  268. $comparison = Criteria::IN;
  269. }
  270. }
  271. return $this->addUsingAlias(CcBlockcontentsPeer::POSITION, $dbPosition, $comparison);
  272. }
  273. /**
  274. * Filter the query on the trackoffset column
  275. *
  276. * @param double|array $dbTrackOffset The value to use as filter.
  277. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  278. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  279. *
  280. * @return CcBlockcontentsQuery The current query, for fluid interface
  281. */
  282. public function filterByDbTrackOffset($dbTrackOffset = null, $comparison = null)
  283. {
  284. if (is_array($dbTrackOffset)) {
  285. $useMinMax = false;
  286. if (isset($dbTrackOffset['min'])) {
  287. $this->addUsingAlias(CcBlockcontentsPeer::TRACKOFFSET, $dbTrackOffset['min'], Criteria::GREATER_EQUAL);
  288. $useMinMax = true;
  289. }
  290. if (isset($dbTrackOffset['max'])) {
  291. $this->addUsingAlias(CcBlockcontentsPeer::TRACKOFFSET, $dbTrackOffset['max'], Criteria::LESS_EQUAL);
  292. $useMinMax = true;
  293. }
  294. if ($useMinMax) {
  295. return $this;
  296. }
  297. if (null === $comparison) {
  298. $comparison = Criteria::IN;
  299. }
  300. }
  301. return $this->addUsingAlias(CcBlockcontentsPeer::TRACKOFFSET, $dbTrackOffset, $comparison);
  302. }
  303. /**
  304. * Filter the query on the cliplength column
  305. *
  306. * @param string $dbCliplength The value to use as filter.
  307. * Accepts wildcards (* and % trigger a LIKE)
  308. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  309. *
  310. * @return CcBlockcontentsQuery The current query, for fluid interface
  311. */
  312. public function filterByDbCliplength($dbCliplength = null, $comparison = null)
  313. {
  314. if (null === $comparison) {
  315. if (is_array($dbCliplength)) {
  316. $comparison = Criteria::IN;
  317. } elseif (preg_match('/[\%\*]/', $dbCliplength)) {
  318. $dbCliplength = str_replace('*', '%', $dbCliplength);
  319. $comparison = Criteria::LIKE;
  320. }
  321. }
  322. return $this->addUsingAlias(CcBlockcontentsPeer::CLIPLENGTH, $dbCliplength, $comparison);
  323. }
  324. /**
  325. * Filter the query on the cuein column
  326. *
  327. * @param string $dbCuein The value to use as filter.
  328. * Accepts wildcards (* and % trigger a LIKE)
  329. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  330. *
  331. * @return CcBlockcontentsQuery The current query, for fluid interface
  332. */
  333. public function filterByDbCuein($dbCuein = null, $comparison = null)
  334. {
  335. if (null === $comparison) {
  336. if (is_array($dbCuein)) {
  337. $comparison = Criteria::IN;
  338. } elseif (preg_match('/[\%\*]/', $dbCuein)) {
  339. $dbCuein = str_replace('*', '%', $dbCuein);
  340. $comparison = Criteria::LIKE;
  341. }
  342. }
  343. return $this->addUsingAlias(CcBlockcontentsPeer::CUEIN, $dbCuein, $comparison);
  344. }
  345. /**
  346. * Filter the query on the cueout column
  347. *
  348. * @param string $dbCueout The value to use as filter.
  349. * Accepts wildcards (* and % trigger a LIKE)
  350. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  351. *
  352. * @return CcBlockcontentsQuery The current query, for fluid interface
  353. */
  354. public function filterByDbCueout($dbCueout = null, $comparison = null)
  355. {
  356. if (null === $comparison) {
  357. if (is_array($dbCueout)) {
  358. $comparison = Criteria::IN;
  359. } elseif (preg_match('/[\%\*]/', $dbCueout)) {
  360. $dbCueout = str_replace('*', '%', $dbCueout);
  361. $comparison = Criteria::LIKE;
  362. }
  363. }
  364. return $this->addUsingAlias(CcBlockcontentsPeer::CUEOUT, $dbCueout, $comparison);
  365. }
  366. /**
  367. * Filter the query on the fadein column
  368. *
  369. * @param string|array $dbFadein The value to use as filter.
  370. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  371. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  372. *
  373. * @return CcBlockcontentsQuery The current query, for fluid interface
  374. */
  375. public function filterByDbFadein($dbFadein = null, $comparison = null)
  376. {
  377. if (is_array($dbFadein)) {
  378. $useMinMax = false;
  379. if (isset($dbFadein['min'])) {
  380. $this->addUsingAlias(CcBlockcontentsPeer::FADEIN, $dbFadein['min'], Criteria::GREATER_EQUAL);
  381. $useMinMax = true;
  382. }
  383. if (isset($dbFadein['max'])) {
  384. $this->addUsingAlias(CcBlockcontentsPeer::FADEIN, $dbFadein['max'], Criteria::LESS_EQUAL);
  385. $useMinMax = true;
  386. }
  387. if ($useMinMax) {
  388. return $this;
  389. }
  390. if (null === $comparison) {
  391. $comparison = Criteria::IN;
  392. }
  393. }
  394. return $this->addUsingAlias(CcBlockcontentsPeer::FADEIN, $dbFadein, $comparison);
  395. }
  396. /**
  397. * Filter the query on the fadeout column
  398. *
  399. * @param string|array $dbFadeout The value to use as filter.
  400. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  401. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  402. *
  403. * @return CcBlockcontentsQuery The current query, for fluid interface
  404. */
  405. public function filterByDbFadeout($dbFadeout = null, $comparison = null)
  406. {
  407. if (is_array($dbFadeout)) {
  408. $useMinMax = false;
  409. if (isset($dbFadeout['min'])) {
  410. $this->addUsingAlias(CcBlockcontentsPeer::FADEOUT, $dbFadeout['min'], Criteria::GREATER_EQUAL);
  411. $useMinMax = true;
  412. }
  413. if (isset($dbFadeout['max'])) {
  414. $this->addUsingAlias(CcBlockcontentsPeer::FADEOUT, $dbFadeout['max'], Criteria::LESS_EQUAL);
  415. $useMinMax = true;
  416. }
  417. if ($useMinMax) {
  418. return $this;
  419. }
  420. if (null === $comparison) {
  421. $comparison = Criteria::IN;
  422. }
  423. }
  424. return $this->addUsingAlias(CcBlockcontentsPeer::FADEOUT, $dbFadeout, $comparison);
  425. }
  426. /**
  427. * Filter the query by a related CcFiles object
  428. *
  429. * @param CcFiles $ccFiles the related object to use as filter
  430. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  431. *
  432. * @return CcBlockcontentsQuery The current query, for fluid interface
  433. */
  434. public function filterByCcFiles($ccFiles, $comparison = null)
  435. {
  436. return $this
  437. ->addUsingAlias(CcBlockcontentsPeer::FILE_ID, $ccFiles->getDbId(), $comparison);
  438. }
  439. /**
  440. * Adds a JOIN clause to the query using the CcFiles relation
  441. *
  442. * @param string $relationAlias optional alias for the relation
  443. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  444. *
  445. * @return CcBlockcontentsQuery The current query, for fluid interface
  446. */
  447. public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  448. {
  449. $tableMap = $this->getTableMap();
  450. $relationMap = $tableMap->getRelation('CcFiles');
  451. // create a ModelJoin object for this join
  452. $join = new ModelJoin();
  453. $join->setJoinType($joinType);
  454. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  455. if ($previousJoin = $this->getPreviousJoin()) {
  456. $join->setPreviousJoin($previousJoin);
  457. }
  458. // add the ModelJoin to the current object
  459. if($relationAlias) {
  460. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  461. $this->addJoinObject($join, $relationAlias);
  462. } else {
  463. $this->addJoinObject($join, 'CcFiles');
  464. }
  465. return $this;
  466. }
  467. /**
  468. * Use the CcFiles relation CcFiles object
  469. *
  470. * @see useQuery()
  471. *
  472. * @param string $relationAlias optional alias for the relation,
  473. * to be used as main alias in the secondary query
  474. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  475. *
  476. * @return CcFilesQuery A secondary query class using the current class as primary query
  477. */
  478. public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  479. {
  480. return $this
  481. ->joinCcFiles($relationAlias, $joinType)
  482. ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
  483. }
  484. /**
  485. * Filter the query by a related CcBlock object
  486. *
  487. * @param CcBlock $ccBlock the related object to use as filter
  488. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  489. *
  490. * @return CcBlockcontentsQuery The current query, for fluid interface
  491. */
  492. public function filterByCcBlock($ccBlock, $comparison = null)
  493. {
  494. return $this
  495. ->addUsingAlias(CcBlockcontentsPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison);
  496. }
  497. /**
  498. * Adds a JOIN clause to the query using the CcBlock relation
  499. *
  500. * @param string $relationAlias optional alias for the relation
  501. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  502. *
  503. * @return CcBlockcontentsQuery The current query, for fluid interface
  504. */
  505. public function joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  506. {
  507. $tableMap = $this->getTableMap();
  508. $relationMap = $tableMap->getRelation('CcBlock');
  509. // create a ModelJoin object for this join
  510. $join = new ModelJoin();
  511. $join->setJoinType($joinType);
  512. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  513. if ($previousJoin = $this->getPreviousJoin()) {
  514. $join->setPreviousJoin($previousJoin);
  515. }
  516. // add the ModelJoin to the current object
  517. if($relationAlias) {
  518. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  519. $this->addJoinObject($join, $relationAlias);
  520. } else {
  521. $this->addJoinObject($join, 'CcBlock');
  522. }
  523. return $this;
  524. }
  525. /**
  526. * Use the CcBlock relation CcBlock object
  527. *
  528. * @see useQuery()
  529. *
  530. * @param string $relationAlias optional alias for the relation,
  531. * to be used as main alias in the secondary query
  532. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  533. *
  534. * @return CcBlockQuery A secondary query class using the current class as primary query
  535. */
  536. public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  537. {
  538. return $this
  539. ->joinCcBlock($relationAlias, $joinType)
  540. ->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery');
  541. }
  542. /**
  543. * Exclude object from result
  544. *
  545. * @param CcBlockcontents $ccBlockcontents Object to remove from the list of results
  546. *
  547. * @return CcBlockcontentsQuery The current query, for fluid interface
  548. */
  549. public function prune($ccBlockcontents = null)
  550. {
  551. if ($ccBlockcontents) {
  552. $this->addUsingAlias(CcBlockcontentsPeer::ID, $ccBlockcontents->getDbId(), Criteria::NOT_EQUAL);
  553. }
  554. return $this;
  555. }
  556. /**
  557. * Code to execute before every DELETE statement
  558. *
  559. * @param PropelPDO $con The connection object used by the query
  560. */
  561. protected function basePreDelete(PropelPDO $con)
  562. {
  563. // aggregate_column_relation behavior
  564. $this->findRelatedCcBlocks($con);
  565. return $this->preDelete($con);
  566. }
  567. /**
  568. * Code to execute after every DELETE statement
  569. *
  570. * @param int $affectedRows the number of deleted rows
  571. * @param PropelPDO $con The connection object used by the query
  572. */
  573. protected function basePostDelete($affectedRows, PropelPDO $con)
  574. {
  575. // aggregate_column_relation behavior
  576. $this->updateRelatedCcBlocks($con);
  577. return $this->postDelete($affectedRows, $con);
  578. }
  579. /**
  580. * Code to execute before every UPDATE statement
  581. *
  582. * @param array $values The associatiove array of columns and values for the update
  583. * @param PropelPDO $con The connection object used by the query
  584. * @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
  585. */
  586. protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false)
  587. {
  588. // aggregate_column_relation behavior
  589. $this->findRelatedCcBlocks($con);
  590. return $this->preUpdate($values, $con, $forceIndividualSaves);
  591. }
  592. /**
  593. * Code to execute after every UPDATE statement
  594. *
  595. * @param int $affectedRows the number of udated rows
  596. * @param PropelPDO $con The connection object used by the query
  597. */
  598. protected function basePostUpdate($affectedRows, PropelPDO $con)
  599. {
  600. // aggregate_column_relation behavior
  601. $this->updateRelatedCcBlocks($con);
  602. return $this->postUpdate($affectedRows, $con);
  603. }
  604. // aggregate_column_relation behavior
  605. /**
  606. * Finds the related CcBlock objects and keep them for later
  607. *
  608. * @param PropelPDO $con A connection object
  609. */
  610. protected function findRelatedCcBlocks($con)
  611. {
  612. $criteria = clone $this;
  613. if ($this->useAliasInSQL) {
  614. $alias = $this->getModelAlias();
  615. $criteria->removeAlias($alias);
  616. } else {
  617. $alias = '';
  618. }
  619. $this->ccBlocks = CcBlockQuery::create()
  620. ->joinCcBlockcontents($alias)
  621. ->mergeWith($criteria)
  622. ->find($con);
  623. }
  624. protected function updateRelatedCcBlocks($con)
  625. {
  626. foreach ($this->ccBlocks as $ccBlock) {
  627. $ccBlock->updateDbLength($con);
  628. }
  629. $this->ccBlocks = array();
  630. }
  631. } // BaseCcBlockcontentsQuery