BaseCcPlayoutHistoryTemplateQuery.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_playout_history_template' table.
  4. *
  5. *
  6. *
  7. * @method CcPlayoutHistoryTemplateQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcPlayoutHistoryTemplateQuery orderByDbName($order = Criteria::ASC) Order by the name column
  9. * @method CcPlayoutHistoryTemplateQuery orderByDbType($order = Criteria::ASC) Order by the type column
  10. *
  11. * @method CcPlayoutHistoryTemplateQuery groupByDbId() Group by the id column
  12. * @method CcPlayoutHistoryTemplateQuery groupByDbName() Group by the name column
  13. * @method CcPlayoutHistoryTemplateQuery groupByDbType() Group by the type column
  14. *
  15. * @method CcPlayoutHistoryTemplateQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  16. * @method CcPlayoutHistoryTemplateQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  17. * @method CcPlayoutHistoryTemplateQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  18. *
  19. * @method CcPlayoutHistoryTemplateQuery leftJoinCcPlayoutHistoryTemplateField($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcPlayoutHistoryTemplateField relation
  20. * @method CcPlayoutHistoryTemplateQuery rightJoinCcPlayoutHistoryTemplateField($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlayoutHistoryTemplateField relation
  21. * @method CcPlayoutHistoryTemplateQuery innerJoinCcPlayoutHistoryTemplateField($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlayoutHistoryTemplateField relation
  22. *
  23. * @method CcPlayoutHistoryTemplate findOne(PropelPDO $con = null) Return the first CcPlayoutHistoryTemplate matching the query
  24. * @method CcPlayoutHistoryTemplate findOneOrCreate(PropelPDO $con = null) Return the first CcPlayoutHistoryTemplate matching the query, or a new CcPlayoutHistoryTemplate object populated from the query conditions when no match is found
  25. *
  26. * @method CcPlayoutHistoryTemplate findOneByDbId(int $id) Return the first CcPlayoutHistoryTemplate filtered by the id column
  27. * @method CcPlayoutHistoryTemplate findOneByDbName(string $name) Return the first CcPlayoutHistoryTemplate filtered by the name column
  28. * @method CcPlayoutHistoryTemplate findOneByDbType(string $type) Return the first CcPlayoutHistoryTemplate filtered by the type column
  29. *
  30. * @method array findByDbId(int $id) Return CcPlayoutHistoryTemplate objects filtered by the id column
  31. * @method array findByDbName(string $name) Return CcPlayoutHistoryTemplate objects filtered by the name column
  32. * @method array findByDbType(string $type) Return CcPlayoutHistoryTemplate objects filtered by the type column
  33. *
  34. * @package propel.generator.airtime.om
  35. */
  36. abstract class BaseCcPlayoutHistoryTemplateQuery extends ModelCriteria
  37. {
  38. /**
  39. * Initializes internal state of BaseCcPlayoutHistoryTemplateQuery object.
  40. *
  41. * @param string $dbName The dabase name
  42. * @param string $modelName The phpName of a model, e.g. 'Book'
  43. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  44. */
  45. public function __construct($dbName = 'airtime', $modelName = 'CcPlayoutHistoryTemplate', $modelAlias = null)
  46. {
  47. parent::__construct($dbName, $modelName, $modelAlias);
  48. }
  49. /**
  50. * Returns a new CcPlayoutHistoryTemplateQuery object.
  51. *
  52. * @param string $modelAlias The alias of a model in the query
  53. * @param Criteria $criteria Optional Criteria to build the query from
  54. *
  55. * @return CcPlayoutHistoryTemplateQuery
  56. */
  57. public static function create($modelAlias = null, $criteria = null)
  58. {
  59. if ($criteria instanceof CcPlayoutHistoryTemplateQuery) {
  60. return $criteria;
  61. }
  62. $query = new CcPlayoutHistoryTemplateQuery();
  63. if (null !== $modelAlias) {
  64. $query->setModelAlias($modelAlias);
  65. }
  66. if ($criteria instanceof Criteria) {
  67. $query->mergeWith($criteria);
  68. }
  69. return $query;
  70. }
  71. /**
  72. * Find object by primary key
  73. * Use instance pooling to avoid a database query if the object exists
  74. * <code>
  75. * $obj = $c->findPk(12, $con);
  76. * </code>
  77. * @param mixed $key Primary key to use for the query
  78. * @param PropelPDO $con an optional connection object
  79. *
  80. * @return CcPlayoutHistoryTemplate|array|mixed the result, formatted by the current formatter
  81. */
  82. public function findPk($key, $con = null)
  83. {
  84. if ((null !== ($obj = CcPlayoutHistoryTemplatePeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  85. // the object is alredy in the instance pool
  86. return $obj;
  87. } else {
  88. // the object has not been requested yet, or the formatter is not an object formatter
  89. $criteria = $this->isKeepQuery() ? clone $this : $this;
  90. $stmt = $criteria
  91. ->filterByPrimaryKey($key)
  92. ->getSelectStatement($con);
  93. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  94. }
  95. }
  96. /**
  97. * Find objects by primary key
  98. * <code>
  99. * $objs = $c->findPks(array(12, 56, 832), $con);
  100. * </code>
  101. * @param array $keys Primary keys to use for the query
  102. * @param PropelPDO $con an optional connection object
  103. *
  104. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  105. */
  106. public function findPks($keys, $con = null)
  107. {
  108. $criteria = $this->isKeepQuery() ? clone $this : $this;
  109. return $this
  110. ->filterByPrimaryKeys($keys)
  111. ->find($con);
  112. }
  113. /**
  114. * Filter the query by primary key
  115. *
  116. * @param mixed $key Primary key to use for the query
  117. *
  118. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  119. */
  120. public function filterByPrimaryKey($key)
  121. {
  122. return $this->addUsingAlias(CcPlayoutHistoryTemplatePeer::ID, $key, Criteria::EQUAL);
  123. }
  124. /**
  125. * Filter the query by a list of primary keys
  126. *
  127. * @param array $keys The list of primary key to use for the query
  128. *
  129. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  130. */
  131. public function filterByPrimaryKeys($keys)
  132. {
  133. return $this->addUsingAlias(CcPlayoutHistoryTemplatePeer::ID, $keys, Criteria::IN);
  134. }
  135. /**
  136. * Filter the query on the id column
  137. *
  138. * @param int|array $dbId The value to use as filter.
  139. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  140. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  141. *
  142. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  143. */
  144. public function filterByDbId($dbId = null, $comparison = null)
  145. {
  146. if (is_array($dbId) && null === $comparison) {
  147. $comparison = Criteria::IN;
  148. }
  149. return $this->addUsingAlias(CcPlayoutHistoryTemplatePeer::ID, $dbId, $comparison);
  150. }
  151. /**
  152. * Filter the query on the name column
  153. *
  154. * @param string $dbName The value to use as filter.
  155. * Accepts wildcards (* and % trigger a LIKE)
  156. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  157. *
  158. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  159. */
  160. public function filterByDbName($dbName = null, $comparison = null)
  161. {
  162. if (null === $comparison) {
  163. if (is_array($dbName)) {
  164. $comparison = Criteria::IN;
  165. } elseif (preg_match('/[\%\*]/', $dbName)) {
  166. $dbName = str_replace('*', '%', $dbName);
  167. $comparison = Criteria::LIKE;
  168. }
  169. }
  170. return $this->addUsingAlias(CcPlayoutHistoryTemplatePeer::NAME, $dbName, $comparison);
  171. }
  172. /**
  173. * Filter the query on the type column
  174. *
  175. * @param string $dbType The value to use as filter.
  176. * Accepts wildcards (* and % trigger a LIKE)
  177. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  178. *
  179. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  180. */
  181. public function filterByDbType($dbType = null, $comparison = null)
  182. {
  183. if (null === $comparison) {
  184. if (is_array($dbType)) {
  185. $comparison = Criteria::IN;
  186. } elseif (preg_match('/[\%\*]/', $dbType)) {
  187. $dbType = str_replace('*', '%', $dbType);
  188. $comparison = Criteria::LIKE;
  189. }
  190. }
  191. return $this->addUsingAlias(CcPlayoutHistoryTemplatePeer::TYPE, $dbType, $comparison);
  192. }
  193. /**
  194. * Filter the query by a related CcPlayoutHistoryTemplateField object
  195. *
  196. * @param CcPlayoutHistoryTemplateField $ccPlayoutHistoryTemplateField the related object to use as filter
  197. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  198. *
  199. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  200. */
  201. public function filterByCcPlayoutHistoryTemplateField($ccPlayoutHistoryTemplateField, $comparison = null)
  202. {
  203. return $this
  204. ->addUsingAlias(CcPlayoutHistoryTemplatePeer::ID, $ccPlayoutHistoryTemplateField->getDbTemplateId(), $comparison);
  205. }
  206. /**
  207. * Adds a JOIN clause to the query using the CcPlayoutHistoryTemplateField relation
  208. *
  209. * @param string $relationAlias optional alias for the relation
  210. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  211. *
  212. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  213. */
  214. public function joinCcPlayoutHistoryTemplateField($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  215. {
  216. $tableMap = $this->getTableMap();
  217. $relationMap = $tableMap->getRelation('CcPlayoutHistoryTemplateField');
  218. // create a ModelJoin object for this join
  219. $join = new ModelJoin();
  220. $join->setJoinType($joinType);
  221. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  222. if ($previousJoin = $this->getPreviousJoin()) {
  223. $join->setPreviousJoin($previousJoin);
  224. }
  225. // add the ModelJoin to the current object
  226. if($relationAlias) {
  227. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  228. $this->addJoinObject($join, $relationAlias);
  229. } else {
  230. $this->addJoinObject($join, 'CcPlayoutHistoryTemplateField');
  231. }
  232. return $this;
  233. }
  234. /**
  235. * Use the CcPlayoutHistoryTemplateField relation CcPlayoutHistoryTemplateField object
  236. *
  237. * @see useQuery()
  238. *
  239. * @param string $relationAlias optional alias for the relation,
  240. * to be used as main alias in the secondary query
  241. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  242. *
  243. * @return CcPlayoutHistoryTemplateFieldQuery A secondary query class using the current class as primary query
  244. */
  245. public function useCcPlayoutHistoryTemplateFieldQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  246. {
  247. return $this
  248. ->joinCcPlayoutHistoryTemplateField($relationAlias, $joinType)
  249. ->useQuery($relationAlias ? $relationAlias : 'CcPlayoutHistoryTemplateField', 'CcPlayoutHistoryTemplateFieldQuery');
  250. }
  251. /**
  252. * Exclude object from result
  253. *
  254. * @param CcPlayoutHistoryTemplate $ccPlayoutHistoryTemplate Object to remove from the list of results
  255. *
  256. * @return CcPlayoutHistoryTemplateQuery The current query, for fluid interface
  257. */
  258. public function prune($ccPlayoutHistoryTemplate = null)
  259. {
  260. if ($ccPlayoutHistoryTemplate) {
  261. $this->addUsingAlias(CcPlayoutHistoryTemplatePeer::ID, $ccPlayoutHistoryTemplate->getDbId(), Criteria::NOT_EQUAL);
  262. }
  263. return $this;
  264. }
  265. } // BaseCcPlayoutHistoryTemplateQuery