BaseCcSessQuery.php 11 KB

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