/lib/model/om/BasesfGuardUserProfileQuery.php
https://github.com/pixel-cookers/symfony_bootstrap · PHP · 442 lines · 180 code · 23 blank · 239 comment · 31 complexity · 68ef3fff0c120c15d19aa13dddbde1d8 MD5 · raw file
- <?php
- /**
- * Base class that represents a query for the 'sf_guard_user_profile' table.
- *
- *
- *
- * This class was autogenerated by Propel 1.6.2 on:
- *
- * 09/27/11 11:02:53
- *
- * @method sfGuardUserProfileQuery orderById($order = Criteria::ASC) Order by the id column
- * @method sfGuardUserProfileQuery orderByUserId($order = Criteria::ASC) Order by the user_id column
- * @method sfGuardUserProfileQuery orderByGenre($order = Criteria::ASC) Order by the genre column
- * @method sfGuardUserProfileQuery orderByFirstName($order = Criteria::ASC) Order by the first_name column
- * @method sfGuardUserProfileQuery orderByLastName($order = Criteria::ASC) Order by the last_name column
- * @method sfGuardUserProfileQuery orderByEmail($order = Criteria::ASC) Order by the email column
- *
- * @method sfGuardUserProfileQuery groupById() Group by the id column
- * @method sfGuardUserProfileQuery groupByUserId() Group by the user_id column
- * @method sfGuardUserProfileQuery groupByGenre() Group by the genre column
- * @method sfGuardUserProfileQuery groupByFirstName() Group by the first_name column
- * @method sfGuardUserProfileQuery groupByLastName() Group by the last_name column
- * @method sfGuardUserProfileQuery groupByEmail() Group by the email column
- *
- * @method sfGuardUserProfileQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
- * @method sfGuardUserProfileQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
- * @method sfGuardUserProfileQuery innerJoin($relation) Adds a INNER JOIN clause to the query
- *
- * @method sfGuardUserProfileQuery leftJoinsfGuardUser($relationAlias = null) Adds a LEFT JOIN clause to the query using the sfGuardUser relation
- * @method sfGuardUserProfileQuery rightJoinsfGuardUser($relationAlias = null) Adds a RIGHT JOIN clause to the query using the sfGuardUser relation
- * @method sfGuardUserProfileQuery innerJoinsfGuardUser($relationAlias = null) Adds a INNER JOIN clause to the query using the sfGuardUser relation
- *
- * @method sfGuardUserProfile findOne(PropelPDO $con = null) Return the first sfGuardUserProfile matching the query
- * @method sfGuardUserProfile findOneOrCreate(PropelPDO $con = null) Return the first sfGuardUserProfile matching the query, or a new sfGuardUserProfile object populated from the query conditions when no match is found
- *
- * @method sfGuardUserProfile findOneById(int $id) Return the first sfGuardUserProfile filtered by the id column
- * @method sfGuardUserProfile findOneByUserId(int $user_id) Return the first sfGuardUserProfile filtered by the user_id column
- * @method sfGuardUserProfile findOneByGenre(int $genre) Return the first sfGuardUserProfile filtered by the genre column
- * @method sfGuardUserProfile findOneByFirstName(string $first_name) Return the first sfGuardUserProfile filtered by the first_name column
- * @method sfGuardUserProfile findOneByLastName(string $last_name) Return the first sfGuardUserProfile filtered by the last_name column
- * @method sfGuardUserProfile findOneByEmail(string $email) Return the first sfGuardUserProfile filtered by the email column
- *
- * @method array findById(int $id) Return sfGuardUserProfile objects filtered by the id column
- * @method array findByUserId(int $user_id) Return sfGuardUserProfile objects filtered by the user_id column
- * @method array findByGenre(int $genre) Return sfGuardUserProfile objects filtered by the genre column
- * @method array findByFirstName(string $first_name) Return sfGuardUserProfile objects filtered by the first_name column
- * @method array findByLastName(string $last_name) Return sfGuardUserProfile objects filtered by the last_name column
- * @method array findByEmail(string $email) Return sfGuardUserProfile objects filtered by the email column
- *
- * @package propel.generator.lib.model.om
- */
- abstract class BasesfGuardUserProfileQuery extends ModelCriteria
- {
-
- /**
- * Initializes internal state of BasesfGuardUserProfileQuery object.
- *
- * @param string $dbName The dabase name
- * @param string $modelName The phpName of a model, e.g. 'Book'
- * @param string $modelAlias The alias for the model in this query, e.g. 'b'
- */
- public function __construct($dbName = 'propel', $modelName = 'sfGuardUserProfile', $modelAlias = null)
- {
- parent::__construct($dbName, $modelName, $modelAlias);
- }
- /**
- * Returns a new sfGuardUserProfileQuery object.
- *
- * @param string $modelAlias The alias of a model in the query
- * @param Criteria $criteria Optional Criteria to build the query from
- *
- * @return sfGuardUserProfileQuery
- */
- public static function create($modelAlias = null, $criteria = null)
- {
- if ($criteria instanceof sfGuardUserProfileQuery) {
- return $criteria;
- }
- $query = new sfGuardUserProfileQuery();
- if (null !== $modelAlias) {
- $query->setModelAlias($modelAlias);
- }
- if ($criteria instanceof Criteria) {
- $query->mergeWith($criteria);
- }
- return $query;
- }
- /**
- * Find object by primary key
- * Use instance pooling to avoid a database query if the object exists
- * <code>
- * $obj = $c->findPk(12, $con);
- * </code>
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con an optional connection object
- *
- * @return sfGuardUserProfile|array|mixed the result, formatted by the current formatter
- */
- public function findPk($key, $con = null)
- {
- if ((null !== ($obj = sfGuardUserProfilePeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
- // the object is alredy in the instance pool
- return $obj;
- } else {
- // the object has not been requested yet, or the formatter is not an object formatter
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $stmt = $criteria
- ->filterByPrimaryKey($key)
- ->getSelectStatement($con);
- return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
- }
- }
- /**
- * Find objects by primary key
- * <code>
- * $objs = $c->findPks(array(12, 56, 832), $con);
- * </code>
- * @param array $keys Primary keys to use for the query
- * @param PropelPDO $con an optional connection object
- *
- * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
- */
- public function findPks($keys, $con = null)
- {
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- return $this
- ->filterByPrimaryKeys($keys)
- ->find($con);
- }
- /**
- * Filter the query by primary key
- *
- * @param mixed $key Primary key to use for the query
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByPrimaryKey($key)
- {
- return $this->addUsingAlias(sfGuardUserProfilePeer::ID, $key, Criteria::EQUAL);
- }
- /**
- * Filter the query by a list of primary keys
- *
- * @param array $keys The list of primary key to use for the query
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByPrimaryKeys($keys)
- {
- return $this->addUsingAlias(sfGuardUserProfilePeer::ID, $keys, Criteria::IN);
- }
- /**
- * Filter the query on the id column
- *
- * Example usage:
- * <code>
- * $query->filterById(1234); // WHERE id = 1234
- * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
- * $query->filterById(array('min' => 12)); // WHERE id > 12
- * </code>
- *
- * @param mixed $id The value to use as filter.
- * Use scalar values for equality.
- * Use array values for in_array() equivalent.
- * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterById($id = null, $comparison = null)
- {
- if (is_array($id) && null === $comparison) {
- $comparison = Criteria::IN;
- }
- return $this->addUsingAlias(sfGuardUserProfilePeer::ID, $id, $comparison);
- }
- /**
- * Filter the query on the user_id column
- *
- * Example usage:
- * <code>
- * $query->filterByUserId(1234); // WHERE user_id = 1234
- * $query->filterByUserId(array(12, 34)); // WHERE user_id IN (12, 34)
- * $query->filterByUserId(array('min' => 12)); // WHERE user_id > 12
- * </code>
- *
- * @see filterBysfGuardUser()
- *
- * @param mixed $userId The value to use as filter.
- * Use scalar values for equality.
- * Use array values for in_array() equivalent.
- * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByUserId($userId = null, $comparison = null)
- {
- if (is_array($userId)) {
- $useMinMax = false;
- if (isset($userId['min'])) {
- $this->addUsingAlias(sfGuardUserProfilePeer::USER_ID, $userId['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($userId['max'])) {
- $this->addUsingAlias(sfGuardUserProfilePeer::USER_ID, $userId['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
- return $this->addUsingAlias(sfGuardUserProfilePeer::USER_ID, $userId, $comparison);
- }
- /**
- * Filter the query on the genre column
- *
- * Example usage:
- * <code>
- * $query->filterByGenre(1234); // WHERE genre = 1234
- * $query->filterByGenre(array(12, 34)); // WHERE genre IN (12, 34)
- * $query->filterByGenre(array('min' => 12)); // WHERE genre > 12
- * </code>
- *
- * @param mixed $genre The value to use as filter.
- * Use scalar values for equality.
- * Use array values for in_array() equivalent.
- * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByGenre($genre = null, $comparison = null)
- {
- if (is_array($genre)) {
- $useMinMax = false;
- if (isset($genre['min'])) {
- $this->addUsingAlias(sfGuardUserProfilePeer::GENRE, $genre['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($genre['max'])) {
- $this->addUsingAlias(sfGuardUserProfilePeer::GENRE, $genre['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
- return $this->addUsingAlias(sfGuardUserProfilePeer::GENRE, $genre, $comparison);
- }
- /**
- * Filter the query on the first_name column
- *
- * Example usage:
- * <code>
- * $query->filterByFirstName('fooValue'); // WHERE first_name = 'fooValue'
- * $query->filterByFirstName('%fooValue%'); // WHERE first_name LIKE '%fooValue%'
- * </code>
- *
- * @param string $firstName The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByFirstName($firstName = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($firstName)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $firstName)) {
- $firstName = str_replace('*', '%', $firstName);
- $comparison = Criteria::LIKE;
- }
- }
- return $this->addUsingAlias(sfGuardUserProfilePeer::FIRST_NAME, $firstName, $comparison);
- }
- /**
- * Filter the query on the last_name column
- *
- * Example usage:
- * <code>
- * $query->filterByLastName('fooValue'); // WHERE last_name = 'fooValue'
- * $query->filterByLastName('%fooValue%'); // WHERE last_name LIKE '%fooValue%'
- * </code>
- *
- * @param string $lastName The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByLastName($lastName = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($lastName)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $lastName)) {
- $lastName = str_replace('*', '%', $lastName);
- $comparison = Criteria::LIKE;
- }
- }
- return $this->addUsingAlias(sfGuardUserProfilePeer::LAST_NAME, $lastName, $comparison);
- }
- /**
- * Filter the query on the email column
- *
- * Example usage:
- * <code>
- * $query->filterByEmail('fooValue'); // WHERE email = 'fooValue'
- * $query->filterByEmail('%fooValue%'); // WHERE email LIKE '%fooValue%'
- * </code>
- *
- * @param string $email The value to use as filter.
- * Accepts wildcards (* and % trigger a LIKE)
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterByEmail($email = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($email)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $email)) {
- $email = str_replace('*', '%', $email);
- $comparison = Criteria::LIKE;
- }
- }
- return $this->addUsingAlias(sfGuardUserProfilePeer::EMAIL, $email, $comparison);
- }
- /**
- * Filter the query by a related sfGuardUser object
- *
- * @param sfGuardUser|PropelCollection $sfGuardUser The related object(s) to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function filterBysfGuardUser($sfGuardUser, $comparison = null)
- {
- if ($sfGuardUser instanceof sfGuardUser) {
- return $this
- ->addUsingAlias(sfGuardUserProfilePeer::USER_ID, $sfGuardUser->getId(), $comparison);
- } elseif ($sfGuardUser instanceof PropelCollection) {
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- return $this
- ->addUsingAlias(sfGuardUserProfilePeer::USER_ID, $sfGuardUser->toKeyValue('PrimaryKey', 'Id'), $comparison);
- } else {
- throw new PropelException('filterBysfGuardUser() only accepts arguments of type sfGuardUser or PropelCollection');
- }
- }
- /**
- * Adds a JOIN clause to the query using the sfGuardUser relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function joinsfGuardUser($relationAlias = null, $joinType = Criteria::INNER_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('sfGuardUser');
- // create a ModelJoin object for this join
- $join = new ModelJoin();
- $join->setJoinType($joinType);
- $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
- if ($previousJoin = $this->getPreviousJoin()) {
- $join->setPreviousJoin($previousJoin);
- }
- // add the ModelJoin to the current object
- if($relationAlias) {
- $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
- $this->addJoinObject($join, $relationAlias);
- } else {
- $this->addJoinObject($join, 'sfGuardUser');
- }
- return $this;
- }
- /**
- * Use the sfGuardUser relation sfGuardUser object
- *
- * @see useQuery()
- *
- * @param string $relationAlias optional alias for the relation,
- * to be used as main alias in the secondary query
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return sfGuardUserQuery A secondary query class using the current class as primary query
- */
- public function usesfGuardUserQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
- {
- return $this
- ->joinsfGuardUser($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'sfGuardUser', 'sfGuardUserQuery');
- }
- /**
- * Exclude object from result
- *
- * @param sfGuardUserProfile $sfGuardUserProfile Object to remove from the list of results
- *
- * @return sfGuardUserProfileQuery The current query, for fluid interface
- */
- public function prune($sfGuardUserProfile = null)
- {
- if ($sfGuardUserProfile) {
- $this->addUsingAlias(sfGuardUserProfilePeer::ID, $sfGuardUserProfile->getId(), Criteria::NOT_EQUAL);
- }
- return $this;
- }
- } // BasesfGuardUserProfileQuery