/airtime_mvc/application/models/airtime/om/BaseCcBackupQuery.php

https://github.com/DoghouseMedia/Airtime · PHP · 292 lines · 134 code · 16 blank · 142 comment · 23 complexity · 6c40b7555e154f567846f7f04185b0db MD5 · raw file

  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_backup' table.
  4. *
  5. *
  6. *
  7. * @method CcBackupQuery orderByToken($order = Criteria::ASC) Order by the token column
  8. * @method CcBackupQuery orderBySessionid($order = Criteria::ASC) Order by the sessionid column
  9. * @method CcBackupQuery orderByStatus($order = Criteria::ASC) Order by the status column
  10. * @method CcBackupQuery orderByFromtime($order = Criteria::ASC) Order by the fromtime column
  11. * @method CcBackupQuery orderByTotime($order = Criteria::ASC) Order by the totime column
  12. *
  13. * @method CcBackupQuery groupByToken() Group by the token column
  14. * @method CcBackupQuery groupBySessionid() Group by the sessionid column
  15. * @method CcBackupQuery groupByStatus() Group by the status column
  16. * @method CcBackupQuery groupByFromtime() Group by the fromtime column
  17. * @method CcBackupQuery groupByTotime() Group by the totime column
  18. *
  19. * @method CcBackupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  20. * @method CcBackupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  21. * @method CcBackupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  22. *
  23. * @method CcBackup findOne(PropelPDO $con = null) Return the first CcBackup matching the query
  24. * @method CcBackup findOneOrCreate(PropelPDO $con = null) Return the first CcBackup matching the query, or a new CcBackup object populated from the query conditions when no match is found
  25. *
  26. * @method CcBackup findOneByToken(string $token) Return the first CcBackup filtered by the token column
  27. * @method CcBackup findOneBySessionid(string $sessionid) Return the first CcBackup filtered by the sessionid column
  28. * @method CcBackup findOneByStatus(string $status) Return the first CcBackup filtered by the status column
  29. * @method CcBackup findOneByFromtime(string $fromtime) Return the first CcBackup filtered by the fromtime column
  30. * @method CcBackup findOneByTotime(string $totime) Return the first CcBackup filtered by the totime column
  31. *
  32. * @method array findByToken(string $token) Return CcBackup objects filtered by the token column
  33. * @method array findBySessionid(string $sessionid) Return CcBackup objects filtered by the sessionid column
  34. * @method array findByStatus(string $status) Return CcBackup objects filtered by the status column
  35. * @method array findByFromtime(string $fromtime) Return CcBackup objects filtered by the fromtime column
  36. * @method array findByTotime(string $totime) Return CcBackup objects filtered by the totime column
  37. *
  38. * @package propel.generator.airtime.om
  39. */
  40. abstract class BaseCcBackupQuery extends ModelCriteria
  41. {
  42. /**
  43. * Initializes internal state of BaseCcBackupQuery 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 = 'CcBackup', $modelAlias = null)
  50. {
  51. parent::__construct($dbName, $modelName, $modelAlias);
  52. }
  53. /**
  54. * Returns a new CcBackupQuery 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 CcBackupQuery
  60. */
  61. public static function create($modelAlias = null, $criteria = null)
  62. {
  63. if ($criteria instanceof CcBackupQuery) {
  64. return $criteria;
  65. }
  66. $query = new CcBackupQuery();
  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 CcBackup|array|mixed the result, formatted by the current formatter
  85. */
  86. public function findPk($key, $con = null)
  87. {
  88. if ((null !== ($obj = CcBackupPeer::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 CcBackupQuery The current query, for fluid interface
  123. */
  124. public function filterByPrimaryKey($key)
  125. {
  126. return $this->addUsingAlias(CcBackupPeer::TOKEN, $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 CcBackupQuery The current query, for fluid interface
  134. */
  135. public function filterByPrimaryKeys($keys)
  136. {
  137. return $this->addUsingAlias(CcBackupPeer::TOKEN, $keys, Criteria::IN);
  138. }
  139. /**
  140. * Filter the query on the token column
  141. *
  142. * @param string $token The value to use as filter.
  143. * Accepts wildcards (* and % trigger a LIKE)
  144. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  145. *
  146. * @return CcBackupQuery The current query, for fluid interface
  147. */
  148. public function filterByToken($token = null, $comparison = null)
  149. {
  150. if (null === $comparison) {
  151. if (is_array($token)) {
  152. $comparison = Criteria::IN;
  153. } elseif (preg_match('/[\%\*]/', $token)) {
  154. $token = str_replace('*', '%', $token);
  155. $comparison = Criteria::LIKE;
  156. }
  157. }
  158. return $this->addUsingAlias(CcBackupPeer::TOKEN, $token, $comparison);
  159. }
  160. /**
  161. * Filter the query on the sessionid column
  162. *
  163. * @param string $sessionid The value to use as filter.
  164. * Accepts wildcards (* and % trigger a LIKE)
  165. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  166. *
  167. * @return CcBackupQuery The current query, for fluid interface
  168. */
  169. public function filterBySessionid($sessionid = null, $comparison = null)
  170. {
  171. if (null === $comparison) {
  172. if (is_array($sessionid)) {
  173. $comparison = Criteria::IN;
  174. } elseif (preg_match('/[\%\*]/', $sessionid)) {
  175. $sessionid = str_replace('*', '%', $sessionid);
  176. $comparison = Criteria::LIKE;
  177. }
  178. }
  179. return $this->addUsingAlias(CcBackupPeer::SESSIONID, $sessionid, $comparison);
  180. }
  181. /**
  182. * Filter the query on the status column
  183. *
  184. * @param string $status The value to use as filter.
  185. * Accepts wildcards (* and % trigger a LIKE)
  186. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  187. *
  188. * @return CcBackupQuery The current query, for fluid interface
  189. */
  190. public function filterByStatus($status = null, $comparison = null)
  191. {
  192. if (null === $comparison) {
  193. if (is_array($status)) {
  194. $comparison = Criteria::IN;
  195. } elseif (preg_match('/[\%\*]/', $status)) {
  196. $status = str_replace('*', '%', $status);
  197. $comparison = Criteria::LIKE;
  198. }
  199. }
  200. return $this->addUsingAlias(CcBackupPeer::STATUS, $status, $comparison);
  201. }
  202. /**
  203. * Filter the query on the fromtime column
  204. *
  205. * @param string|array $fromtime 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 CcBackupQuery The current query, for fluid interface
  210. */
  211. public function filterByFromtime($fromtime = null, $comparison = null)
  212. {
  213. if (is_array($fromtime)) {
  214. $useMinMax = false;
  215. if (isset($fromtime['min'])) {
  216. $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['min'], Criteria::GREATER_EQUAL);
  217. $useMinMax = true;
  218. }
  219. if (isset($fromtime['max'])) {
  220. $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['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(CcBackupPeer::FROMTIME, $fromtime, $comparison);
  231. }
  232. /**
  233. * Filter the query on the totime column
  234. *
  235. * @param string|array $totime The value to use as filter.
  236. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  237. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  238. *
  239. * @return CcBackupQuery The current query, for fluid interface
  240. */
  241. public function filterByTotime($totime = null, $comparison = null)
  242. {
  243. if (is_array($totime)) {
  244. $useMinMax = false;
  245. if (isset($totime['min'])) {
  246. $this->addUsingAlias(CcBackupPeer::TOTIME, $totime['min'], Criteria::GREATER_EQUAL);
  247. $useMinMax = true;
  248. }
  249. if (isset($totime['max'])) {
  250. $this->addUsingAlias(CcBackupPeer::TOTIME, $totime['max'], Criteria::LESS_EQUAL);
  251. $useMinMax = true;
  252. }
  253. if ($useMinMax) {
  254. return $this;
  255. }
  256. if (null === $comparison) {
  257. $comparison = Criteria::IN;
  258. }
  259. }
  260. return $this->addUsingAlias(CcBackupPeer::TOTIME, $totime, $comparison);
  261. }
  262. /**
  263. * Exclude object from result
  264. *
  265. * @param CcBackup $ccBackup Object to remove from the list of results
  266. *
  267. * @return CcBackupQuery The current query, for fluid interface
  268. */
  269. public function prune($ccBackup = null)
  270. {
  271. if ($ccBackup) {
  272. $this->addUsingAlias(CcBackupPeer::TOKEN, $ccBackup->getToken(), Criteria::NOT_EQUAL);
  273. }
  274. return $this;
  275. }
  276. } // BaseCcBackupQuery