BaseCcShowHostsQuery.php 13 KB

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