BaseCcBlockcriteriaQuery.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_blockcriteria' table.
  4. *
  5. *
  6. *
  7. * @method CcBlockcriteriaQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcBlockcriteriaQuery orderByDbCriteria($order = Criteria::ASC) Order by the criteria column
  9. * @method CcBlockcriteriaQuery orderByDbModifier($order = Criteria::ASC) Order by the modifier column
  10. * @method CcBlockcriteriaQuery orderByDbValue($order = Criteria::ASC) Order by the value column
  11. * @method CcBlockcriteriaQuery orderByDbExtra($order = Criteria::ASC) Order by the extra column
  12. * @method CcBlockcriteriaQuery orderByDbBlockId($order = Criteria::ASC) Order by the block_id column
  13. *
  14. * @method CcBlockcriteriaQuery groupByDbId() Group by the id column
  15. * @method CcBlockcriteriaQuery groupByDbCriteria() Group by the criteria column
  16. * @method CcBlockcriteriaQuery groupByDbModifier() Group by the modifier column
  17. * @method CcBlockcriteriaQuery groupByDbValue() Group by the value column
  18. * @method CcBlockcriteriaQuery groupByDbExtra() Group by the extra column
  19. * @method CcBlockcriteriaQuery groupByDbBlockId() Group by the block_id column
  20. *
  21. * @method CcBlockcriteriaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  22. * @method CcBlockcriteriaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  23. * @method CcBlockcriteriaQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  24. *
  25. * @method CcBlockcriteriaQuery leftJoinCcBlock($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcBlock relation
  26. * @method CcBlockcriteriaQuery rightJoinCcBlock($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlock relation
  27. * @method CcBlockcriteriaQuery innerJoinCcBlock($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlock relation
  28. *
  29. * @method CcBlockcriteria findOne(PropelPDO $con = null) Return the first CcBlockcriteria matching the query
  30. * @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
  31. *
  32. * @method CcBlockcriteria findOneByDbId(int $id) Return the first CcBlockcriteria filtered by the id column
  33. * @method CcBlockcriteria findOneByDbCriteria(string $criteria) Return the first CcBlockcriteria filtered by the criteria column
  34. * @method CcBlockcriteria findOneByDbModifier(string $modifier) Return the first CcBlockcriteria filtered by the modifier column
  35. * @method CcBlockcriteria findOneByDbValue(string $value) Return the first CcBlockcriteria filtered by the value column
  36. * @method CcBlockcriteria findOneByDbExtra(string $extra) Return the first CcBlockcriteria filtered by the extra column
  37. * @method CcBlockcriteria findOneByDbBlockId(int $block_id) Return the first CcBlockcriteria filtered by the block_id column
  38. *
  39. * @method array findByDbId(int $id) Return CcBlockcriteria objects filtered by the id column
  40. * @method array findByDbCriteria(string $criteria) Return CcBlockcriteria objects filtered by the criteria column
  41. * @method array findByDbModifier(string $modifier) Return CcBlockcriteria objects filtered by the modifier column
  42. * @method array findByDbValue(string $value) Return CcBlockcriteria objects filtered by the value column
  43. * @method array findByDbExtra(string $extra) Return CcBlockcriteria objects filtered by the extra column
  44. * @method array findByDbBlockId(int $block_id) Return CcBlockcriteria objects filtered by the block_id column
  45. *
  46. * @package propel.generator.airtime.om
  47. */
  48. abstract class BaseCcBlockcriteriaQuery extends ModelCriteria
  49. {
  50. /**
  51. * Initializes internal state of BaseCcBlockcriteriaQuery object.
  52. *
  53. * @param string $dbName The dabase name
  54. * @param string $modelName The phpName of a model, e.g. 'Book'
  55. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  56. */
  57. public function __construct($dbName = 'airtime', $modelName = 'CcBlockcriteria', $modelAlias = null)
  58. {
  59. parent::__construct($dbName, $modelName, $modelAlias);
  60. }
  61. /**
  62. * Returns a new CcBlockcriteriaQuery object.
  63. *
  64. * @param string $modelAlias The alias of a model in the query
  65. * @param Criteria $criteria Optional Criteria to build the query from
  66. *
  67. * @return CcBlockcriteriaQuery
  68. */
  69. public static function create($modelAlias = null, $criteria = null)
  70. {
  71. if ($criteria instanceof CcBlockcriteriaQuery) {
  72. return $criteria;
  73. }
  74. $query = new CcBlockcriteriaQuery();
  75. if (null !== $modelAlias) {
  76. $query->setModelAlias($modelAlias);
  77. }
  78. if ($criteria instanceof Criteria) {
  79. $query->mergeWith($criteria);
  80. }
  81. return $query;
  82. }
  83. /**
  84. * Find object by primary key
  85. * Use instance pooling to avoid a database query if the object exists
  86. * <code>
  87. * $obj = $c->findPk(12, $con);
  88. * </code>
  89. * @param mixed $key Primary key to use for the query
  90. * @param PropelPDO $con an optional connection object
  91. *
  92. * @return CcBlockcriteria|array|mixed the result, formatted by the current formatter
  93. */
  94. public function findPk($key, $con = null)
  95. {
  96. if ((null !== ($obj = CcBlockcriteriaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  97. // the object is alredy in the instance pool
  98. return $obj;
  99. } else {
  100. // the object has not been requested yet, or the formatter is not an object formatter
  101. $criteria = $this->isKeepQuery() ? clone $this : $this;
  102. $stmt = $criteria
  103. ->filterByPrimaryKey($key)
  104. ->getSelectStatement($con);
  105. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  106. }
  107. }
  108. /**
  109. * Find objects by primary key
  110. * <code>
  111. * $objs = $c->findPks(array(12, 56, 832), $con);
  112. * </code>
  113. * @param array $keys Primary keys to use for the query
  114. * @param PropelPDO $con an optional connection object
  115. *
  116. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  117. */
  118. public function findPks($keys, $con = null)
  119. {
  120. $criteria = $this->isKeepQuery() ? clone $this : $this;
  121. return $this
  122. ->filterByPrimaryKeys($keys)
  123. ->find($con);
  124. }
  125. /**
  126. * Filter the query by primary key
  127. *
  128. * @param mixed $key Primary key to use for the query
  129. *
  130. * @return CcBlockcriteriaQuery The current query, for fluid interface
  131. */
  132. public function filterByPrimaryKey($key)
  133. {
  134. return $this->addUsingAlias(CcBlockcriteriaPeer::ID, $key, Criteria::EQUAL);
  135. }
  136. /**
  137. * Filter the query by a list of primary keys
  138. *
  139. * @param array $keys The list of primary key to use for the query
  140. *
  141. * @return CcBlockcriteriaQuery The current query, for fluid interface
  142. */
  143. public function filterByPrimaryKeys($keys)
  144. {
  145. return $this->addUsingAlias(CcBlockcriteriaPeer::ID, $keys, Criteria::IN);
  146. }
  147. /**
  148. * Filter the query on the id column
  149. *
  150. * @param int|array $dbId The value to use as filter.
  151. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  152. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  153. *
  154. * @return CcBlockcriteriaQuery The current query, for fluid interface
  155. */
  156. public function filterByDbId($dbId = null, $comparison = null)
  157. {
  158. if (is_array($dbId) && null === $comparison) {
  159. $comparison = Criteria::IN;
  160. }
  161. return $this->addUsingAlias(CcBlockcriteriaPeer::ID, $dbId, $comparison);
  162. }
  163. /**
  164. * Filter the query on the criteria column
  165. *
  166. * @param string $dbCriteria The value to use as filter.
  167. * Accepts wildcards (* and % trigger a LIKE)
  168. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  169. *
  170. * @return CcBlockcriteriaQuery The current query, for fluid interface
  171. */
  172. public function filterByDbCriteria($dbCriteria = null, $comparison = null)
  173. {
  174. if (null === $comparison) {
  175. if (is_array($dbCriteria)) {
  176. $comparison = Criteria::IN;
  177. } elseif (preg_match('/[\%\*]/', $dbCriteria)) {
  178. $dbCriteria = str_replace('*', '%', $dbCriteria);
  179. $comparison = Criteria::LIKE;
  180. }
  181. }
  182. return $this->addUsingAlias(CcBlockcriteriaPeer::CRITERIA, $dbCriteria, $comparison);
  183. }
  184. /**
  185. * Filter the query on the modifier column
  186. *
  187. * @param string $dbModifier The value to use as filter.
  188. * Accepts wildcards (* and % trigger a LIKE)
  189. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  190. *
  191. * @return CcBlockcriteriaQuery The current query, for fluid interface
  192. */
  193. public function filterByDbModifier($dbModifier = null, $comparison = null)
  194. {
  195. if (null === $comparison) {
  196. if (is_array($dbModifier)) {
  197. $comparison = Criteria::IN;
  198. } elseif (preg_match('/[\%\*]/', $dbModifier)) {
  199. $dbModifier = str_replace('*', '%', $dbModifier);
  200. $comparison = Criteria::LIKE;
  201. }
  202. }
  203. return $this->addUsingAlias(CcBlockcriteriaPeer::MODIFIER, $dbModifier, $comparison);
  204. }
  205. /**
  206. * Filter the query on the value column
  207. *
  208. * @param string $dbValue The value to use as filter.
  209. * Accepts wildcards (* and % trigger a LIKE)
  210. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  211. *
  212. * @return CcBlockcriteriaQuery The current query, for fluid interface
  213. */
  214. public function filterByDbValue($dbValue = null, $comparison = null)
  215. {
  216. if (null === $comparison) {
  217. if (is_array($dbValue)) {
  218. $comparison = Criteria::IN;
  219. } elseif (preg_match('/[\%\*]/', $dbValue)) {
  220. $dbValue = str_replace('*', '%', $dbValue);
  221. $comparison = Criteria::LIKE;
  222. }
  223. }
  224. return $this->addUsingAlias(CcBlockcriteriaPeer::VALUE, $dbValue, $comparison);
  225. }
  226. /**
  227. * Filter the query on the extra column
  228. *
  229. * @param string $dbExtra The value to use as filter.
  230. * Accepts wildcards (* and % trigger a LIKE)
  231. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  232. *
  233. * @return CcBlockcriteriaQuery The current query, for fluid interface
  234. */
  235. public function filterByDbExtra($dbExtra = null, $comparison = null)
  236. {
  237. if (null === $comparison) {
  238. if (is_array($dbExtra)) {
  239. $comparison = Criteria::IN;
  240. } elseif (preg_match('/[\%\*]/', $dbExtra)) {
  241. $dbExtra = str_replace('*', '%', $dbExtra);
  242. $comparison = Criteria::LIKE;
  243. }
  244. }
  245. return $this->addUsingAlias(CcBlockcriteriaPeer::EXTRA, $dbExtra, $comparison);
  246. }
  247. /**
  248. * Filter the query on the block_id column
  249. *
  250. * @param int|array $dbBlockId The value to use as filter.
  251. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  252. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  253. *
  254. * @return CcBlockcriteriaQuery The current query, for fluid interface
  255. */
  256. public function filterByDbBlockId($dbBlockId = null, $comparison = null)
  257. {
  258. if (is_array($dbBlockId)) {
  259. $useMinMax = false;
  260. if (isset($dbBlockId['min'])) {
  261. $this->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL);
  262. $useMinMax = true;
  263. }
  264. if (isset($dbBlockId['max'])) {
  265. $this->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL);
  266. $useMinMax = true;
  267. }
  268. if ($useMinMax) {
  269. return $this;
  270. }
  271. if (null === $comparison) {
  272. $comparison = Criteria::IN;
  273. }
  274. }
  275. return $this->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $dbBlockId, $comparison);
  276. }
  277. /**
  278. * Filter the query by a related CcBlock object
  279. *
  280. * @param CcBlock $ccBlock the related object to use as filter
  281. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  282. *
  283. * @return CcBlockcriteriaQuery The current query, for fluid interface
  284. */
  285. public function filterByCcBlock($ccBlock, $comparison = null)
  286. {
  287. return $this
  288. ->addUsingAlias(CcBlockcriteriaPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison);
  289. }
  290. /**
  291. * Adds a JOIN clause to the query using the CcBlock relation
  292. *
  293. * @param string $relationAlias optional alias for the relation
  294. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  295. *
  296. * @return CcBlockcriteriaQuery The current query, for fluid interface
  297. */
  298. public function joinCcBlock($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  299. {
  300. $tableMap = $this->getTableMap();
  301. $relationMap = $tableMap->getRelation('CcBlock');
  302. // create a ModelJoin object for this join
  303. $join = new ModelJoin();
  304. $join->setJoinType($joinType);
  305. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  306. if ($previousJoin = $this->getPreviousJoin()) {
  307. $join->setPreviousJoin($previousJoin);
  308. }
  309. // add the ModelJoin to the current object
  310. if($relationAlias) {
  311. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  312. $this->addJoinObject($join, $relationAlias);
  313. } else {
  314. $this->addJoinObject($join, 'CcBlock');
  315. }
  316. return $this;
  317. }
  318. /**
  319. * Use the CcBlock relation CcBlock object
  320. *
  321. * @see useQuery()
  322. *
  323. * @param string $relationAlias optional alias for the relation,
  324. * to be used as main alias in the secondary query
  325. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  326. *
  327. * @return CcBlockQuery A secondary query class using the current class as primary query
  328. */
  329. public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  330. {
  331. return $this
  332. ->joinCcBlock($relationAlias, $joinType)
  333. ->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery');
  334. }
  335. /**
  336. * Exclude object from result
  337. *
  338. * @param CcBlockcriteria $ccBlockcriteria Object to remove from the list of results
  339. *
  340. * @return CcBlockcriteriaQuery The current query, for fluid interface
  341. */
  342. public function prune($ccBlockcriteria = null)
  343. {
  344. if ($ccBlockcriteria) {
  345. $this->addUsingAlias(CcBlockcriteriaPeer::ID, $ccBlockcriteria->getDbId(), Criteria::NOT_EQUAL);
  346. }
  347. return $this;
  348. }
  349. } // BaseCcBlockcriteriaQuery