BaseCcMusicDirsQuery.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_music_dirs' table.
  4. *
  5. *
  6. *
  7. * @method CcMusicDirsQuery orderById($order = Criteria::ASC) Order by the id column
  8. * @method CcMusicDirsQuery orderByDirectory($order = Criteria::ASC) Order by the directory column
  9. * @method CcMusicDirsQuery orderByType($order = Criteria::ASC) Order by the type column
  10. * @method CcMusicDirsQuery orderByExists($order = Criteria::ASC) Order by the exists column
  11. * @method CcMusicDirsQuery orderByWatched($order = Criteria::ASC) Order by the watched column
  12. *
  13. * @method CcMusicDirsQuery groupById() Group by the id column
  14. * @method CcMusicDirsQuery groupByDirectory() Group by the directory column
  15. * @method CcMusicDirsQuery groupByType() Group by the type column
  16. * @method CcMusicDirsQuery groupByExists() Group by the exists column
  17. * @method CcMusicDirsQuery groupByWatched() Group by the watched column
  18. *
  19. * @method CcMusicDirsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  20. * @method CcMusicDirsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  21. * @method CcMusicDirsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  22. *
  23. * @method CcMusicDirsQuery leftJoinCcFiles($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcFiles relation
  24. * @method CcMusicDirsQuery rightJoinCcFiles($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcFiles relation
  25. * @method CcMusicDirsQuery innerJoinCcFiles($relationAlias = '') Adds a INNER JOIN clause to the query using the CcFiles relation
  26. *
  27. * @method CcMusicDirs findOne(PropelPDO $con = null) Return the first CcMusicDirs matching the query
  28. * @method CcMusicDirs findOneOrCreate(PropelPDO $con = null) Return the first CcMusicDirs matching the query, or a new CcMusicDirs object populated from the query conditions when no match is found
  29. *
  30. * @method CcMusicDirs findOneById(int $id) Return the first CcMusicDirs filtered by the id column
  31. * @method CcMusicDirs findOneByDirectory(string $directory) Return the first CcMusicDirs filtered by the directory column
  32. * @method CcMusicDirs findOneByType(string $type) Return the first CcMusicDirs filtered by the type column
  33. * @method CcMusicDirs findOneByExists(boolean $exists) Return the first CcMusicDirs filtered by the exists column
  34. * @method CcMusicDirs findOneByWatched(boolean $watched) Return the first CcMusicDirs filtered by the watched column
  35. *
  36. * @method array findById(int $id) Return CcMusicDirs objects filtered by the id column
  37. * @method array findByDirectory(string $directory) Return CcMusicDirs objects filtered by the directory column
  38. * @method array findByType(string $type) Return CcMusicDirs objects filtered by the type column
  39. * @method array findByExists(boolean $exists) Return CcMusicDirs objects filtered by the exists column
  40. * @method array findByWatched(boolean $watched) Return CcMusicDirs objects filtered by the watched column
  41. *
  42. * @package propel.generator.airtime.om
  43. */
  44. abstract class BaseCcMusicDirsQuery extends ModelCriteria
  45. {
  46. /**
  47. * Initializes internal state of BaseCcMusicDirsQuery object.
  48. *
  49. * @param string $dbName The dabase name
  50. * @param string $modelName The phpName of a model, e.g. 'Book'
  51. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  52. */
  53. public function __construct($dbName = 'airtime', $modelName = 'CcMusicDirs', $modelAlias = null)
  54. {
  55. parent::__construct($dbName, $modelName, $modelAlias);
  56. }
  57. /**
  58. * Returns a new CcMusicDirsQuery object.
  59. *
  60. * @param string $modelAlias The alias of a model in the query
  61. * @param Criteria $criteria Optional Criteria to build the query from
  62. *
  63. * @return CcMusicDirsQuery
  64. */
  65. public static function create($modelAlias = null, $criteria = null)
  66. {
  67. if ($criteria instanceof CcMusicDirsQuery) {
  68. return $criteria;
  69. }
  70. $query = new CcMusicDirsQuery();
  71. if (null !== $modelAlias) {
  72. $query->setModelAlias($modelAlias);
  73. }
  74. if ($criteria instanceof Criteria) {
  75. $query->mergeWith($criteria);
  76. }
  77. return $query;
  78. }
  79. /**
  80. * Find object by primary key
  81. * Use instance pooling to avoid a database query if the object exists
  82. * <code>
  83. * $obj = $c->findPk(12, $con);
  84. * </code>
  85. * @param mixed $key Primary key to use for the query
  86. * @param PropelPDO $con an optional connection object
  87. *
  88. * @return CcMusicDirs|array|mixed the result, formatted by the current formatter
  89. */
  90. public function findPk($key, $con = null)
  91. {
  92. if ((null !== ($obj = CcMusicDirsPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  93. // the object is alredy in the instance pool
  94. return $obj;
  95. } else {
  96. // the object has not been requested yet, or the formatter is not an object formatter
  97. $criteria = $this->isKeepQuery() ? clone $this : $this;
  98. $stmt = $criteria
  99. ->filterByPrimaryKey($key)
  100. ->getSelectStatement($con);
  101. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  102. }
  103. }
  104. /**
  105. * Find objects by primary key
  106. * <code>
  107. * $objs = $c->findPks(array(12, 56, 832), $con);
  108. * </code>
  109. * @param array $keys Primary keys to use for the query
  110. * @param PropelPDO $con an optional connection object
  111. *
  112. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  113. */
  114. public function findPks($keys, $con = null)
  115. {
  116. $criteria = $this->isKeepQuery() ? clone $this : $this;
  117. return $this
  118. ->filterByPrimaryKeys($keys)
  119. ->find($con);
  120. }
  121. /**
  122. * Filter the query by primary key
  123. *
  124. * @param mixed $key Primary key to use for the query
  125. *
  126. * @return CcMusicDirsQuery The current query, for fluid interface
  127. */
  128. public function filterByPrimaryKey($key)
  129. {
  130. return $this->addUsingAlias(CcMusicDirsPeer::ID, $key, Criteria::EQUAL);
  131. }
  132. /**
  133. * Filter the query by a list of primary keys
  134. *
  135. * @param array $keys The list of primary key to use for the query
  136. *
  137. * @return CcMusicDirsQuery The current query, for fluid interface
  138. */
  139. public function filterByPrimaryKeys($keys)
  140. {
  141. return $this->addUsingAlias(CcMusicDirsPeer::ID, $keys, Criteria::IN);
  142. }
  143. /**
  144. * Filter the query on the id column
  145. *
  146. * @param int|array $id The value to use as filter.
  147. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  148. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  149. *
  150. * @return CcMusicDirsQuery The current query, for fluid interface
  151. */
  152. public function filterById($id = null, $comparison = null)
  153. {
  154. if (is_array($id) && null === $comparison) {
  155. $comparison = Criteria::IN;
  156. }
  157. return $this->addUsingAlias(CcMusicDirsPeer::ID, $id, $comparison);
  158. }
  159. /**
  160. * Filter the query on the directory column
  161. *
  162. * @param string $directory The value to use as filter.
  163. * Accepts wildcards (* and % trigger a LIKE)
  164. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  165. *
  166. * @return CcMusicDirsQuery The current query, for fluid interface
  167. */
  168. public function filterByDirectory($directory = null, $comparison = null)
  169. {
  170. if (null === $comparison) {
  171. if (is_array($directory)) {
  172. $comparison = Criteria::IN;
  173. } elseif (preg_match('/[\%\*]/', $directory)) {
  174. $directory = str_replace('*', '%', $directory);
  175. $comparison = Criteria::LIKE;
  176. }
  177. }
  178. return $this->addUsingAlias(CcMusicDirsPeer::DIRECTORY, $directory, $comparison);
  179. }
  180. /**
  181. * Filter the query on the type column
  182. *
  183. * @param string $type The value to use as filter.
  184. * Accepts wildcards (* and % trigger a LIKE)
  185. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  186. *
  187. * @return CcMusicDirsQuery The current query, for fluid interface
  188. */
  189. public function filterByType($type = null, $comparison = null)
  190. {
  191. if (null === $comparison) {
  192. if (is_array($type)) {
  193. $comparison = Criteria::IN;
  194. } elseif (preg_match('/[\%\*]/', $type)) {
  195. $type = str_replace('*', '%', $type);
  196. $comparison = Criteria::LIKE;
  197. }
  198. }
  199. return $this->addUsingAlias(CcMusicDirsPeer::TYPE, $type, $comparison);
  200. }
  201. /**
  202. * Filter the query on the exists column
  203. *
  204. * @param boolean|string $exists The value to use as filter.
  205. * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
  206. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  207. *
  208. * @return CcMusicDirsQuery The current query, for fluid interface
  209. */
  210. public function filterByExists($exists = null, $comparison = null)
  211. {
  212. if (is_string($exists)) {
  213. $exists = in_array(strtolower($exists), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
  214. }
  215. return $this->addUsingAlias(CcMusicDirsPeer::EXISTS, $exists, $comparison);
  216. }
  217. /**
  218. * Filter the query on the watched column
  219. *
  220. * @param boolean|string $watched The value to use as filter.
  221. * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
  222. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  223. *
  224. * @return CcMusicDirsQuery The current query, for fluid interface
  225. */
  226. public function filterByWatched($watched = null, $comparison = null)
  227. {
  228. if (is_string($watched)) {
  229. $watched = in_array(strtolower($watched), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
  230. }
  231. return $this->addUsingAlias(CcMusicDirsPeer::WATCHED, $watched, $comparison);
  232. }
  233. /**
  234. * Filter the query by a related CcFiles object
  235. *
  236. * @param CcFiles $ccFiles the related object to use as filter
  237. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  238. *
  239. * @return CcMusicDirsQuery The current query, for fluid interface
  240. */
  241. public function filterByCcFiles($ccFiles, $comparison = null)
  242. {
  243. return $this
  244. ->addUsingAlias(CcMusicDirsPeer::ID, $ccFiles->getDbDirectory(), $comparison);
  245. }
  246. /**
  247. * Adds a JOIN clause to the query using the CcFiles relation
  248. *
  249. * @param string $relationAlias optional alias for the relation
  250. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  251. *
  252. * @return CcMusicDirsQuery The current query, for fluid interface
  253. */
  254. public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  255. {
  256. $tableMap = $this->getTableMap();
  257. $relationMap = $tableMap->getRelation('CcFiles');
  258. // create a ModelJoin object for this join
  259. $join = new ModelJoin();
  260. $join->setJoinType($joinType);
  261. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  262. if ($previousJoin = $this->getPreviousJoin()) {
  263. $join->setPreviousJoin($previousJoin);
  264. }
  265. // add the ModelJoin to the current object
  266. if($relationAlias) {
  267. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  268. $this->addJoinObject($join, $relationAlias);
  269. } else {
  270. $this->addJoinObject($join, 'CcFiles');
  271. }
  272. return $this;
  273. }
  274. /**
  275. * Use the CcFiles relation CcFiles object
  276. *
  277. * @see useQuery()
  278. *
  279. * @param string $relationAlias optional alias for the relation,
  280. * to be used as main alias in the secondary query
  281. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  282. *
  283. * @return CcFilesQuery A secondary query class using the current class as primary query
  284. */
  285. public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  286. {
  287. return $this
  288. ->joinCcFiles($relationAlias, $joinType)
  289. ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery');
  290. }
  291. /**
  292. * Exclude object from result
  293. *
  294. * @param CcMusicDirs $ccMusicDirs Object to remove from the list of results
  295. *
  296. * @return CcMusicDirsQuery The current query, for fluid interface
  297. */
  298. public function prune($ccMusicDirs = null)
  299. {
  300. if ($ccMusicDirs) {
  301. $this->addUsingAlias(CcMusicDirsPeer::ID, $ccMusicDirs->getId(), Criteria::NOT_EQUAL);
  302. }
  303. return $this;
  304. }
  305. } // BaseCcMusicDirsQuery