BaseCcCountryQuery.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_country' table.
  4. *
  5. *
  6. *
  7. * @method CcCountryQuery orderByDbIsoCode($order = Criteria::ASC) Order by the isocode column
  8. * @method CcCountryQuery orderByDbName($order = Criteria::ASC) Order by the name column
  9. *
  10. * @method CcCountryQuery groupByDbIsoCode() Group by the isocode column
  11. * @method CcCountryQuery groupByDbName() Group by the name column
  12. *
  13. * @method CcCountryQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  14. * @method CcCountryQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  15. * @method CcCountryQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  16. *
  17. * @method CcCountry findOne(PropelPDO $con = null) Return the first CcCountry matching the query
  18. * @method CcCountry findOneOrCreate(PropelPDO $con = null) Return the first CcCountry matching the query, or a new CcCountry object populated from the query conditions when no match is found
  19. *
  20. * @method CcCountry findOneByDbIsoCode(string $isocode) Return the first CcCountry filtered by the isocode column
  21. * @method CcCountry findOneByDbName(string $name) Return the first CcCountry filtered by the name column
  22. *
  23. * @method array findByDbIsoCode(string $isocode) Return CcCountry objects filtered by the isocode column
  24. * @method array findByDbName(string $name) Return CcCountry objects filtered by the name column
  25. *
  26. * @package propel.generator.airtime.om
  27. */
  28. abstract class BaseCcCountryQuery extends ModelCriteria
  29. {
  30. /**
  31. * Initializes internal state of BaseCcCountryQuery 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 = 'CcCountry', $modelAlias = null)
  38. {
  39. parent::__construct($dbName, $modelName, $modelAlias);
  40. }
  41. /**
  42. * Returns a new CcCountryQuery 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 CcCountryQuery
  48. */
  49. public static function create($modelAlias = null, $criteria = null)
  50. {
  51. if ($criteria instanceof CcCountryQuery) {
  52. return $criteria;
  53. }
  54. $query = new CcCountryQuery();
  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 CcCountry|array|mixed the result, formatted by the current formatter
  73. */
  74. public function findPk($key, $con = null)
  75. {
  76. if ((null !== ($obj = CcCountryPeer::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 CcCountryQuery The current query, for fluid interface
  111. */
  112. public function filterByPrimaryKey($key)
  113. {
  114. return $this->addUsingAlias(CcCountryPeer::ISOCODE, $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 CcCountryQuery The current query, for fluid interface
  122. */
  123. public function filterByPrimaryKeys($keys)
  124. {
  125. return $this->addUsingAlias(CcCountryPeer::ISOCODE, $keys, Criteria::IN);
  126. }
  127. /**
  128. * Filter the query on the isocode column
  129. *
  130. * @param string $dbIsoCode 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 CcCountryQuery The current query, for fluid interface
  135. */
  136. public function filterByDbIsoCode($dbIsoCode = null, $comparison = null)
  137. {
  138. if (null === $comparison) {
  139. if (is_array($dbIsoCode)) {
  140. $comparison = Criteria::IN;
  141. } elseif (preg_match('/[\%\*]/', $dbIsoCode)) {
  142. $dbIsoCode = str_replace('*', '%', $dbIsoCode);
  143. $comparison = Criteria::LIKE;
  144. }
  145. }
  146. return $this->addUsingAlias(CcCountryPeer::ISOCODE, $dbIsoCode, $comparison);
  147. }
  148. /**
  149. * Filter the query on the name column
  150. *
  151. * @param string $dbName The value to use as filter.
  152. * Accepts wildcards (* and % trigger a LIKE)
  153. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  154. *
  155. * @return CcCountryQuery The current query, for fluid interface
  156. */
  157. public function filterByDbName($dbName = null, $comparison = null)
  158. {
  159. if (null === $comparison) {
  160. if (is_array($dbName)) {
  161. $comparison = Criteria::IN;
  162. } elseif (preg_match('/[\%\*]/', $dbName)) {
  163. $dbName = str_replace('*', '%', $dbName);
  164. $comparison = Criteria::LIKE;
  165. }
  166. }
  167. return $this->addUsingAlias(CcCountryPeer::NAME, $dbName, $comparison);
  168. }
  169. /**
  170. * Exclude object from result
  171. *
  172. * @param CcCountry $ccCountry Object to remove from the list of results
  173. *
  174. * @return CcCountryQuery The current query, for fluid interface
  175. */
  176. public function prune($ccCountry = null)
  177. {
  178. if ($ccCountry) {
  179. $this->addUsingAlias(CcCountryPeer::ISOCODE, $ccCountry->getDbIsoCode(), Criteria::NOT_EQUAL);
  180. }
  181. return $this;
  182. }
  183. } // BaseCcCountryQuery