BaseCcBlockQuery.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_block' table.
  4. *
  5. *
  6. *
  7. * @method CcBlockQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcBlockQuery orderByDbName($order = Criteria::ASC) Order by the name column
  9. * @method CcBlockQuery orderByDbMtime($order = Criteria::ASC) Order by the mtime column
  10. * @method CcBlockQuery orderByDbUtime($order = Criteria::ASC) Order by the utime column
  11. * @method CcBlockQuery orderByDbCreatorId($order = Criteria::ASC) Order by the creator_id column
  12. * @method CcBlockQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
  13. * @method CcBlockQuery orderByDbLength($order = Criteria::ASC) Order by the length column
  14. * @method CcBlockQuery orderByDbType($order = Criteria::ASC) Order by the type column
  15. *
  16. * @method CcBlockQuery groupByDbId() Group by the id column
  17. * @method CcBlockQuery groupByDbName() Group by the name column
  18. * @method CcBlockQuery groupByDbMtime() Group by the mtime column
  19. * @method CcBlockQuery groupByDbUtime() Group by the utime column
  20. * @method CcBlockQuery groupByDbCreatorId() Group by the creator_id column
  21. * @method CcBlockQuery groupByDbDescription() Group by the description column
  22. * @method CcBlockQuery groupByDbLength() Group by the length column
  23. * @method CcBlockQuery groupByDbType() Group by the type column
  24. *
  25. * @method CcBlockQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  26. * @method CcBlockQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  27. * @method CcBlockQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  28. *
  29. * @method CcBlockQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
  30. * @method CcBlockQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
  31. * @method CcBlockQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
  32. *
  33. * @method CcBlockQuery leftJoinCcPlaylistcontents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlaylistcontents relation
  34. * @method CcBlockQuery rightJoinCcPlaylistcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylistcontents relation
  35. * @method CcBlockQuery innerJoinCcPlaylistcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylistcontents relation
  36. *
  37. * @method CcBlockQuery leftJoinCcBlockcontents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlockcontents relation
  38. * @method CcBlockQuery rightJoinCcBlockcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlockcontents relation
  39. * @method CcBlockQuery innerJoinCcBlockcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlockcontents relation
  40. *
  41. * @method CcBlockQuery leftJoinCcBlockcriteria($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlockcriteria relation
  42. * @method CcBlockQuery rightJoinCcBlockcriteria($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlockcriteria relation
  43. * @method CcBlockQuery innerJoinCcBlockcriteria($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlockcriteria relation
  44. *
  45. * @method CcBlock findOne(PropelPDO $con = null) Return the first CcBlock matching the query
  46. * @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
  47. *
  48. * @method CcBlock findOneByDbId(int $id) Return the first CcBlock filtered by the id column
  49. * @method CcBlock findOneByDbName(string $name) Return the first CcBlock filtered by the name column
  50. * @method CcBlock findOneByDbMtime(string $mtime) Return the first CcBlock filtered by the mtime column
  51. * @method CcBlock findOneByDbUtime(string $utime) Return the first CcBlock filtered by the utime column
  52. * @method CcBlock findOneByDbCreatorId(int $creator_id) Return the first CcBlock filtered by the creator_id column
  53. * @method CcBlock findOneByDbDescription(string $description) Return the first CcBlock filtered by the description column
  54. * @method CcBlock findOneByDbLength(string $length) Return the first CcBlock filtered by the length column
  55. * @method CcBlock findOneByDbType(string $type) Return the first CcBlock filtered by the type column
  56. *
  57. * @method array findByDbId(int $id) Return CcBlock objects filtered by the id column
  58. * @method array findByDbName(string $name) Return CcBlock objects filtered by the name column
  59. * @method array findByDbMtime(string $mtime) Return CcBlock objects filtered by the mtime column
  60. * @method array findByDbUtime(string $utime) Return CcBlock objects filtered by the utime column
  61. * @method array findByDbCreatorId(int $creator_id) Return CcBlock objects filtered by the creator_id column
  62. * @method array findByDbDescription(string $description) Return CcBlock objects filtered by the description column
  63. * @method array findByDbLength(string $length) Return CcBlock objects filtered by the length column
  64. * @method array findByDbType(string $type) Return CcBlock objects filtered by the type column
  65. *
  66. * @package propel.generator.airtime.om
  67. */
  68. abstract class BaseCcBlockQuery extends ModelCriteria
  69. {
  70. /**
  71. * Initializes internal state of BaseCcBlockQuery 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 = 'CcBlock', $modelAlias = null)
  78. {
  79. parent::__construct($dbName, $modelName, $modelAlias);
  80. }
  81. /**
  82. * Returns a new CcBlockQuery 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 CcBlockQuery
  88. */
  89. public static function create($modelAlias = null, $criteria = null)
  90. {
  91. if ($criteria instanceof CcBlockQuery) {
  92. return $criteria;
  93. }
  94. $query = new CcBlockQuery();
  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 CcBlock|array|mixed the result, formatted by the current formatter
  113. */
  114. public function findPk($key, $con = null)
  115. {
  116. if ((null !== ($obj = CcBlockPeer::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 CcBlockQuery The current query, for fluid interface
  151. */
  152. public function filterByPrimaryKey($key)
  153. {
  154. return $this->addUsingAlias(CcBlockPeer::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 CcBlockQuery The current query, for fluid interface
  162. */
  163. public function filterByPrimaryKeys($keys)
  164. {
  165. return $this->addUsingAlias(CcBlockPeer::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 CcBlockQuery 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(CcBlockPeer::ID, $dbId, $comparison);
  182. }
  183. /**
  184. * Filter the query on the name column
  185. *
  186. * @param string $dbName The value to use as filter.
  187. * Accepts wildcards (* and % trigger a LIKE)
  188. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  189. *
  190. * @return CcBlockQuery The current query, for fluid interface
  191. */
  192. public function filterByDbName($dbName = null, $comparison = null)
  193. {
  194. if (null === $comparison) {
  195. if (is_array($dbName)) {
  196. $comparison = Criteria::IN;
  197. } elseif (preg_match('/[\%\*]/', $dbName)) {
  198. $dbName = str_replace('*', '%', $dbName);
  199. $comparison = Criteria::LIKE;
  200. }
  201. }
  202. return $this->addUsingAlias(CcBlockPeer::NAME, $dbName, $comparison);
  203. }
  204. /**
  205. * Filter the query on the mtime column
  206. *
  207. * @param string|array $dbMtime The value to use as filter.
  208. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  209. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  210. *
  211. * @return CcBlockQuery The current query, for fluid interface
  212. */
  213. public function filterByDbMtime($dbMtime = null, $comparison = null)
  214. {
  215. if (is_array($dbMtime)) {
  216. $useMinMax = false;
  217. if (isset($dbMtime['min'])) {
  218. $this->addUsingAlias(CcBlockPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL);
  219. $useMinMax = true;
  220. }
  221. if (isset($dbMtime['max'])) {
  222. $this->addUsingAlias(CcBlockPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL);
  223. $useMinMax = true;
  224. }
  225. if ($useMinMax) {
  226. return $this;
  227. }
  228. if (null === $comparison) {
  229. $comparison = Criteria::IN;
  230. }
  231. }
  232. return $this->addUsingAlias(CcBlockPeer::MTIME, $dbMtime, $comparison);
  233. }
  234. /**
  235. * Filter the query on the utime column
  236. *
  237. * @param string|array $dbUtime The value to use as filter.
  238. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  239. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  240. *
  241. * @return CcBlockQuery The current query, for fluid interface
  242. */
  243. public function filterByDbUtime($dbUtime = null, $comparison = null)
  244. {
  245. if (is_array($dbUtime)) {
  246. $useMinMax = false;
  247. if (isset($dbUtime['min'])) {
  248. $this->addUsingAlias(CcBlockPeer::UTIME, $dbUtime['min'], Criteria::GREATER_EQUAL);
  249. $useMinMax = true;
  250. }
  251. if (isset($dbUtime['max'])) {
  252. $this->addUsingAlias(CcBlockPeer::UTIME, $dbUtime['max'], Criteria::LESS_EQUAL);
  253. $useMinMax = true;
  254. }
  255. if ($useMinMax) {
  256. return $this;
  257. }
  258. if (null === $comparison) {
  259. $comparison = Criteria::IN;
  260. }
  261. }
  262. return $this->addUsingAlias(CcBlockPeer::UTIME, $dbUtime, $comparison);
  263. }
  264. /**
  265. * Filter the query on the creator_id column
  266. *
  267. * @param int|array $dbCreatorId The value to use as filter.
  268. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  269. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  270. *
  271. * @return CcBlockQuery The current query, for fluid interface
  272. */
  273. public function filterByDbCreatorId($dbCreatorId = null, $comparison = null)
  274. {
  275. if (is_array($dbCreatorId)) {
  276. $useMinMax = false;
  277. if (isset($dbCreatorId['min'])) {
  278. $this->addUsingAlias(CcBlockPeer::CREATOR_ID, $dbCreatorId['min'], Criteria::GREATER_EQUAL);
  279. $useMinMax = true;
  280. }
  281. if (isset($dbCreatorId['max'])) {
  282. $this->addUsingAlias(CcBlockPeer::CREATOR_ID, $dbCreatorId['max'], Criteria::LESS_EQUAL);
  283. $useMinMax = true;
  284. }
  285. if ($useMinMax) {
  286. return $this;
  287. }
  288. if (null === $comparison) {
  289. $comparison = Criteria::IN;
  290. }
  291. }
  292. return $this->addUsingAlias(CcBlockPeer::CREATOR_ID, $dbCreatorId, $comparison);
  293. }
  294. /**
  295. * Filter the query on the description column
  296. *
  297. * @param string $dbDescription The value to use as filter.
  298. * Accepts wildcards (* and % trigger a LIKE)
  299. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  300. *
  301. * @return CcBlockQuery The current query, for fluid interface
  302. */
  303. public function filterByDbDescription($dbDescription = null, $comparison = null)
  304. {
  305. if (null === $comparison) {
  306. if (is_array($dbDescription)) {
  307. $comparison = Criteria::IN;
  308. } elseif (preg_match('/[\%\*]/', $dbDescription)) {
  309. $dbDescription = str_replace('*', '%', $dbDescription);
  310. $comparison = Criteria::LIKE;
  311. }
  312. }
  313. return $this->addUsingAlias(CcBlockPeer::DESCRIPTION, $dbDescription, $comparison);
  314. }
  315. /**
  316. * Filter the query on the length column
  317. *
  318. * @param string $dbLength The value to use as filter.
  319. * Accepts wildcards (* and % trigger a LIKE)
  320. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  321. *
  322. * @return CcBlockQuery The current query, for fluid interface
  323. */
  324. public function filterByDbLength($dbLength = null, $comparison = null)
  325. {
  326. if (null === $comparison) {
  327. if (is_array($dbLength)) {
  328. $comparison = Criteria::IN;
  329. } elseif (preg_match('/[\%\*]/', $dbLength)) {
  330. $dbLength = str_replace('*', '%', $dbLength);
  331. $comparison = Criteria::LIKE;
  332. }
  333. }
  334. return $this->addUsingAlias(CcBlockPeer::LENGTH, $dbLength, $comparison);
  335. }
  336. /**
  337. * Filter the query on the type column
  338. *
  339. * @param string $dbType The value to use as filter.
  340. * Accepts wildcards (* and % trigger a LIKE)
  341. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  342. *
  343. * @return CcBlockQuery The current query, for fluid interface
  344. */
  345. public function filterByDbType($dbType = null, $comparison = null)
  346. {
  347. if (null === $comparison) {
  348. if (is_array($dbType)) {
  349. $comparison = Criteria::IN;
  350. } elseif (preg_match('/[\%\*]/', $dbType)) {
  351. $dbType = str_replace('*', '%', $dbType);
  352. $comparison = Criteria::LIKE;
  353. }
  354. }
  355. return $this->addUsingAlias(CcBlockPeer::TYPE, $dbType, $comparison);
  356. }
  357. /**
  358. * Filter the query by a related CcSubjs object
  359. *
  360. * @param CcSubjs $ccSubjs the related object to use as filter
  361. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  362. *
  363. * @return CcBlockQuery The current query, for fluid interface
  364. */
  365. public function filterByCcSubjs($ccSubjs, $comparison = null)
  366. {
  367. return $this
  368. ->addUsingAlias(CcBlockPeer::CREATOR_ID, $ccSubjs->getDbId(), $comparison);
  369. }
  370. /**
  371. * Adds a JOIN clause to the query using the CcSubjs relation
  372. *
  373. * @param string $relationAlias optional alias for the relation
  374. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  375. *
  376. * @return CcBlockQuery The current query, for fluid interface
  377. */
  378. public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  379. {
  380. $tableMap = $this->getTableMap();
  381. $relationMap = $tableMap->getRelation('CcSubjs');
  382. // create a ModelJoin object for this join
  383. $join = new ModelJoin();
  384. $join->setJoinType($joinType);
  385. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  386. if ($previousJoin = $this->getPreviousJoin()) {
  387. $join->setPreviousJoin($previousJoin);
  388. }
  389. // add the ModelJoin to the current object
  390. if($relationAlias) {
  391. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  392. $this->addJoinObject($join, $relationAlias);
  393. } else {
  394. $this->addJoinObject($join, 'CcSubjs');
  395. }
  396. return $this;
  397. }
  398. /**
  399. * Use the CcSubjs relation CcSubjs object
  400. *
  401. * @see useQuery()
  402. *
  403. * @param string $relationAlias optional alias for the relation,
  404. * to be used as main alias in the secondary query
  405. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  406. *
  407. * @return CcSubjsQuery A secondary query class using the current class as primary query
  408. */
  409. public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  410. {
  411. return $this
  412. ->joinCcSubjs($relationAlias, $joinType)
  413. ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
  414. }
  415. /**
  416. * Filter the query by a related CcPlaylistcontents object
  417. *
  418. * @param CcPlaylistcontents $ccPlaylistcontents the related object to use as filter
  419. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  420. *
  421. * @return CcBlockQuery The current query, for fluid interface
  422. */
  423. public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null)
  424. {
  425. return $this
  426. ->addUsingAlias(CcBlockPeer::ID, $ccPlaylistcontents->getDbBlockId(), $comparison);
  427. }
  428. /**
  429. * Adds a JOIN clause to the query using the CcPlaylistcontents relation
  430. *
  431. * @param string $relationAlias optional alias for the relation
  432. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  433. *
  434. * @return CcBlockQuery The current query, for fluid interface
  435. */
  436. public function joinCcPlaylistcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  437. {
  438. $tableMap = $this->getTableMap();
  439. $relationMap = $tableMap->getRelation('CcPlaylistcontents');
  440. // create a ModelJoin object for this join
  441. $join = new ModelJoin();
  442. $join->setJoinType($joinType);
  443. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  444. if ($previousJoin = $this->getPreviousJoin()) {
  445. $join->setPreviousJoin($previousJoin);
  446. }
  447. // add the ModelJoin to the current object
  448. if($relationAlias) {
  449. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  450. $this->addJoinObject($join, $relationAlias);
  451. } else {
  452. $this->addJoinObject($join, 'CcPlaylistcontents');
  453. }
  454. return $this;
  455. }
  456. /**
  457. * Use the CcPlaylistcontents relation CcPlaylistcontents object
  458. *
  459. * @see useQuery()
  460. *
  461. * @param string $relationAlias optional alias for the relation,
  462. * to be used as main alias in the secondary query
  463. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  464. *
  465. * @return CcPlaylistcontentsQuery A secondary query class using the current class as primary query
  466. */
  467. public function useCcPlaylistcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  468. {
  469. return $this
  470. ->joinCcPlaylistcontents($relationAlias, $joinType)
  471. ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery');
  472. }
  473. /**
  474. * Filter the query by a related CcBlockcontents object
  475. *
  476. * @param CcBlockcontents $ccBlockcontents the related object to use as filter
  477. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  478. *
  479. * @return CcBlockQuery The current query, for fluid interface
  480. */
  481. public function filterByCcBlockcontents($ccBlockcontents, $comparison = null)
  482. {
  483. return $this
  484. ->addUsingAlias(CcBlockPeer::ID, $ccBlockcontents->getDbBlockId(), $comparison);
  485. }
  486. /**
  487. * Adds a JOIN clause to the query using the CcBlockcontents relation
  488. *
  489. * @param string $relationAlias optional alias for the relation
  490. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  491. *
  492. * @return CcBlockQuery The current query, for fluid interface
  493. */
  494. public function joinCcBlockcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  495. {
  496. $tableMap = $this->getTableMap();
  497. $relationMap = $tableMap->getRelation('CcBlockcontents');
  498. // create a ModelJoin object for this join
  499. $join = new ModelJoin();
  500. $join->setJoinType($joinType);
  501. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  502. if ($previousJoin = $this->getPreviousJoin()) {
  503. $join->setPreviousJoin($previousJoin);
  504. }
  505. // add the ModelJoin to the current object
  506. if($relationAlias) {
  507. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  508. $this->addJoinObject($join, $relationAlias);
  509. } else {
  510. $this->addJoinObject($join, 'CcBlockcontents');
  511. }
  512. return $this;
  513. }
  514. /**
  515. * Use the CcBlockcontents relation CcBlockcontents object
  516. *
  517. * @see useQuery()
  518. *
  519. * @param string $relationAlias optional alias for the relation,
  520. * to be used as main alias in the secondary query
  521. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  522. *
  523. * @return CcBlockcontentsQuery A secondary query class using the current class as primary query
  524. */
  525. public function useCcBlockcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  526. {
  527. return $this
  528. ->joinCcBlockcontents($relationAlias, $joinType)
  529. ->useQuery($relationAlias ? $relationAlias : 'CcBlockcontents', 'CcBlockcontentsQuery');
  530. }
  531. /**
  532. * Filter the query by a related CcBlockcriteria object
  533. *
  534. * @param CcBlockcriteria $ccBlockcriteria the related object to use as filter
  535. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  536. *
  537. * @return CcBlockQuery The current query, for fluid interface
  538. */
  539. public function filterByCcBlockcriteria($ccBlockcriteria, $comparison = null)
  540. {
  541. return $this
  542. ->addUsingAlias(CcBlockPeer::ID, $ccBlockcriteria->getDbBlockId(), $comparison);
  543. }
  544. /**
  545. * Adds a JOIN clause to the query using the CcBlockcriteria relation
  546. *
  547. * @param string $relationAlias optional alias for the relation
  548. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  549. *
  550. * @return CcBlockQuery The current query, for fluid interface
  551. */
  552. public function joinCcBlockcriteria($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  553. {
  554. $tableMap = $this->getTableMap();
  555. $relationMap = $tableMap->getRelation('CcBlockcriteria');
  556. // create a ModelJoin object for this join
  557. $join = new ModelJoin();
  558. $join->setJoinType($joinType);
  559. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  560. if ($previousJoin = $this->getPreviousJoin()) {
  561. $join->setPreviousJoin($previousJoin);
  562. }
  563. // add the ModelJoin to the current object
  564. if($relationAlias) {
  565. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  566. $this->addJoinObject($join, $relationAlias);
  567. } else {
  568. $this->addJoinObject($join, 'CcBlockcriteria');
  569. }
  570. return $this;
  571. }
  572. /**
  573. * Use the CcBlockcriteria relation CcBlockcriteria object
  574. *
  575. * @see useQuery()
  576. *
  577. * @param string $relationAlias optional alias for the relation,
  578. * to be used as main alias in the secondary query
  579. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  580. *
  581. * @return CcBlockcriteriaQuery A secondary query class using the current class as primary query
  582. */
  583. public function useCcBlockcriteriaQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  584. {
  585. return $this
  586. ->joinCcBlockcriteria($relationAlias, $joinType)
  587. ->useQuery($relationAlias ? $relationAlias : 'CcBlockcriteria', 'CcBlockcriteriaQuery');
  588. }
  589. /**
  590. * Exclude object from result
  591. *
  592. * @param CcBlock $ccBlock Object to remove from the list of results
  593. *
  594. * @return CcBlockQuery The current query, for fluid interface
  595. */
  596. public function prune($ccBlock = null)
  597. {
  598. if ($ccBlock) {
  599. $this->addUsingAlias(CcBlockPeer::ID, $ccBlock->getDbId(), Criteria::NOT_EQUAL);
  600. }
  601. return $this;
  602. }
  603. } // BaseCcBlockQuery