BaseCcAccessQuery.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <?php
  2. /**
  3. * Base class that represents a query for the 'cc_access' table.
  4. *
  5. *
  6. *
  7. * @method CcAccessQuery orderById($order = Criteria::ASC) Order by the id column
  8. * @method CcAccessQuery orderByGunid($order = Criteria::ASC) Order by the gunid column
  9. * @method CcAccessQuery orderByToken($order = Criteria::ASC) Order by the token column
  10. * @method CcAccessQuery orderByChsum($order = Criteria::ASC) Order by the chsum column
  11. * @method CcAccessQuery orderByExt($order = Criteria::ASC) Order by the ext column
  12. * @method CcAccessQuery orderByType($order = Criteria::ASC) Order by the type column
  13. * @method CcAccessQuery orderByParent($order = Criteria::ASC) Order by the parent column
  14. * @method CcAccessQuery orderByOwner($order = Criteria::ASC) Order by the owner column
  15. * @method CcAccessQuery orderByTs($order = Criteria::ASC) Order by the ts column
  16. *
  17. * @method CcAccessQuery groupById() Group by the id column
  18. * @method CcAccessQuery groupByGunid() Group by the gunid column
  19. * @method CcAccessQuery groupByToken() Group by the token column
  20. * @method CcAccessQuery groupByChsum() Group by the chsum column
  21. * @method CcAccessQuery groupByExt() Group by the ext column
  22. * @method CcAccessQuery groupByType() Group by the type column
  23. * @method CcAccessQuery groupByParent() Group by the parent column
  24. * @method CcAccessQuery groupByOwner() Group by the owner column
  25. * @method CcAccessQuery groupByTs() Group by the ts column
  26. *
  27. * @method CcAccessQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  28. * @method CcAccessQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  29. * @method CcAccessQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  30. *
  31. * @method CcAccessQuery leftJoinCcSubjs($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSubjs relation
  32. * @method CcAccessQuery rightJoinCcSubjs($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSubjs relation
  33. * @method CcAccessQuery innerJoinCcSubjs($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSubjs relation
  34. *
  35. * @method CcAccess findOne(PropelPDO $con = null) Return the first CcAccess matching the query
  36. * @method CcAccess findOneOrCreate(PropelPDO $con = null) Return the first CcAccess matching the query, or a new CcAccess object populated from the query conditions when no match is found
  37. *
  38. * @method CcAccess findOneById(int $id) Return the first CcAccess filtered by the id column
  39. * @method CcAccess findOneByGunid(string $gunid) Return the first CcAccess filtered by the gunid column
  40. * @method CcAccess findOneByToken(string $token) Return the first CcAccess filtered by the token column
  41. * @method CcAccess findOneByChsum(string $chsum) Return the first CcAccess filtered by the chsum column
  42. * @method CcAccess findOneByExt(string $ext) Return the first CcAccess filtered by the ext column
  43. * @method CcAccess findOneByType(string $type) Return the first CcAccess filtered by the type column
  44. * @method CcAccess findOneByParent(string $parent) Return the first CcAccess filtered by the parent column
  45. * @method CcAccess findOneByOwner(int $owner) Return the first CcAccess filtered by the owner column
  46. * @method CcAccess findOneByTs(string $ts) Return the first CcAccess filtered by the ts column
  47. *
  48. * @method array findById(int $id) Return CcAccess objects filtered by the id column
  49. * @method array findByGunid(string $gunid) Return CcAccess objects filtered by the gunid column
  50. * @method array findByToken(string $token) Return CcAccess objects filtered by the token column
  51. * @method array findByChsum(string $chsum) Return CcAccess objects filtered by the chsum column
  52. * @method array findByExt(string $ext) Return CcAccess objects filtered by the ext column
  53. * @method array findByType(string $type) Return CcAccess objects filtered by the type column
  54. * @method array findByParent(string $parent) Return CcAccess objects filtered by the parent column
  55. * @method array findByOwner(int $owner) Return CcAccess objects filtered by the owner column
  56. * @method array findByTs(string $ts) Return CcAccess objects filtered by the ts column
  57. *
  58. * @package propel.generator.airtime.om
  59. */
  60. abstract class BaseCcAccessQuery extends ModelCriteria
  61. {
  62. /**
  63. * Initializes internal state of BaseCcAccessQuery object.
  64. *
  65. * @param string $dbName The dabase name
  66. * @param string $modelName The phpName of a model, e.g. 'Book'
  67. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  68. */
  69. public function __construct($dbName = 'airtime', $modelName = 'CcAccess', $modelAlias = null)
  70. {
  71. parent::__construct($dbName, $modelName, $modelAlias);
  72. }
  73. /**
  74. * Returns a new CcAccessQuery object.
  75. *
  76. * @param string $modelAlias The alias of a model in the query
  77. * @param Criteria $criteria Optional Criteria to build the query from
  78. *
  79. * @return CcAccessQuery
  80. */
  81. public static function create($modelAlias = null, $criteria = null)
  82. {
  83. if ($criteria instanceof CcAccessQuery) {
  84. return $criteria;
  85. }
  86. $query = new CcAccessQuery();
  87. if (null !== $modelAlias) {
  88. $query->setModelAlias($modelAlias);
  89. }
  90. if ($criteria instanceof Criteria) {
  91. $query->mergeWith($criteria);
  92. }
  93. return $query;
  94. }
  95. /**
  96. * Find object by primary key
  97. * Use instance pooling to avoid a database query if the object exists
  98. * <code>
  99. * $obj = $c->findPk(12, $con);
  100. * </code>
  101. * @param mixed $key Primary key to use for the query
  102. * @param PropelPDO $con an optional connection object
  103. *
  104. * @return CcAccess|array|mixed the result, formatted by the current formatter
  105. */
  106. public function findPk($key, $con = null)
  107. {
  108. if ((null !== ($obj = CcAccessPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  109. // the object is alredy in the instance pool
  110. return $obj;
  111. } else {
  112. // the object has not been requested yet, or the formatter is not an object formatter
  113. $criteria = $this->isKeepQuery() ? clone $this : $this;
  114. $stmt = $criteria
  115. ->filterByPrimaryKey($key)
  116. ->getSelectStatement($con);
  117. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  118. }
  119. }
  120. /**
  121. * Find objects by primary key
  122. * <code>
  123. * $objs = $c->findPks(array(12, 56, 832), $con);
  124. * </code>
  125. * @param array $keys Primary keys to use for the query
  126. * @param PropelPDO $con an optional connection object
  127. *
  128. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  129. */
  130. public function findPks($keys, $con = null)
  131. {
  132. $criteria = $this->isKeepQuery() ? clone $this : $this;
  133. return $this
  134. ->filterByPrimaryKeys($keys)
  135. ->find($con);
  136. }
  137. /**
  138. * Filter the query by primary key
  139. *
  140. * @param mixed $key Primary key to use for the query
  141. *
  142. * @return CcAccessQuery The current query, for fluid interface
  143. */
  144. public function filterByPrimaryKey($key)
  145. {
  146. return $this->addUsingAlias(CcAccessPeer::ID, $key, Criteria::EQUAL);
  147. }
  148. /**
  149. * Filter the query by a list of primary keys
  150. *
  151. * @param array $keys The list of primary key to use for the query
  152. *
  153. * @return CcAccessQuery The current query, for fluid interface
  154. */
  155. public function filterByPrimaryKeys($keys)
  156. {
  157. return $this->addUsingAlias(CcAccessPeer::ID, $keys, Criteria::IN);
  158. }
  159. /**
  160. * Filter the query on the id column
  161. *
  162. * @param int|array $id The value to use as filter.
  163. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  164. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  165. *
  166. * @return CcAccessQuery The current query, for fluid interface
  167. */
  168. public function filterById($id = null, $comparison = null)
  169. {
  170. if (is_array($id) && null === $comparison) {
  171. $comparison = Criteria::IN;
  172. }
  173. return $this->addUsingAlias(CcAccessPeer::ID, $id, $comparison);
  174. }
  175. /**
  176. * Filter the query on the gunid column
  177. *
  178. * @param string $gunid The value to use as filter.
  179. * Accepts wildcards (* and % trigger a LIKE)
  180. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  181. *
  182. * @return CcAccessQuery The current query, for fluid interface
  183. */
  184. public function filterByGunid($gunid = null, $comparison = null)
  185. {
  186. if (null === $comparison) {
  187. if (is_array($gunid)) {
  188. $comparison = Criteria::IN;
  189. } elseif (preg_match('/[\%\*]/', $gunid)) {
  190. $gunid = str_replace('*', '%', $gunid);
  191. $comparison = Criteria::LIKE;
  192. }
  193. }
  194. return $this->addUsingAlias(CcAccessPeer::GUNID, $gunid, $comparison);
  195. }
  196. /**
  197. * Filter the query on the token column
  198. *
  199. * @param string|array $token The value to use as filter.
  200. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  201. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  202. *
  203. * @return CcAccessQuery The current query, for fluid interface
  204. */
  205. public function filterByToken($token = null, $comparison = null)
  206. {
  207. if (is_array($token)) {
  208. $useMinMax = false;
  209. if (isset($token['min'])) {
  210. $this->addUsingAlias(CcAccessPeer::TOKEN, $token['min'], Criteria::GREATER_EQUAL);
  211. $useMinMax = true;
  212. }
  213. if (isset($token['max'])) {
  214. $this->addUsingAlias(CcAccessPeer::TOKEN, $token['max'], Criteria::LESS_EQUAL);
  215. $useMinMax = true;
  216. }
  217. if ($useMinMax) {
  218. return $this;
  219. }
  220. if (null === $comparison) {
  221. $comparison = Criteria::IN;
  222. }
  223. }
  224. return $this->addUsingAlias(CcAccessPeer::TOKEN, $token, $comparison);
  225. }
  226. /**
  227. * Filter the query on the chsum column
  228. *
  229. * @param string $chsum The value to use as filter.
  230. * Accepts wildcards (* and % trigger a LIKE)
  231. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  232. *
  233. * @return CcAccessQuery The current query, for fluid interface
  234. */
  235. public function filterByChsum($chsum = null, $comparison = null)
  236. {
  237. if (null === $comparison) {
  238. if (is_array($chsum)) {
  239. $comparison = Criteria::IN;
  240. } elseif (preg_match('/[\%\*]/', $chsum)) {
  241. $chsum = str_replace('*', '%', $chsum);
  242. $comparison = Criteria::LIKE;
  243. }
  244. }
  245. return $this->addUsingAlias(CcAccessPeer::CHSUM, $chsum, $comparison);
  246. }
  247. /**
  248. * Filter the query on the ext column
  249. *
  250. * @param string $ext The value to use as filter.
  251. * Accepts wildcards (* and % trigger a LIKE)
  252. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  253. *
  254. * @return CcAccessQuery The current query, for fluid interface
  255. */
  256. public function filterByExt($ext = null, $comparison = null)
  257. {
  258. if (null === $comparison) {
  259. if (is_array($ext)) {
  260. $comparison = Criteria::IN;
  261. } elseif (preg_match('/[\%\*]/', $ext)) {
  262. $ext = str_replace('*', '%', $ext);
  263. $comparison = Criteria::LIKE;
  264. }
  265. }
  266. return $this->addUsingAlias(CcAccessPeer::EXT, $ext, $comparison);
  267. }
  268. /**
  269. * Filter the query on the type column
  270. *
  271. * @param string $type The value to use as filter.
  272. * Accepts wildcards (* and % trigger a LIKE)
  273. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  274. *
  275. * @return CcAccessQuery The current query, for fluid interface
  276. */
  277. public function filterByType($type = null, $comparison = null)
  278. {
  279. if (null === $comparison) {
  280. if (is_array($type)) {
  281. $comparison = Criteria::IN;
  282. } elseif (preg_match('/[\%\*]/', $type)) {
  283. $type = str_replace('*', '%', $type);
  284. $comparison = Criteria::LIKE;
  285. }
  286. }
  287. return $this->addUsingAlias(CcAccessPeer::TYPE, $type, $comparison);
  288. }
  289. /**
  290. * Filter the query on the parent column
  291. *
  292. * @param string|array $parent The value to use as filter.
  293. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  294. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  295. *
  296. * @return CcAccessQuery The current query, for fluid interface
  297. */
  298. public function filterByParent($parent = null, $comparison = null)
  299. {
  300. if (is_array($parent)) {
  301. $useMinMax = false;
  302. if (isset($parent['min'])) {
  303. $this->addUsingAlias(CcAccessPeer::PARENT, $parent['min'], Criteria::GREATER_EQUAL);
  304. $useMinMax = true;
  305. }
  306. if (isset($parent['max'])) {
  307. $this->addUsingAlias(CcAccessPeer::PARENT, $parent['max'], Criteria::LESS_EQUAL);
  308. $useMinMax = true;
  309. }
  310. if ($useMinMax) {
  311. return $this;
  312. }
  313. if (null === $comparison) {
  314. $comparison = Criteria::IN;
  315. }
  316. }
  317. return $this->addUsingAlias(CcAccessPeer::PARENT, $parent, $comparison);
  318. }
  319. /**
  320. * Filter the query on the owner column
  321. *
  322. * @param int|array $owner The value to use as filter.
  323. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  324. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  325. *
  326. * @return CcAccessQuery The current query, for fluid interface
  327. */
  328. public function filterByOwner($owner = null, $comparison = null)
  329. {
  330. if (is_array($owner)) {
  331. $useMinMax = false;
  332. if (isset($owner['min'])) {
  333. $this->addUsingAlias(CcAccessPeer::OWNER, $owner['min'], Criteria::GREATER_EQUAL);
  334. $useMinMax = true;
  335. }
  336. if (isset($owner['max'])) {
  337. $this->addUsingAlias(CcAccessPeer::OWNER, $owner['max'], Criteria::LESS_EQUAL);
  338. $useMinMax = true;
  339. }
  340. if ($useMinMax) {
  341. return $this;
  342. }
  343. if (null === $comparison) {
  344. $comparison = Criteria::IN;
  345. }
  346. }
  347. return $this->addUsingAlias(CcAccessPeer::OWNER, $owner, $comparison);
  348. }
  349. /**
  350. * Filter the query on the ts column
  351. *
  352. * @param string|array $ts The value to use as filter.
  353. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  354. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  355. *
  356. * @return CcAccessQuery The current query, for fluid interface
  357. */
  358. public function filterByTs($ts = null, $comparison = null)
  359. {
  360. if (is_array($ts)) {
  361. $useMinMax = false;
  362. if (isset($ts['min'])) {
  363. $this->addUsingAlias(CcAccessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL);
  364. $useMinMax = true;
  365. }
  366. if (isset($ts['max'])) {
  367. $this->addUsingAlias(CcAccessPeer::TS, $ts['max'], Criteria::LESS_EQUAL);
  368. $useMinMax = true;
  369. }
  370. if ($useMinMax) {
  371. return $this;
  372. }
  373. if (null === $comparison) {
  374. $comparison = Criteria::IN;
  375. }
  376. }
  377. return $this->addUsingAlias(CcAccessPeer::TS, $ts, $comparison);
  378. }
  379. /**
  380. * Filter the query by a related CcSubjs object
  381. *
  382. * @param CcSubjs $ccSubjs the related object to use as filter
  383. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  384. *
  385. * @return CcAccessQuery The current query, for fluid interface
  386. */
  387. public function filterByCcSubjs($ccSubjs, $comparison = null)
  388. {
  389. return $this
  390. ->addUsingAlias(CcAccessPeer::OWNER, $ccSubjs->getDbId(), $comparison);
  391. }
  392. /**
  393. * Adds a JOIN clause to the query using the CcSubjs relation
  394. *
  395. * @param string $relationAlias optional alias for the relation
  396. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  397. *
  398. * @return CcAccessQuery The current query, for fluid interface
  399. */
  400. public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  401. {
  402. $tableMap = $this->getTableMap();
  403. $relationMap = $tableMap->getRelation('CcSubjs');
  404. // create a ModelJoin object for this join
  405. $join = new ModelJoin();
  406. $join->setJoinType($joinType);
  407. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  408. if ($previousJoin = $this->getPreviousJoin()) {
  409. $join->setPreviousJoin($previousJoin);
  410. }
  411. // add the ModelJoin to the current object
  412. if($relationAlias) {
  413. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  414. $this->addJoinObject($join, $relationAlias);
  415. } else {
  416. $this->addJoinObject($join, 'CcSubjs');
  417. }
  418. return $this;
  419. }
  420. /**
  421. * Use the CcSubjs relation CcSubjs object
  422. *
  423. * @see useQuery()
  424. *
  425. * @param string $relationAlias optional alias for the relation,
  426. * to be used as main alias in the secondary query
  427. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  428. *
  429. * @return CcSubjsQuery A secondary query class using the current class as primary query
  430. */
  431. public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN)
  432. {
  433. return $this
  434. ->joinCcSubjs($relationAlias, $joinType)
  435. ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
  436. }
  437. /**
  438. * Exclude object from result
  439. *
  440. * @param CcAccess $ccAccess Object to remove from the list of results
  441. *
  442. * @return CcAccessQuery The current query, for fluid interface
  443. */
  444. public function prune($ccAccess = null)
  445. {
  446. if ($ccAccess) {
  447. $this->addUsingAlias(CcAccessPeer::ID, $ccAccess->getId(), Criteria::NOT_EQUAL);
  448. }
  449. return $this;
  450. }
  451. } // BaseCcAccessQuery