BaseCcLoginAttemptsQuery.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_login_attempts' table.
  4. *
  5. *
  6. *
  7. * @method CcLoginAttemptsQuery orderByDbIP($order = Criteria::ASC) Order by the ip column
  8. * @method CcLoginAttemptsQuery orderByDbAttempts($order = Criteria::ASC) Order by the attempts column
  9. *
  10. * @method CcLoginAttemptsQuery groupByDbIP() Group by the ip column
  11. * @method CcLoginAttemptsQuery groupByDbAttempts() Group by the attempts column
  12. *
  13. * @method CcLoginAttemptsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  14. * @method CcLoginAttemptsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  15. * @method CcLoginAttemptsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  16. *
  17. * @method CcLoginAttempts findOne(PropelPDO $con = null) Return the first CcLoginAttempts matching the query
  18. * @method CcLoginAttempts findOneOrCreate(PropelPDO $con = null) Return the first CcLoginAttempts matching the query, or a new CcLoginAttempts object populated from the query conditions when no match is found
  19. *
  20. * @method CcLoginAttempts findOneByDbIP(string $ip) Return the first CcLoginAttempts filtered by the ip column
  21. * @method CcLoginAttempts findOneByDbAttempts(int $attempts) Return the first CcLoginAttempts filtered by the attempts column
  22. *
  23. * @method array findByDbIP(string $ip) Return CcLoginAttempts objects filtered by the ip column
  24. * @method array findByDbAttempts(int $attempts) Return CcLoginAttempts objects filtered by the attempts column
  25. *
  26. * @package propel.generator.airtime.om
  27. */
  28. abstract class BaseCcLoginAttemptsQuery extends ModelCriteria
  29. {
  30. /**
  31. * Initializes internal state of BaseCcLoginAttemptsQuery object.
  32. *
  33. * @param string $dbName The dabase name
  34. * @param string $modelName The phpName of a model, e.g. 'Book'
  35. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  36. */
  37. public function __construct($dbName = 'airtime', $modelName = 'CcLoginAttempts', $modelAlias = null)
  38. {
  39. parent::__construct($dbName, $modelName, $modelAlias);
  40. }
  41. /**
  42. * Returns a new CcLoginAttemptsQuery object.
  43. *
  44. * @param string $modelAlias The alias of a model in the query
  45. * @param Criteria $criteria Optional Criteria to build the query from
  46. *
  47. * @return CcLoginAttemptsQuery
  48. */
  49. public static function create($modelAlias = null, $criteria = null)
  50. {
  51. if ($criteria instanceof CcLoginAttemptsQuery) {
  52. return $criteria;
  53. }
  54. $query = new CcLoginAttemptsQuery();
  55. if (null !== $modelAlias) {
  56. $query->setModelAlias($modelAlias);
  57. }
  58. if ($criteria instanceof Criteria) {
  59. $query->mergeWith($criteria);
  60. }
  61. return $query;
  62. }
  63. /**
  64. * Find object by primary key
  65. * Use instance pooling to avoid a database query if the object exists
  66. * <code>
  67. * $obj = $c->findPk(12, $con);
  68. * </code>
  69. * @param mixed $key Primary key to use for the query
  70. * @param PropelPDO $con an optional connection object
  71. *
  72. * @return CcLoginAttempts|array|mixed the result, formatted by the current formatter
  73. */
  74. public function findPk($key, $con = null)
  75. {
  76. if ((null !== ($obj = CcLoginAttemptsPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  77. // the object is alredy in the instance pool
  78. return $obj;
  79. } else {
  80. // the object has not been requested yet, or the formatter is not an object formatter
  81. $criteria = $this->isKeepQuery() ? clone $this : $this;
  82. $stmt = $criteria
  83. ->filterByPrimaryKey($key)
  84. ->getSelectStatement($con);
  85. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  86. }
  87. }
  88. /**
  89. * Find objects by primary key
  90. * <code>
  91. * $objs = $c->findPks(array(12, 56, 832), $con);
  92. * </code>
  93. * @param array $keys Primary keys to use for the query
  94. * @param PropelPDO $con an optional connection object
  95. *
  96. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  97. */
  98. public function findPks($keys, $con = null)
  99. {
  100. $criteria = $this->isKeepQuery() ? clone $this : $this;
  101. return $this
  102. ->filterByPrimaryKeys($keys)
  103. ->find($con);
  104. }
  105. /**
  106. * Filter the query by primary key
  107. *
  108. * @param mixed $key Primary key to use for the query
  109. *
  110. * @return CcLoginAttemptsQuery The current query, for fluid interface
  111. */
  112. public function filterByPrimaryKey($key)
  113. {
  114. return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $key, Criteria::EQUAL);
  115. }
  116. /**
  117. * Filter the query by a list of primary keys
  118. *
  119. * @param array $keys The list of primary key to use for the query
  120. *
  121. * @return CcLoginAttemptsQuery The current query, for fluid interface
  122. */
  123. public function filterByPrimaryKeys($keys)
  124. {
  125. return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $keys, Criteria::IN);
  126. }
  127. /**
  128. * Filter the query on the ip column
  129. *
  130. * @param string $dbIP The value to use as filter.
  131. * Accepts wildcards (* and % trigger a LIKE)
  132. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  133. *
  134. * @return CcLoginAttemptsQuery The current query, for fluid interface
  135. */
  136. public function filterByDbIP($dbIP = null, $comparison = null)
  137. {
  138. if (null === $comparison) {
  139. if (is_array($dbIP)) {
  140. $comparison = Criteria::IN;
  141. } elseif (preg_match('/[\%\*]/', $dbIP)) {
  142. $dbIP = str_replace('*', '%', $dbIP);
  143. $comparison = Criteria::LIKE;
  144. }
  145. }
  146. return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $dbIP, $comparison);
  147. }
  148. /**
  149. * Filter the query on the attempts column
  150. *
  151. * @param int|array $dbAttempts The value to use as filter.
  152. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  153. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  154. *
  155. * @return CcLoginAttemptsQuery The current query, for fluid interface
  156. */
  157. public function filterByDbAttempts($dbAttempts = null, $comparison = null)
  158. {
  159. if (is_array($dbAttempts)) {
  160. $useMinMax = false;
  161. if (isset($dbAttempts['min'])) {
  162. $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts['min'], Criteria::GREATER_EQUAL);
  163. $useMinMax = true;
  164. }
  165. if (isset($dbAttempts['max'])) {
  166. $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts['max'], Criteria::LESS_EQUAL);
  167. $useMinMax = true;
  168. }
  169. if ($useMinMax) {
  170. return $this;
  171. }
  172. if (null === $comparison) {
  173. $comparison = Criteria::IN;
  174. }
  175. }
  176. return $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts, $comparison);
  177. }
  178. /**
  179. * Exclude object from result
  180. *
  181. * @param CcLoginAttempts $ccLoginAttempts Object to remove from the list of results
  182. *
  183. * @return CcLoginAttemptsQuery The current query, for fluid interface
  184. */
  185. public function prune($ccLoginAttempts = null)
  186. {
  187. if ($ccLoginAttempts) {
  188. $this->addUsingAlias(CcLoginAttemptsPeer::IP, $ccLoginAttempts->getDbIP(), Criteria::NOT_EQUAL);
  189. }
  190. return $this;
  191. }
  192. } // BaseCcLoginAttemptsQuery