BaseCcLiveLogQuery.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_live_log' table.
  4. *
  5. *
  6. *
  7. * @method CcLiveLogQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcLiveLogQuery orderByDbState($order = Criteria::ASC) Order by the state column
  9. * @method CcLiveLogQuery orderByDbStartTime($order = Criteria::ASC) Order by the start_time column
  10. * @method CcLiveLogQuery orderByDbEndTime($order = Criteria::ASC) Order by the end_time column
  11. *
  12. * @method CcLiveLogQuery groupByDbId() Group by the id column
  13. * @method CcLiveLogQuery groupByDbState() Group by the state column
  14. * @method CcLiveLogQuery groupByDbStartTime() Group by the start_time column
  15. * @method CcLiveLogQuery groupByDbEndTime() Group by the end_time column
  16. *
  17. * @method CcLiveLogQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  18. * @method CcLiveLogQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  19. * @method CcLiveLogQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  20. *
  21. * @method CcLiveLog findOne(PropelPDO $con = null) Return the first CcLiveLog matching the query
  22. * @method CcLiveLog findOneOrCreate(PropelPDO $con = null) Return the first CcLiveLog matching the query, or a new CcLiveLog object populated from the query conditions when no match is found
  23. *
  24. * @method CcLiveLog findOneByDbId(int $id) Return the first CcLiveLog filtered by the id column
  25. * @method CcLiveLog findOneByDbState(string $state) Return the first CcLiveLog filtered by the state column
  26. * @method CcLiveLog findOneByDbStartTime(string $start_time) Return the first CcLiveLog filtered by the start_time column
  27. * @method CcLiveLog findOneByDbEndTime(string $end_time) Return the first CcLiveLog filtered by the end_time column
  28. *
  29. * @method array findByDbId(int $id) Return CcLiveLog objects filtered by the id column
  30. * @method array findByDbState(string $state) Return CcLiveLog objects filtered by the state column
  31. * @method array findByDbStartTime(string $start_time) Return CcLiveLog objects filtered by the start_time column
  32. * @method array findByDbEndTime(string $end_time) Return CcLiveLog objects filtered by the end_time column
  33. *
  34. * @package propel.generator.airtime.om
  35. */
  36. abstract class BaseCcLiveLogQuery extends ModelCriteria
  37. {
  38. /**
  39. * Initializes internal state of BaseCcLiveLogQuery 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 = 'CcLiveLog', $modelAlias = null)
  46. {
  47. parent::__construct($dbName, $modelName, $modelAlias);
  48. }
  49. /**
  50. * Returns a new CcLiveLogQuery 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 CcLiveLogQuery
  56. */
  57. public static function create($modelAlias = null, $criteria = null)
  58. {
  59. if ($criteria instanceof CcLiveLogQuery) {
  60. return $criteria;
  61. }
  62. $query = new CcLiveLogQuery();
  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 CcLiveLog|array|mixed the result, formatted by the current formatter
  81. */
  82. public function findPk($key, $con = null)
  83. {
  84. if ((null !== ($obj = CcLiveLogPeer::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 CcLiveLogQuery The current query, for fluid interface
  119. */
  120. public function filterByPrimaryKey($key)
  121. {
  122. return $this->addUsingAlias(CcLiveLogPeer::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 CcLiveLogQuery The current query, for fluid interface
  130. */
  131. public function filterByPrimaryKeys($keys)
  132. {
  133. return $this->addUsingAlias(CcLiveLogPeer::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 CcLiveLogQuery 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(CcLiveLogPeer::ID, $dbId, $comparison);
  150. }
  151. /**
  152. * Filter the query on the state column
  153. *
  154. * @param string $dbState 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 CcLiveLogQuery The current query, for fluid interface
  159. */
  160. public function filterByDbState($dbState = null, $comparison = null)
  161. {
  162. if (null === $comparison) {
  163. if (is_array($dbState)) {
  164. $comparison = Criteria::IN;
  165. } elseif (preg_match('/[\%\*]/', $dbState)) {
  166. $dbState = str_replace('*', '%', $dbState);
  167. $comparison = Criteria::LIKE;
  168. }
  169. }
  170. return $this->addUsingAlias(CcLiveLogPeer::STATE, $dbState, $comparison);
  171. }
  172. /**
  173. * Filter the query on the start_time column
  174. *
  175. * @param string|array $dbStartTime The value to use as filter.
  176. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  177. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  178. *
  179. * @return CcLiveLogQuery The current query, for fluid interface
  180. */
  181. public function filterByDbStartTime($dbStartTime = null, $comparison = null)
  182. {
  183. if (is_array($dbStartTime)) {
  184. $useMinMax = false;
  185. if (isset($dbStartTime['min'])) {
  186. $this->addUsingAlias(CcLiveLogPeer::START_TIME, $dbStartTime['min'], Criteria::GREATER_EQUAL);
  187. $useMinMax = true;
  188. }
  189. if (isset($dbStartTime['max'])) {
  190. $this->addUsingAlias(CcLiveLogPeer::START_TIME, $dbStartTime['max'], Criteria::LESS_EQUAL);
  191. $useMinMax = true;
  192. }
  193. if ($useMinMax) {
  194. return $this;
  195. }
  196. if (null === $comparison) {
  197. $comparison = Criteria::IN;
  198. }
  199. }
  200. return $this->addUsingAlias(CcLiveLogPeer::START_TIME, $dbStartTime, $comparison);
  201. }
  202. /**
  203. * Filter the query on the end_time column
  204. *
  205. * @param string|array $dbEndTime The value to use as filter.
  206. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  207. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  208. *
  209. * @return CcLiveLogQuery The current query, for fluid interface
  210. */
  211. public function filterByDbEndTime($dbEndTime = null, $comparison = null)
  212. {
  213. if (is_array($dbEndTime)) {
  214. $useMinMax = false;
  215. if (isset($dbEndTime['min'])) {
  216. $this->addUsingAlias(CcLiveLogPeer::END_TIME, $dbEndTime['min'], Criteria::GREATER_EQUAL);
  217. $useMinMax = true;
  218. }
  219. if (isset($dbEndTime['max'])) {
  220. $this->addUsingAlias(CcLiveLogPeer::END_TIME, $dbEndTime['max'], Criteria::LESS_EQUAL);
  221. $useMinMax = true;
  222. }
  223. if ($useMinMax) {
  224. return $this;
  225. }
  226. if (null === $comparison) {
  227. $comparison = Criteria::IN;
  228. }
  229. }
  230. return $this->addUsingAlias(CcLiveLogPeer::END_TIME, $dbEndTime, $comparison);
  231. }
  232. /**
  233. * Exclude object from result
  234. *
  235. * @param CcLiveLog $ccLiveLog Object to remove from the list of results
  236. *
  237. * @return CcLiveLogQuery The current query, for fluid interface
  238. */
  239. public function prune($ccLiveLog = null)
  240. {
  241. if ($ccLiveLog) {
  242. $this->addUsingAlias(CcLiveLogPeer::ID, $ccLiveLog->getDbId(), Criteria::NOT_EQUAL);
  243. }
  244. return $this;
  245. }
  246. } // BaseCcLiveLogQuery