/plugins/sfGuardPlugin/lib/model/om/BasesfGuardUserQuery.php

https://github.com/pixel-cookers/symfony_bootstrap · PHP · 766 lines · 319 code · 44 blank · 403 comment · 49 complexity · 803189ac4c51b77f073be552c042b99d MD5 · raw file

  1. <?php
  2. /**
  3. * Base class that represents a query for the 'sf_guard_user' table.
  4. *
  5. *
  6. *
  7. * This class was autogenerated by Propel 1.6.2 on:
  8. *
  9. * 09/27/11 11:02:54
  10. *
  11. * @method sfGuardUserQuery orderById($order = Criteria::ASC) Order by the id column
  12. * @method sfGuardUserQuery orderByUsername($order = Criteria::ASC) Order by the username column
  13. * @method sfGuardUserQuery orderByAlgorithm($order = Criteria::ASC) Order by the algorithm column
  14. * @method sfGuardUserQuery orderBySalt($order = Criteria::ASC) Order by the salt column
  15. * @method sfGuardUserQuery orderByPassword($order = Criteria::ASC) Order by the password column
  16. * @method sfGuardUserQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
  17. * @method sfGuardUserQuery orderByLastLogin($order = Criteria::ASC) Order by the last_login column
  18. * @method sfGuardUserQuery orderByIsActive($order = Criteria::ASC) Order by the is_active column
  19. * @method sfGuardUserQuery orderByIsSuperAdmin($order = Criteria::ASC) Order by the is_super_admin column
  20. *
  21. * @method sfGuardUserQuery groupById() Group by the id column
  22. * @method sfGuardUserQuery groupByUsername() Group by the username column
  23. * @method sfGuardUserQuery groupByAlgorithm() Group by the algorithm column
  24. * @method sfGuardUserQuery groupBySalt() Group by the salt column
  25. * @method sfGuardUserQuery groupByPassword() Group by the password column
  26. * @method sfGuardUserQuery groupByCreatedAt() Group by the created_at column
  27. * @method sfGuardUserQuery groupByLastLogin() Group by the last_login column
  28. * @method sfGuardUserQuery groupByIsActive() Group by the is_active column
  29. * @method sfGuardUserQuery groupByIsSuperAdmin() Group by the is_super_admin column
  30. *
  31. * @method sfGuardUserQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  32. * @method sfGuardUserQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  33. * @method sfGuardUserQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  34. *
  35. * @method sfGuardUserQuery leftJoinsfGuardUserProfile($relationAlias = null) Adds a LEFT JOIN clause to the query using the sfGuardUserProfile relation
  36. * @method sfGuardUserQuery rightJoinsfGuardUserProfile($relationAlias = null) Adds a RIGHT JOIN clause to the query using the sfGuardUserProfile relation
  37. * @method sfGuardUserQuery innerJoinsfGuardUserProfile($relationAlias = null) Adds a INNER JOIN clause to the query using the sfGuardUserProfile relation
  38. *
  39. * @method sfGuardUserQuery leftJoinsfGuardUserPermission($relationAlias = null) Adds a LEFT JOIN clause to the query using the sfGuardUserPermission relation
  40. * @method sfGuardUserQuery rightJoinsfGuardUserPermission($relationAlias = null) Adds a RIGHT JOIN clause to the query using the sfGuardUserPermission relation
  41. * @method sfGuardUserQuery innerJoinsfGuardUserPermission($relationAlias = null) Adds a INNER JOIN clause to the query using the sfGuardUserPermission relation
  42. *
  43. * @method sfGuardUserQuery leftJoinsfGuardUserGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the sfGuardUserGroup relation
  44. * @method sfGuardUserQuery rightJoinsfGuardUserGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the sfGuardUserGroup relation
  45. * @method sfGuardUserQuery innerJoinsfGuardUserGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the sfGuardUserGroup relation
  46. *
  47. * @method sfGuardUserQuery leftJoinsfGuardRememberKey($relationAlias = null) Adds a LEFT JOIN clause to the query using the sfGuardRememberKey relation
  48. * @method sfGuardUserQuery rightJoinsfGuardRememberKey($relationAlias = null) Adds a RIGHT JOIN clause to the query using the sfGuardRememberKey relation
  49. * @method sfGuardUserQuery innerJoinsfGuardRememberKey($relationAlias = null) Adds a INNER JOIN clause to the query using the sfGuardRememberKey relation
  50. *
  51. * @method sfGuardUser findOne(PropelPDO $con = null) Return the first sfGuardUser matching the query
  52. * @method sfGuardUser findOneOrCreate(PropelPDO $con = null) Return the first sfGuardUser matching the query, or a new sfGuardUser object populated from the query conditions when no match is found
  53. *
  54. * @method sfGuardUser findOneById(int $id) Return the first sfGuardUser filtered by the id column
  55. * @method sfGuardUser findOneByUsername(string $username) Return the first sfGuardUser filtered by the username column
  56. * @method sfGuardUser findOneByAlgorithm(string $algorithm) Return the first sfGuardUser filtered by the algorithm column
  57. * @method sfGuardUser findOneBySalt(string $salt) Return the first sfGuardUser filtered by the salt column
  58. * @method sfGuardUser findOneByPassword(string $password) Return the first sfGuardUser filtered by the password column
  59. * @method sfGuardUser findOneByCreatedAt(string $created_at) Return the first sfGuardUser filtered by the created_at column
  60. * @method sfGuardUser findOneByLastLogin(string $last_login) Return the first sfGuardUser filtered by the last_login column
  61. * @method sfGuardUser findOneByIsActive(boolean $is_active) Return the first sfGuardUser filtered by the is_active column
  62. * @method sfGuardUser findOneByIsSuperAdmin(boolean $is_super_admin) Return the first sfGuardUser filtered by the is_super_admin column
  63. *
  64. * @method array findById(int $id) Return sfGuardUser objects filtered by the id column
  65. * @method array findByUsername(string $username) Return sfGuardUser objects filtered by the username column
  66. * @method array findByAlgorithm(string $algorithm) Return sfGuardUser objects filtered by the algorithm column
  67. * @method array findBySalt(string $salt) Return sfGuardUser objects filtered by the salt column
  68. * @method array findByPassword(string $password) Return sfGuardUser objects filtered by the password column
  69. * @method array findByCreatedAt(string $created_at) Return sfGuardUser objects filtered by the created_at column
  70. * @method array findByLastLogin(string $last_login) Return sfGuardUser objects filtered by the last_login column
  71. * @method array findByIsActive(boolean $is_active) Return sfGuardUser objects filtered by the is_active column
  72. * @method array findByIsSuperAdmin(boolean $is_super_admin) Return sfGuardUser objects filtered by the is_super_admin column
  73. *
  74. * @package propel.generator.plugins.sfGuardPlugin.lib.model.om
  75. */
  76. abstract class BasesfGuardUserQuery extends ModelCriteria
  77. {
  78. /**
  79. * Initializes internal state of BasesfGuardUserQuery object.
  80. *
  81. * @param string $dbName The dabase name
  82. * @param string $modelName The phpName of a model, e.g. 'Book'
  83. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  84. */
  85. public function __construct($dbName = 'propel', $modelName = 'sfGuardUser', $modelAlias = null)
  86. {
  87. parent::__construct($dbName, $modelName, $modelAlias);
  88. }
  89. /**
  90. * Returns a new sfGuardUserQuery object.
  91. *
  92. * @param string $modelAlias The alias of a model in the query
  93. * @param Criteria $criteria Optional Criteria to build the query from
  94. *
  95. * @return sfGuardUserQuery
  96. */
  97. public static function create($modelAlias = null, $criteria = null)
  98. {
  99. if ($criteria instanceof sfGuardUserQuery) {
  100. return $criteria;
  101. }
  102. $query = new sfGuardUserQuery();
  103. if (null !== $modelAlias) {
  104. $query->setModelAlias($modelAlias);
  105. }
  106. if ($criteria instanceof Criteria) {
  107. $query->mergeWith($criteria);
  108. }
  109. return $query;
  110. }
  111. /**
  112. * Find object by primary key
  113. * Use instance pooling to avoid a database query if the object exists
  114. * <code>
  115. * $obj = $c->findPk(12, $con);
  116. * </code>
  117. * @param mixed $key Primary key to use for the query
  118. * @param PropelPDO $con an optional connection object
  119. *
  120. * @return sfGuardUser|array|mixed the result, formatted by the current formatter
  121. */
  122. public function findPk($key, $con = null)
  123. {
  124. if ((null !== ($obj = sfGuardUserPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  125. // the object is alredy in the instance pool
  126. return $obj;
  127. } else {
  128. // the object has not been requested yet, or the formatter is not an object formatter
  129. $criteria = $this->isKeepQuery() ? clone $this : $this;
  130. $stmt = $criteria
  131. ->filterByPrimaryKey($key)
  132. ->getSelectStatement($con);
  133. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  134. }
  135. }
  136. /**
  137. * Find objects by primary key
  138. * <code>
  139. * $objs = $c->findPks(array(12, 56, 832), $con);
  140. * </code>
  141. * @param array $keys Primary keys to use for the query
  142. * @param PropelPDO $con an optional connection object
  143. *
  144. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  145. */
  146. public function findPks($keys, $con = null)
  147. {
  148. $criteria = $this->isKeepQuery() ? clone $this : $this;
  149. return $this
  150. ->filterByPrimaryKeys($keys)
  151. ->find($con);
  152. }
  153. /**
  154. * Filter the query by primary key
  155. *
  156. * @param mixed $key Primary key to use for the query
  157. *
  158. * @return sfGuardUserQuery The current query, for fluid interface
  159. */
  160. public function filterByPrimaryKey($key)
  161. {
  162. return $this->addUsingAlias(sfGuardUserPeer::ID, $key, Criteria::EQUAL);
  163. }
  164. /**
  165. * Filter the query by a list of primary keys
  166. *
  167. * @param array $keys The list of primary key to use for the query
  168. *
  169. * @return sfGuardUserQuery The current query, for fluid interface
  170. */
  171. public function filterByPrimaryKeys($keys)
  172. {
  173. return $this->addUsingAlias(sfGuardUserPeer::ID, $keys, Criteria::IN);
  174. }
  175. /**
  176. * Filter the query on the id column
  177. *
  178. * Example usage:
  179. * <code>
  180. * $query->filterById(1234); // WHERE id = 1234
  181. * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
  182. * $query->filterById(array('min' => 12)); // WHERE id > 12
  183. * </code>
  184. *
  185. * @param mixed $id The value to use as filter.
  186. * Use scalar values for equality.
  187. * Use array values for in_array() equivalent.
  188. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
  189. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  190. *
  191. * @return sfGuardUserQuery The current query, for fluid interface
  192. */
  193. public function filterById($id = null, $comparison = null)
  194. {
  195. if (is_array($id) && null === $comparison) {
  196. $comparison = Criteria::IN;
  197. }
  198. return $this->addUsingAlias(sfGuardUserPeer::ID, $id, $comparison);
  199. }
  200. /**
  201. * Filter the query on the username column
  202. *
  203. * Example usage:
  204. * <code>
  205. * $query->filterByUsername('fooValue'); // WHERE username = 'fooValue'
  206. * $query->filterByUsername('%fooValue%'); // WHERE username LIKE '%fooValue%'
  207. * </code>
  208. *
  209. * @param string $username The value to use as filter.
  210. * Accepts wildcards (* and % trigger a LIKE)
  211. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  212. *
  213. * @return sfGuardUserQuery The current query, for fluid interface
  214. */
  215. public function filterByUsername($username = null, $comparison = null)
  216. {
  217. if (null === $comparison) {
  218. if (is_array($username)) {
  219. $comparison = Criteria::IN;
  220. } elseif (preg_match('/[\%\*]/', $username)) {
  221. $username = str_replace('*', '%', $username);
  222. $comparison = Criteria::LIKE;
  223. }
  224. }
  225. return $this->addUsingAlias(sfGuardUserPeer::USERNAME, $username, $comparison);
  226. }
  227. /**
  228. * Filter the query on the algorithm column
  229. *
  230. * Example usage:
  231. * <code>
  232. * $query->filterByAlgorithm('fooValue'); // WHERE algorithm = 'fooValue'
  233. * $query->filterByAlgorithm('%fooValue%'); // WHERE algorithm LIKE '%fooValue%'
  234. * </code>
  235. *
  236. * @param string $algorithm The value to use as filter.
  237. * Accepts wildcards (* and % trigger a LIKE)
  238. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  239. *
  240. * @return sfGuardUserQuery The current query, for fluid interface
  241. */
  242. public function filterByAlgorithm($algorithm = null, $comparison = null)
  243. {
  244. if (null === $comparison) {
  245. if (is_array($algorithm)) {
  246. $comparison = Criteria::IN;
  247. } elseif (preg_match('/[\%\*]/', $algorithm)) {
  248. $algorithm = str_replace('*', '%', $algorithm);
  249. $comparison = Criteria::LIKE;
  250. }
  251. }
  252. return $this->addUsingAlias(sfGuardUserPeer::ALGORITHM, $algorithm, $comparison);
  253. }
  254. /**
  255. * Filter the query on the salt column
  256. *
  257. * Example usage:
  258. * <code>
  259. * $query->filterBySalt('fooValue'); // WHERE salt = 'fooValue'
  260. * $query->filterBySalt('%fooValue%'); // WHERE salt LIKE '%fooValue%'
  261. * </code>
  262. *
  263. * @param string $salt The value to use as filter.
  264. * Accepts wildcards (* and % trigger a LIKE)
  265. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  266. *
  267. * @return sfGuardUserQuery The current query, for fluid interface
  268. */
  269. public function filterBySalt($salt = null, $comparison = null)
  270. {
  271. if (null === $comparison) {
  272. if (is_array($salt)) {
  273. $comparison = Criteria::IN;
  274. } elseif (preg_match('/[\%\*]/', $salt)) {
  275. $salt = str_replace('*', '%', $salt);
  276. $comparison = Criteria::LIKE;
  277. }
  278. }
  279. return $this->addUsingAlias(sfGuardUserPeer::SALT, $salt, $comparison);
  280. }
  281. /**
  282. * Filter the query on the password column
  283. *
  284. * Example usage:
  285. * <code>
  286. * $query->filterByPassword('fooValue'); // WHERE password = 'fooValue'
  287. * $query->filterByPassword('%fooValue%'); // WHERE password LIKE '%fooValue%'
  288. * </code>
  289. *
  290. * @param string $password The value to use as filter.
  291. * Accepts wildcards (* and % trigger a LIKE)
  292. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  293. *
  294. * @return sfGuardUserQuery The current query, for fluid interface
  295. */
  296. public function filterByPassword($password = null, $comparison = null)
  297. {
  298. if (null === $comparison) {
  299. if (is_array($password)) {
  300. $comparison = Criteria::IN;
  301. } elseif (preg_match('/[\%\*]/', $password)) {
  302. $password = str_replace('*', '%', $password);
  303. $comparison = Criteria::LIKE;
  304. }
  305. }
  306. return $this->addUsingAlias(sfGuardUserPeer::PASSWORD, $password, $comparison);
  307. }
  308. /**
  309. * Filter the query on the created_at column
  310. *
  311. * Example usage:
  312. * <code>
  313. * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
  314. * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
  315. * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
  316. * </code>
  317. *
  318. * @param mixed $createdAt The value to use as filter.
  319. * Values can be integers (unix timestamps), DateTime objects, or strings.
  320. * Empty strings are treated as NULL.
  321. * Use scalar values for equality.
  322. * Use array values for in_array() equivalent.
  323. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
  324. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  325. *
  326. * @return sfGuardUserQuery The current query, for fluid interface
  327. */
  328. public function filterByCreatedAt($createdAt = null, $comparison = null)
  329. {
  330. if (is_array($createdAt)) {
  331. $useMinMax = false;
  332. if (isset($createdAt['min'])) {
  333. $this->addUsingAlias(sfGuardUserPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
  334. $useMinMax = true;
  335. }
  336. if (isset($createdAt['max'])) {
  337. $this->addUsingAlias(sfGuardUserPeer::CREATED_AT, $createdAt['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(sfGuardUserPeer::CREATED_AT, $createdAt, $comparison);
  348. }
  349. /**
  350. * Filter the query on the last_login column
  351. *
  352. * Example usage:
  353. * <code>
  354. * $query->filterByLastLogin('2011-03-14'); // WHERE last_login = '2011-03-14'
  355. * $query->filterByLastLogin('now'); // WHERE last_login = '2011-03-14'
  356. * $query->filterByLastLogin(array('max' => 'yesterday')); // WHERE last_login > '2011-03-13'
  357. * </code>
  358. *
  359. * @param mixed $lastLogin The value to use as filter.
  360. * Values can be integers (unix timestamps), DateTime objects, or strings.
  361. * Empty strings are treated as NULL.
  362. * Use scalar values for equality.
  363. * Use array values for in_array() equivalent.
  364. * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
  365. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  366. *
  367. * @return sfGuardUserQuery The current query, for fluid interface
  368. */
  369. public function filterByLastLogin($lastLogin = null, $comparison = null)
  370. {
  371. if (is_array($lastLogin)) {
  372. $useMinMax = false;
  373. if (isset($lastLogin['min'])) {
  374. $this->addUsingAlias(sfGuardUserPeer::LAST_LOGIN, $lastLogin['min'], Criteria::GREATER_EQUAL);
  375. $useMinMax = true;
  376. }
  377. if (isset($lastLogin['max'])) {
  378. $this->addUsingAlias(sfGuardUserPeer::LAST_LOGIN, $lastLogin['max'], Criteria::LESS_EQUAL);
  379. $useMinMax = true;
  380. }
  381. if ($useMinMax) {
  382. return $this;
  383. }
  384. if (null === $comparison) {
  385. $comparison = Criteria::IN;
  386. }
  387. }
  388. return $this->addUsingAlias(sfGuardUserPeer::LAST_LOGIN, $lastLogin, $comparison);
  389. }
  390. /**
  391. * Filter the query on the is_active column
  392. *
  393. * Example usage:
  394. * <code>
  395. * $query->filterByIsActive(true); // WHERE is_active = true
  396. * $query->filterByIsActive('yes'); // WHERE is_active = true
  397. * </code>
  398. *
  399. * @param boolean|string $isActive The value to use as filter.
  400. * Non-boolean arguments are converted using the following rules:
  401. * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
  402. * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
  403. * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
  404. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  405. *
  406. * @return sfGuardUserQuery The current query, for fluid interface
  407. */
  408. public function filterByIsActive($isActive = null, $comparison = null)
  409. {
  410. if (is_string($isActive)) {
  411. $is_active = in_array(strtolower($isActive), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
  412. }
  413. return $this->addUsingAlias(sfGuardUserPeer::IS_ACTIVE, $isActive, $comparison);
  414. }
  415. /**
  416. * Filter the query on the is_super_admin column
  417. *
  418. * Example usage:
  419. * <code>
  420. * $query->filterByIsSuperAdmin(true); // WHERE is_super_admin = true
  421. * $query->filterByIsSuperAdmin('yes'); // WHERE is_super_admin = true
  422. * </code>
  423. *
  424. * @param boolean|string $isSuperAdmin The value to use as filter.
  425. * Non-boolean arguments are converted using the following rules:
  426. * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
  427. * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
  428. * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
  429. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  430. *
  431. * @return sfGuardUserQuery The current query, for fluid interface
  432. */
  433. public function filterByIsSuperAdmin($isSuperAdmin = null, $comparison = null)
  434. {
  435. if (is_string($isSuperAdmin)) {
  436. $is_super_admin = in_array(strtolower($isSuperAdmin), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
  437. }
  438. return $this->addUsingAlias(sfGuardUserPeer::IS_SUPER_ADMIN, $isSuperAdmin, $comparison);
  439. }
  440. /**
  441. * Filter the query by a related sfGuardUserProfile object
  442. *
  443. * @param sfGuardUserProfile $sfGuardUserProfile the related object to use as filter
  444. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  445. *
  446. * @return sfGuardUserQuery The current query, for fluid interface
  447. */
  448. public function filterBysfGuardUserProfile($sfGuardUserProfile, $comparison = null)
  449. {
  450. if ($sfGuardUserProfile instanceof sfGuardUserProfile) {
  451. return $this
  452. ->addUsingAlias(sfGuardUserPeer::ID, $sfGuardUserProfile->getUserId(), $comparison);
  453. } elseif ($sfGuardUserProfile instanceof PropelCollection) {
  454. return $this
  455. ->usesfGuardUserProfileQuery()
  456. ->filterByPrimaryKeys($sfGuardUserProfile->getPrimaryKeys())
  457. ->endUse();
  458. } else {
  459. throw new PropelException('filterBysfGuardUserProfile() only accepts arguments of type sfGuardUserProfile or PropelCollection');
  460. }
  461. }
  462. /**
  463. * Adds a JOIN clause to the query using the sfGuardUserProfile relation
  464. *
  465. * @param string $relationAlias optional alias for the relation
  466. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  467. *
  468. * @return sfGuardUserQuery The current query, for fluid interface
  469. */
  470. public function joinsfGuardUserProfile($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  471. {
  472. $tableMap = $this->getTableMap();
  473. $relationMap = $tableMap->getRelation('sfGuardUserProfile');
  474. // create a ModelJoin object for this join
  475. $join = new ModelJoin();
  476. $join->setJoinType($joinType);
  477. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  478. if ($previousJoin = $this->getPreviousJoin()) {
  479. $join->setPreviousJoin($previousJoin);
  480. }
  481. // add the ModelJoin to the current object
  482. if($relationAlias) {
  483. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  484. $this->addJoinObject($join, $relationAlias);
  485. } else {
  486. $this->addJoinObject($join, 'sfGuardUserProfile');
  487. }
  488. return $this;
  489. }
  490. /**
  491. * Use the sfGuardUserProfile relation sfGuardUserProfile object
  492. *
  493. * @see useQuery()
  494. *
  495. * @param string $relationAlias optional alias for the relation,
  496. * to be used as main alias in the secondary query
  497. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  498. *
  499. * @return sfGuardUserProfileQuery A secondary query class using the current class as primary query
  500. */
  501. public function usesfGuardUserProfileQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  502. {
  503. return $this
  504. ->joinsfGuardUserProfile($relationAlias, $joinType)
  505. ->useQuery($relationAlias ? $relationAlias : 'sfGuardUserProfile', 'sfGuardUserProfileQuery');
  506. }
  507. /**
  508. * Filter the query by a related sfGuardUserPermission object
  509. *
  510. * @param sfGuardUserPermission $sfGuardUserPermission the related object to use as filter
  511. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  512. *
  513. * @return sfGuardUserQuery The current query, for fluid interface
  514. */
  515. public function filterBysfGuardUserPermission($sfGuardUserPermission, $comparison = null)
  516. {
  517. if ($sfGuardUserPermission instanceof sfGuardUserPermission) {
  518. return $this
  519. ->addUsingAlias(sfGuardUserPeer::ID, $sfGuardUserPermission->getUserId(), $comparison);
  520. } elseif ($sfGuardUserPermission instanceof PropelCollection) {
  521. return $this
  522. ->usesfGuardUserPermissionQuery()
  523. ->filterByPrimaryKeys($sfGuardUserPermission->getPrimaryKeys())
  524. ->endUse();
  525. } else {
  526. throw new PropelException('filterBysfGuardUserPermission() only accepts arguments of type sfGuardUserPermission or PropelCollection');
  527. }
  528. }
  529. /**
  530. * Adds a JOIN clause to the query using the sfGuardUserPermission relation
  531. *
  532. * @param string $relationAlias optional alias for the relation
  533. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  534. *
  535. * @return sfGuardUserQuery The current query, for fluid interface
  536. */
  537. public function joinsfGuardUserPermission($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  538. {
  539. $tableMap = $this->getTableMap();
  540. $relationMap = $tableMap->getRelation('sfGuardUserPermission');
  541. // create a ModelJoin object for this join
  542. $join = new ModelJoin();
  543. $join->setJoinType($joinType);
  544. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  545. if ($previousJoin = $this->getPreviousJoin()) {
  546. $join->setPreviousJoin($previousJoin);
  547. }
  548. // add the ModelJoin to the current object
  549. if($relationAlias) {
  550. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  551. $this->addJoinObject($join, $relationAlias);
  552. } else {
  553. $this->addJoinObject($join, 'sfGuardUserPermission');
  554. }
  555. return $this;
  556. }
  557. /**
  558. * Use the sfGuardUserPermission relation sfGuardUserPermission object
  559. *
  560. * @see useQuery()
  561. *
  562. * @param string $relationAlias optional alias for the relation,
  563. * to be used as main alias in the secondary query
  564. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  565. *
  566. * @return sfGuardUserPermissionQuery A secondary query class using the current class as primary query
  567. */
  568. public function usesfGuardUserPermissionQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  569. {
  570. return $this
  571. ->joinsfGuardUserPermission($relationAlias, $joinType)
  572. ->useQuery($relationAlias ? $relationAlias : 'sfGuardUserPermission', 'sfGuardUserPermissionQuery');
  573. }
  574. /**
  575. * Filter the query by a related sfGuardUserGroup object
  576. *
  577. * @param sfGuardUserGroup $sfGuardUserGroup the related object to use as filter
  578. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  579. *
  580. * @return sfGuardUserQuery The current query, for fluid interface
  581. */
  582. public function filterBysfGuardUserGroup($sfGuardUserGroup, $comparison = null)
  583. {
  584. if ($sfGuardUserGroup instanceof sfGuardUserGroup) {
  585. return $this
  586. ->addUsingAlias(sfGuardUserPeer::ID, $sfGuardUserGroup->getUserId(), $comparison);
  587. } elseif ($sfGuardUserGroup instanceof PropelCollection) {
  588. return $this
  589. ->usesfGuardUserGroupQuery()
  590. ->filterByPrimaryKeys($sfGuardUserGroup->getPrimaryKeys())
  591. ->endUse();
  592. } else {
  593. throw new PropelException('filterBysfGuardUserGroup() only accepts arguments of type sfGuardUserGroup or PropelCollection');
  594. }
  595. }
  596. /**
  597. * Adds a JOIN clause to the query using the sfGuardUserGroup relation
  598. *
  599. * @param string $relationAlias optional alias for the relation
  600. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  601. *
  602. * @return sfGuardUserQuery The current query, for fluid interface
  603. */
  604. public function joinsfGuardUserGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  605. {
  606. $tableMap = $this->getTableMap();
  607. $relationMap = $tableMap->getRelation('sfGuardUserGroup');
  608. // create a ModelJoin object for this join
  609. $join = new ModelJoin();
  610. $join->setJoinType($joinType);
  611. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  612. if ($previousJoin = $this->getPreviousJoin()) {
  613. $join->setPreviousJoin($previousJoin);
  614. }
  615. // add the ModelJoin to the current object
  616. if($relationAlias) {
  617. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  618. $this->addJoinObject($join, $relationAlias);
  619. } else {
  620. $this->addJoinObject($join, 'sfGuardUserGroup');
  621. }
  622. return $this;
  623. }
  624. /**
  625. * Use the sfGuardUserGroup relation sfGuardUserGroup object
  626. *
  627. * @see useQuery()
  628. *
  629. * @param string $relationAlias optional alias for the relation,
  630. * to be used as main alias in the secondary query
  631. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  632. *
  633. * @return sfGuardUserGroupQuery A secondary query class using the current class as primary query
  634. */
  635. public function usesfGuardUserGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  636. {
  637. return $this
  638. ->joinsfGuardUserGroup($relationAlias, $joinType)
  639. ->useQuery($relationAlias ? $relationAlias : 'sfGuardUserGroup', 'sfGuardUserGroupQuery');
  640. }
  641. /**
  642. * Filter the query by a related sfGuardRememberKey object
  643. *
  644. * @param sfGuardRememberKey $sfGuardRememberKey the related object to use as filter
  645. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  646. *
  647. * @return sfGuardUserQuery The current query, for fluid interface
  648. */
  649. public function filterBysfGuardRememberKey($sfGuardRememberKey, $comparison = null)
  650. {
  651. if ($sfGuardRememberKey instanceof sfGuardRememberKey) {
  652. return $this
  653. ->addUsingAlias(sfGuardUserPeer::ID, $sfGuardRememberKey->getUserId(), $comparison);
  654. } elseif ($sfGuardRememberKey instanceof PropelCollection) {
  655. return $this
  656. ->usesfGuardRememberKeyQuery()
  657. ->filterByPrimaryKeys($sfGuardRememberKey->getPrimaryKeys())
  658. ->endUse();
  659. } else {
  660. throw new PropelException('filterBysfGuardRememberKey() only accepts arguments of type sfGuardRememberKey or PropelCollection');
  661. }
  662. }
  663. /**
  664. * Adds a JOIN clause to the query using the sfGuardRememberKey relation
  665. *
  666. * @param string $relationAlias optional alias for the relation
  667. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  668. *
  669. * @return sfGuardUserQuery The current query, for fluid interface
  670. */
  671. public function joinsfGuardRememberKey($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  672. {
  673. $tableMap = $this->getTableMap();
  674. $relationMap = $tableMap->getRelation('sfGuardRememberKey');
  675. // create a ModelJoin object for this join
  676. $join = new ModelJoin();
  677. $join->setJoinType($joinType);
  678. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  679. if ($previousJoin = $this->getPreviousJoin()) {
  680. $join->setPreviousJoin($previousJoin);
  681. }
  682. // add the ModelJoin to the current object
  683. if($relationAlias) {
  684. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  685. $this->addJoinObject($join, $relationAlias);
  686. } else {
  687. $this->addJoinObject($join, 'sfGuardRememberKey');
  688. }
  689. return $this;
  690. }
  691. /**
  692. * Use the sfGuardRememberKey relation sfGuardRememberKey object
  693. *
  694. * @see useQuery()
  695. *
  696. * @param string $relationAlias optional alias for the relation,
  697. * to be used as main alias in the secondary query
  698. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  699. *
  700. * @return sfGuardRememberKeyQuery A secondary query class using the current class as primary query
  701. */
  702. public function usesfGuardRememberKeyQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  703. {
  704. return $this
  705. ->joinsfGuardRememberKey($relationAlias, $joinType)
  706. ->useQuery($relationAlias ? $relationAlias : 'sfGuardRememberKey', 'sfGuardRememberKeyQuery');
  707. }
  708. /**
  709. * Exclude object from result
  710. *
  711. * @param sfGuardUser $sfGuardUser Object to remove from the list of results
  712. *
  713. * @return sfGuardUserQuery The current query, for fluid interface
  714. */
  715. public function prune($sfGuardUser = null)
  716. {
  717. if ($sfGuardUser) {
  718. $this->addUsingAlias(sfGuardUserPeer::ID, $sfGuardUser->getId(), Criteria::NOT_EQUAL);
  719. }
  720. return $this;
  721. }
  722. } // BasesfGuardUserQuery