BaseCcLocaleQuery.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_locale' table.
  4. *
  5. *
  6. *
  7. * @method CcLocaleQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcLocaleQuery orderByDbLocaleCode($order = Criteria::ASC) Order by the locale_code column
  9. * @method CcLocaleQuery orderByDbLocaleLang($order = Criteria::ASC) Order by the locale_lang column
  10. *
  11. * @method CcLocaleQuery groupByDbId() Group by the id column
  12. * @method CcLocaleQuery groupByDbLocaleCode() Group by the locale_code column
  13. * @method CcLocaleQuery groupByDbLocaleLang() Group by the locale_lang column
  14. *
  15. * @method CcLocaleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  16. * @method CcLocaleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  17. * @method CcLocaleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  18. *
  19. * @method CcLocale findOne(PropelPDO $con = null) Return the first CcLocale matching the query
  20. * @method CcLocale findOneOrCreate(PropelPDO $con = null) Return the first CcLocale matching the query, or a new CcLocale object populated from the query conditions when no match is found
  21. *
  22. * @method CcLocale findOneByDbId(int $id) Return the first CcLocale filtered by the id column
  23. * @method CcLocale findOneByDbLocaleCode(string $locale_code) Return the first CcLocale filtered by the locale_code column
  24. * @method CcLocale findOneByDbLocaleLang(string $locale_lang) Return the first CcLocale filtered by the locale_lang column
  25. *
  26. * @method array findByDbId(int $id) Return CcLocale objects filtered by the id column
  27. * @method array findByDbLocaleCode(string $locale_code) Return CcLocale objects filtered by the locale_code column
  28. * @method array findByDbLocaleLang(string $locale_lang) Return CcLocale objects filtered by the locale_lang column
  29. *
  30. * @package propel.generator.airtime.om
  31. */
  32. abstract class BaseCcLocaleQuery extends ModelCriteria
  33. {
  34. /**
  35. * Initializes internal state of BaseCcLocaleQuery 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 = 'CcLocale', $modelAlias = null)
  42. {
  43. parent::__construct($dbName, $modelName, $modelAlias);
  44. }
  45. /**
  46. * Returns a new CcLocaleQuery 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 CcLocaleQuery
  52. */
  53. public static function create($modelAlias = null, $criteria = null)
  54. {
  55. if ($criteria instanceof CcLocaleQuery) {
  56. return $criteria;
  57. }
  58. $query = new CcLocaleQuery();
  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 CcLocale|array|mixed the result, formatted by the current formatter
  77. */
  78. public function findPk($key, $con = null)
  79. {
  80. if ((null !== ($obj = CcLocalePeer::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 CcLocaleQuery The current query, for fluid interface
  115. */
  116. public function filterByPrimaryKey($key)
  117. {
  118. return $this->addUsingAlias(CcLocalePeer::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 CcLocaleQuery The current query, for fluid interface
  126. */
  127. public function filterByPrimaryKeys($keys)
  128. {
  129. return $this->addUsingAlias(CcLocalePeer::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 CcLocaleQuery 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(CcLocalePeer::ID, $dbId, $comparison);
  146. }
  147. /**
  148. * Filter the query on the locale_code column
  149. *
  150. * @param string $dbLocaleCode The value to use as filter.
  151. * Accepts wildcards (* and % trigger a LIKE)
  152. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  153. *
  154. * @return CcLocaleQuery The current query, for fluid interface
  155. */
  156. public function filterByDbLocaleCode($dbLocaleCode = null, $comparison = null)
  157. {
  158. if (null === $comparison) {
  159. if (is_array($dbLocaleCode)) {
  160. $comparison = Criteria::IN;
  161. } elseif (preg_match('/[\%\*]/', $dbLocaleCode)) {
  162. $dbLocaleCode = str_replace('*', '%', $dbLocaleCode);
  163. $comparison = Criteria::LIKE;
  164. }
  165. }
  166. return $this->addUsingAlias(CcLocalePeer::LOCALE_CODE, $dbLocaleCode, $comparison);
  167. }
  168. /**
  169. * Filter the query on the locale_lang column
  170. *
  171. * @param string $dbLocaleLang The value to use as filter.
  172. * Accepts wildcards (* and % trigger a LIKE)
  173. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  174. *
  175. * @return CcLocaleQuery The current query, for fluid interface
  176. */
  177. public function filterByDbLocaleLang($dbLocaleLang = null, $comparison = null)
  178. {
  179. if (null === $comparison) {
  180. if (is_array($dbLocaleLang)) {
  181. $comparison = Criteria::IN;
  182. } elseif (preg_match('/[\%\*]/', $dbLocaleLang)) {
  183. $dbLocaleLang = str_replace('*', '%', $dbLocaleLang);
  184. $comparison = Criteria::LIKE;
  185. }
  186. }
  187. return $this->addUsingAlias(CcLocalePeer::LOCALE_LANG, $dbLocaleLang, $comparison);
  188. }
  189. /**
  190. * Exclude object from result
  191. *
  192. * @param CcLocale $ccLocale Object to remove from the list of results
  193. *
  194. * @return CcLocaleQuery The current query, for fluid interface
  195. */
  196. public function prune($ccLocale = null)
  197. {
  198. if ($ccLocale) {
  199. $this->addUsingAlias(CcLocalePeer::ID, $ccLocale->getDbId(), Criteria::NOT_EQUAL);
  200. }
  201. return $this;
  202. }
  203. } // BaseCcLocaleQuery