BaseCcMountNameQuery.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_mount_name' table.
  4. *
  5. *
  6. *
  7. * @method CcMountNameQuery orderByDbId($order = Criteria::ASC) Order by the id column
  8. * @method CcMountNameQuery orderByDbMountName($order = Criteria::ASC) Order by the mount_name column
  9. *
  10. * @method CcMountNameQuery groupByDbId() Group by the id column
  11. * @method CcMountNameQuery groupByDbMountName() Group by the mount_name column
  12. *
  13. * @method CcMountNameQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  14. * @method CcMountNameQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  15. * @method CcMountNameQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  16. *
  17. * @method CcMountNameQuery leftJoinCcListenerCount($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcListenerCount relation
  18. * @method CcMountNameQuery rightJoinCcListenerCount($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcListenerCount relation
  19. * @method CcMountNameQuery innerJoinCcListenerCount($relationAlias = '') Adds a INNER JOIN clause to the query using the CcListenerCount relation
  20. *
  21. * @method CcMountName findOne(PropelPDO $con = null) Return the first CcMountName matching the query
  22. * @method CcMountName findOneOrCreate(PropelPDO $con = null) Return the first CcMountName matching the query, or a new CcMountName object populated from the query conditions when no match is found
  23. *
  24. * @method CcMountName findOneByDbId(int $id) Return the first CcMountName filtered by the id column
  25. * @method CcMountName findOneByDbMountName(string $mount_name) Return the first CcMountName filtered by the mount_name column
  26. *
  27. * @method array findByDbId(int $id) Return CcMountName objects filtered by the id column
  28. * @method array findByDbMountName(string $mount_name) Return CcMountName objects filtered by the mount_name column
  29. *
  30. * @package propel.generator.airtime.om
  31. */
  32. abstract class BaseCcMountNameQuery extends ModelCriteria
  33. {
  34. /**
  35. * Initializes internal state of BaseCcMountNameQuery 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 = 'CcMountName', $modelAlias = null)
  42. {
  43. parent::__construct($dbName, $modelName, $modelAlias);
  44. }
  45. /**
  46. * Returns a new CcMountNameQuery 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 CcMountNameQuery
  52. */
  53. public static function create($modelAlias = null, $criteria = null)
  54. {
  55. if ($criteria instanceof CcMountNameQuery) {
  56. return $criteria;
  57. }
  58. $query = new CcMountNameQuery();
  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 CcMountName|array|mixed the result, formatted by the current formatter
  77. */
  78. public function findPk($key, $con = null)
  79. {
  80. if ((null !== ($obj = CcMountNamePeer::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 CcMountNameQuery The current query, for fluid interface
  115. */
  116. public function filterByPrimaryKey($key)
  117. {
  118. return $this->addUsingAlias(CcMountNamePeer::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 CcMountNameQuery The current query, for fluid interface
  126. */
  127. public function filterByPrimaryKeys($keys)
  128. {
  129. return $this->addUsingAlias(CcMountNamePeer::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 CcMountNameQuery 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(CcMountNamePeer::ID, $dbId, $comparison);
  146. }
  147. /**
  148. * Filter the query on the mount_name column
  149. *
  150. * @param string $dbMountName 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 CcMountNameQuery The current query, for fluid interface
  155. */
  156. public function filterByDbMountName($dbMountName = null, $comparison = null)
  157. {
  158. if (null === $comparison) {
  159. if (is_array($dbMountName)) {
  160. $comparison = Criteria::IN;
  161. } elseif (preg_match('/[\%\*]/', $dbMountName)) {
  162. $dbMountName = str_replace('*', '%', $dbMountName);
  163. $comparison = Criteria::LIKE;
  164. }
  165. }
  166. return $this->addUsingAlias(CcMountNamePeer::MOUNT_NAME, $dbMountName, $comparison);
  167. }
  168. /**
  169. * Filter the query by a related CcListenerCount object
  170. *
  171. * @param CcListenerCount $ccListenerCount the related object to use as filter
  172. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  173. *
  174. * @return CcMountNameQuery The current query, for fluid interface
  175. */
  176. public function filterByCcListenerCount($ccListenerCount, $comparison = null)
  177. {
  178. return $this
  179. ->addUsingAlias(CcMountNamePeer::ID, $ccListenerCount->getDbMountNameId(), $comparison);
  180. }
  181. /**
  182. * Adds a JOIN clause to the query using the CcListenerCount relation
  183. *
  184. * @param string $relationAlias optional alias for the relation
  185. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  186. *
  187. * @return CcMountNameQuery The current query, for fluid interface
  188. */
  189. public function joinCcListenerCount($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  190. {
  191. $tableMap = $this->getTableMap();
  192. $relationMap = $tableMap->getRelation('CcListenerCount');
  193. // create a ModelJoin object for this join
  194. $join = new ModelJoin();
  195. $join->setJoinType($joinType);
  196. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  197. if ($previousJoin = $this->getPreviousJoin()) {
  198. $join->setPreviousJoin($previousJoin);
  199. }
  200. // add the ModelJoin to the current object
  201. if($relationAlias) {
  202. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  203. $this->addJoinObject($join, $relationAlias);
  204. } else {
  205. $this->addJoinObject($join, 'CcListenerCount');
  206. }
  207. return $this;
  208. }
  209. /**
  210. * Use the CcListenerCount relation CcListenerCount object
  211. *
  212. * @see useQuery()
  213. *
  214. * @param string $relationAlias optional alias for the relation,
  215. * to be used as main alias in the secondary query
  216. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  217. *
  218. * @return CcListenerCountQuery A secondary query class using the current class as primary query
  219. */
  220. public function useCcListenerCountQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
  221. {
  222. return $this
  223. ->joinCcListenerCount($relationAlias, $joinType)
  224. ->useQuery($relationAlias ? $relationAlias : 'CcListenerCount', 'CcListenerCountQuery');
  225. }
  226. /**
  227. * Exclude object from result
  228. *
  229. * @param CcMountName $ccMountName Object to remove from the list of results
  230. *
  231. * @return CcMountNameQuery The current query, for fluid interface
  232. */
  233. public function prune($ccMountName = null)
  234. {
  235. if ($ccMountName) {
  236. $this->addUsingAlias(CcMountNamePeer::ID, $ccMountName->getDbId(), Criteria::NOT_EQUAL);
  237. }
  238. return $this;
  239. }
  240. } // BaseCcMountNameQuery