BaseCcTimestampQuery.php 9.4 KB

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