<?php

namespace ArtabanMarketplace\Model\Base;

use \Exception;
use \PDO;
use ArtabanMarketplace\Model\AmpSellerVersion as ChildAmpSellerVersion;
use ArtabanMarketplace\Model\AmpSellerVersionQuery as ChildAmpSellerVersionQuery;
use ArtabanMarketplace\Model\Map\AmpSellerVersionTableMap;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveQuery\ModelJoin;
use Propel\Runtime\Collection\Collection;
use Propel\Runtime\Collection\ObjectCollection;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;

/**
 * Base class that represents a query for the 'amp_seller_version' table.
 *
 *
 *
 * @method     ChildAmpSellerVersionQuery orderById($order = Criteria::ASC) Order by the id column
 * @method     ChildAmpSellerVersionQuery orderByRef($order = Criteria::ASC) Order by the ref column
 * @method     ChildAmpSellerVersionQuery orderByVisible($order = Criteria::ASC) Order by the visible column
 * @method     ChildAmpSellerVersionQuery orderByAddress1($order = Criteria::ASC) Order by the address1 column
 * @method     ChildAmpSellerVersionQuery orderByAddress2($order = Criteria::ASC) Order by the address2 column
 * @method     ChildAmpSellerVersionQuery orderByAddress3($order = Criteria::ASC) Order by the address3 column
 * @method     ChildAmpSellerVersionQuery orderByZipcode($order = Criteria::ASC) Order by the zipcode column
 * @method     ChildAmpSellerVersionQuery orderByCity($order = Criteria::ASC) Order by the city column
 * @method     ChildAmpSellerVersionQuery orderByCountryId($order = Criteria::ASC) Order by the country_id column
 * @method     ChildAmpSellerVersionQuery orderByEmail($order = Criteria::ASC) Order by the email column
 * @method     ChildAmpSellerVersionQuery orderByPhone($order = Criteria::ASC) Order by the phone column
 * @method     ChildAmpSellerVersionQuery orderByFax($order = Criteria::ASC) Order by the fax column
 * @method     ChildAmpSellerVersionQuery orderByUrl($order = Criteria::ASC) Order by the url column
 * @method     ChildAmpSellerVersionQuery orderByFacebook($order = Criteria::ASC) Order by the facebook column
 * @method     ChildAmpSellerVersionQuery orderByTwitter($order = Criteria::ASC) Order by the twitter column
 * @method     ChildAmpSellerVersionQuery orderByPinterest($order = Criteria::ASC) Order by the pinterest column
 * @method     ChildAmpSellerVersionQuery orderByGoogle($order = Criteria::ASC) Order by the google column
 * @method     ChildAmpSellerVersionQuery orderByYoutube($order = Criteria::ASC) Order by the youtube column
 * @method     ChildAmpSellerVersionQuery orderByInstagram($order = Criteria::ASC) Order by the instagram column
 * @method     ChildAmpSellerVersionQuery orderByLatitude($order = Criteria::ASC) Order by the latitude column
 * @method     ChildAmpSellerVersionQuery orderByLongitude($order = Criteria::ASC) Order by the longitude column
 * @method     ChildAmpSellerVersionQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
 * @method     ChildAmpSellerVersionQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
 * @method     ChildAmpSellerVersionQuery orderByVersion($order = Criteria::ASC) Order by the version column
 * @method     ChildAmpSellerVersionQuery orderByVersionCreatedAt($order = Criteria::ASC) Order by the version_created_at column
 * @method     ChildAmpSellerVersionQuery orderByVersionCreatedBy($order = Criteria::ASC) Order by the version_created_by column
 * @method     ChildAmpSellerVersionQuery orderByAmpSellerAdminIds($order = Criteria::ASC) Order by the amp_seller_admin_ids column
 * @method     ChildAmpSellerVersionQuery orderByAmpSellerAdminVersions($order = Criteria::ASC) Order by the amp_seller_admin_versions column
 * @method     ChildAmpSellerVersionQuery orderByAmpSellerProductIds($order = Criteria::ASC) Order by the amp_seller_product_ids column
 * @method     ChildAmpSellerVersionQuery orderByAmpSellerProductVersions($order = Criteria::ASC) Order by the amp_seller_product_versions column
 * @method     ChildAmpSellerVersionQuery orderByAmpSellerOrderIds($order = Criteria::ASC) Order by the amp_seller_order_ids column
 * @method     ChildAmpSellerVersionQuery orderByAmpSellerOrderVersions($order = Criteria::ASC) Order by the amp_seller_order_versions column
 *
 * @method     ChildAmpSellerVersionQuery groupById() Group by the id column
 * @method     ChildAmpSellerVersionQuery groupByRef() Group by the ref column
 * @method     ChildAmpSellerVersionQuery groupByVisible() Group by the visible column
 * @method     ChildAmpSellerVersionQuery groupByAddress1() Group by the address1 column
 * @method     ChildAmpSellerVersionQuery groupByAddress2() Group by the address2 column
 * @method     ChildAmpSellerVersionQuery groupByAddress3() Group by the address3 column
 * @method     ChildAmpSellerVersionQuery groupByZipcode() Group by the zipcode column
 * @method     ChildAmpSellerVersionQuery groupByCity() Group by the city column
 * @method     ChildAmpSellerVersionQuery groupByCountryId() Group by the country_id column
 * @method     ChildAmpSellerVersionQuery groupByEmail() Group by the email column
 * @method     ChildAmpSellerVersionQuery groupByPhone() Group by the phone column
 * @method     ChildAmpSellerVersionQuery groupByFax() Group by the fax column
 * @method     ChildAmpSellerVersionQuery groupByUrl() Group by the url column
 * @method     ChildAmpSellerVersionQuery groupByFacebook() Group by the facebook column
 * @method     ChildAmpSellerVersionQuery groupByTwitter() Group by the twitter column
 * @method     ChildAmpSellerVersionQuery groupByPinterest() Group by the pinterest column
 * @method     ChildAmpSellerVersionQuery groupByGoogle() Group by the google column
 * @method     ChildAmpSellerVersionQuery groupByYoutube() Group by the youtube column
 * @method     ChildAmpSellerVersionQuery groupByInstagram() Group by the instagram column
 * @method     ChildAmpSellerVersionQuery groupByLatitude() Group by the latitude column
 * @method     ChildAmpSellerVersionQuery groupByLongitude() Group by the longitude column
 * @method     ChildAmpSellerVersionQuery groupByCreatedAt() Group by the created_at column
 * @method     ChildAmpSellerVersionQuery groupByUpdatedAt() Group by the updated_at column
 * @method     ChildAmpSellerVersionQuery groupByVersion() Group by the version column
 * @method     ChildAmpSellerVersionQuery groupByVersionCreatedAt() Group by the version_created_at column
 * @method     ChildAmpSellerVersionQuery groupByVersionCreatedBy() Group by the version_created_by column
 * @method     ChildAmpSellerVersionQuery groupByAmpSellerAdminIds() Group by the amp_seller_admin_ids column
 * @method     ChildAmpSellerVersionQuery groupByAmpSellerAdminVersions() Group by the amp_seller_admin_versions column
 * @method     ChildAmpSellerVersionQuery groupByAmpSellerProductIds() Group by the amp_seller_product_ids column
 * @method     ChildAmpSellerVersionQuery groupByAmpSellerProductVersions() Group by the amp_seller_product_versions column
 * @method     ChildAmpSellerVersionQuery groupByAmpSellerOrderIds() Group by the amp_seller_order_ids column
 * @method     ChildAmpSellerVersionQuery groupByAmpSellerOrderVersions() Group by the amp_seller_order_versions column
 *
 * @method     ChildAmpSellerVersionQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method     ChildAmpSellerVersionQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method     ChildAmpSellerVersionQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method     ChildAmpSellerVersionQuery leftJoinAmpSeller($relationAlias = null) Adds a LEFT JOIN clause to the query using the AmpSeller relation
 * @method     ChildAmpSellerVersionQuery rightJoinAmpSeller($relationAlias = null) Adds a RIGHT JOIN clause to the query using the AmpSeller relation
 * @method     ChildAmpSellerVersionQuery innerJoinAmpSeller($relationAlias = null) Adds a INNER JOIN clause to the query using the AmpSeller relation
 *
 * @method     ChildAmpSellerVersion findOne(ConnectionInterface $con = null) Return the first ChildAmpSellerVersion matching the query
 * @method     ChildAmpSellerVersion findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAmpSellerVersion matching the query, or a new ChildAmpSellerVersion object populated from the query conditions when no match is found
 *
 * @method     ChildAmpSellerVersion findOneById(int $id) Return the first ChildAmpSellerVersion filtered by the id column
 * @method     ChildAmpSellerVersion findOneByRef(string $ref) Return the first ChildAmpSellerVersion filtered by the ref column
 * @method     ChildAmpSellerVersion findOneByVisible(int $visible) Return the first ChildAmpSellerVersion filtered by the visible column
 * @method     ChildAmpSellerVersion findOneByAddress1(string $address1) Return the first ChildAmpSellerVersion filtered by the address1 column
 * @method     ChildAmpSellerVersion findOneByAddress2(string $address2) Return the first ChildAmpSellerVersion filtered by the address2 column
 * @method     ChildAmpSellerVersion findOneByAddress3(string $address3) Return the first ChildAmpSellerVersion filtered by the address3 column
 * @method     ChildAmpSellerVersion findOneByZipcode(string $zipcode) Return the first ChildAmpSellerVersion filtered by the zipcode column
 * @method     ChildAmpSellerVersion findOneByCity(string $city) Return the first ChildAmpSellerVersion filtered by the city column
 * @method     ChildAmpSellerVersion findOneByCountryId(int $country_id) Return the first ChildAmpSellerVersion filtered by the country_id column
 * @method     ChildAmpSellerVersion findOneByEmail(string $email) Return the first ChildAmpSellerVersion filtered by the email column
 * @method     ChildAmpSellerVersion findOneByPhone(string $phone) Return the first ChildAmpSellerVersion filtered by the phone column
 * @method     ChildAmpSellerVersion findOneByFax(string $fax) Return the first ChildAmpSellerVersion filtered by the fax column
 * @method     ChildAmpSellerVersion findOneByUrl(string $url) Return the first ChildAmpSellerVersion filtered by the url column
 * @method     ChildAmpSellerVersion findOneByFacebook(string $facebook) Return the first ChildAmpSellerVersion filtered by the facebook column
 * @method     ChildAmpSellerVersion findOneByTwitter(string $twitter) Return the first ChildAmpSellerVersion filtered by the twitter column
 * @method     ChildAmpSellerVersion findOneByPinterest(string $pinterest) Return the first ChildAmpSellerVersion filtered by the pinterest column
 * @method     ChildAmpSellerVersion findOneByGoogle(string $google) Return the first ChildAmpSellerVersion filtered by the google column
 * @method     ChildAmpSellerVersion findOneByYoutube(string $youtube) Return the first ChildAmpSellerVersion filtered by the youtube column
 * @method     ChildAmpSellerVersion findOneByInstagram(string $instagram) Return the first ChildAmpSellerVersion filtered by the instagram column
 * @method     ChildAmpSellerVersion findOneByLatitude(string $latitude) Return the first ChildAmpSellerVersion filtered by the latitude column
 * @method     ChildAmpSellerVersion findOneByLongitude(string $longitude) Return the first ChildAmpSellerVersion filtered by the longitude column
 * @method     ChildAmpSellerVersion findOneByCreatedAt(string $created_at) Return the first ChildAmpSellerVersion filtered by the created_at column
 * @method     ChildAmpSellerVersion findOneByUpdatedAt(string $updated_at) Return the first ChildAmpSellerVersion filtered by the updated_at column
 * @method     ChildAmpSellerVersion findOneByVersion(int $version) Return the first ChildAmpSellerVersion filtered by the version column
 * @method     ChildAmpSellerVersion findOneByVersionCreatedAt(string $version_created_at) Return the first ChildAmpSellerVersion filtered by the version_created_at column
 * @method     ChildAmpSellerVersion findOneByVersionCreatedBy(string $version_created_by) Return the first ChildAmpSellerVersion filtered by the version_created_by column
 * @method     ChildAmpSellerVersion findOneByAmpSellerAdminIds(array $amp_seller_admin_ids) Return the first ChildAmpSellerVersion filtered by the amp_seller_admin_ids column
 * @method     ChildAmpSellerVersion findOneByAmpSellerAdminVersions(array $amp_seller_admin_versions) Return the first ChildAmpSellerVersion filtered by the amp_seller_admin_versions column
 * @method     ChildAmpSellerVersion findOneByAmpSellerProductIds(array $amp_seller_product_ids) Return the first ChildAmpSellerVersion filtered by the amp_seller_product_ids column
 * @method     ChildAmpSellerVersion findOneByAmpSellerProductVersions(array $amp_seller_product_versions) Return the first ChildAmpSellerVersion filtered by the amp_seller_product_versions column
 * @method     ChildAmpSellerVersion findOneByAmpSellerOrderIds(array $amp_seller_order_ids) Return the first ChildAmpSellerVersion filtered by the amp_seller_order_ids column
 * @method     ChildAmpSellerVersion findOneByAmpSellerOrderVersions(array $amp_seller_order_versions) Return the first ChildAmpSellerVersion filtered by the amp_seller_order_versions column
 *
 * @method     array findById(int $id) Return ChildAmpSellerVersion objects filtered by the id column
 * @method     array findByRef(string $ref) Return ChildAmpSellerVersion objects filtered by the ref column
 * @method     array findByVisible(int $visible) Return ChildAmpSellerVersion objects filtered by the visible column
 * @method     array findByAddress1(string $address1) Return ChildAmpSellerVersion objects filtered by the address1 column
 * @method     array findByAddress2(string $address2) Return ChildAmpSellerVersion objects filtered by the address2 column
 * @method     array findByAddress3(string $address3) Return ChildAmpSellerVersion objects filtered by the address3 column
 * @method     array findByZipcode(string $zipcode) Return ChildAmpSellerVersion objects filtered by the zipcode column
 * @method     array findByCity(string $city) Return ChildAmpSellerVersion objects filtered by the city column
 * @method     array findByCountryId(int $country_id) Return ChildAmpSellerVersion objects filtered by the country_id column
 * @method     array findByEmail(string $email) Return ChildAmpSellerVersion objects filtered by the email column
 * @method     array findByPhone(string $phone) Return ChildAmpSellerVersion objects filtered by the phone column
 * @method     array findByFax(string $fax) Return ChildAmpSellerVersion objects filtered by the fax column
 * @method     array findByUrl(string $url) Return ChildAmpSellerVersion objects filtered by the url column
 * @method     array findByFacebook(string $facebook) Return ChildAmpSellerVersion objects filtered by the facebook column
 * @method     array findByTwitter(string $twitter) Return ChildAmpSellerVersion objects filtered by the twitter column
 * @method     array findByPinterest(string $pinterest) Return ChildAmpSellerVersion objects filtered by the pinterest column
 * @method     array findByGoogle(string $google) Return ChildAmpSellerVersion objects filtered by the google column
 * @method     array findByYoutube(string $youtube) Return ChildAmpSellerVersion objects filtered by the youtube column
 * @method     array findByInstagram(string $instagram) Return ChildAmpSellerVersion objects filtered by the instagram column
 * @method     array findByLatitude(string $latitude) Return ChildAmpSellerVersion objects filtered by the latitude column
 * @method     array findByLongitude(string $longitude) Return ChildAmpSellerVersion objects filtered by the longitude column
 * @method     array findByCreatedAt(string $created_at) Return ChildAmpSellerVersion objects filtered by the created_at column
 * @method     array findByUpdatedAt(string $updated_at) Return ChildAmpSellerVersion objects filtered by the updated_at column
 * @method     array findByVersion(int $version) Return ChildAmpSellerVersion objects filtered by the version column
 * @method     array findByVersionCreatedAt(string $version_created_at) Return ChildAmpSellerVersion objects filtered by the version_created_at column
 * @method     array findByVersionCreatedBy(string $version_created_by) Return ChildAmpSellerVersion objects filtered by the version_created_by column
 * @method     array findByAmpSellerAdminIds(array $amp_seller_admin_ids) Return ChildAmpSellerVersion objects filtered by the amp_seller_admin_ids column
 * @method     array findByAmpSellerAdminVersions(array $amp_seller_admin_versions) Return ChildAmpSellerVersion objects filtered by the amp_seller_admin_versions column
 * @method     array findByAmpSellerProductIds(array $amp_seller_product_ids) Return ChildAmpSellerVersion objects filtered by the amp_seller_product_ids column
 * @method     array findByAmpSellerProductVersions(array $amp_seller_product_versions) Return ChildAmpSellerVersion objects filtered by the amp_seller_product_versions column
 * @method     array findByAmpSellerOrderIds(array $amp_seller_order_ids) Return ChildAmpSellerVersion objects filtered by the amp_seller_order_ids column
 * @method     array findByAmpSellerOrderVersions(array $amp_seller_order_versions) Return ChildAmpSellerVersion objects filtered by the amp_seller_order_versions column
 *
 */
abstract class AmpSellerVersionQuery extends ModelCriteria
{

    /**
     * Initializes internal state of \ArtabanMarketplace\Model\Base\AmpSellerVersionQuery object.
     *
     * @param     string $dbName The database 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 = 'thelia', $modelName = '\\ArtabanMarketplace\\Model\\AmpSellerVersion', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new ChildAmpSellerVersionQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     Criteria $criteria Optional Criteria to build the query from
     *
     * @return ChildAmpSellerVersionQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof \ArtabanMarketplace\Model\AmpSellerVersionQuery) {
            return $criteria;
        }
        $query = new \ArtabanMarketplace\Model\AmpSellerVersionQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj = $c->findPk(array(12, 34), $con);
     * </code>
     *
     * @param array[$id, $version] $key Primary key to use for the query
     * @param ConnectionInterface $con an optional connection object
     *
     * @return ChildAmpSellerVersion|array|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = AmpSellerVersionTableMap::getInstanceFromPool(serialize(array((string) $key[0], (string) $key[1]))))) && !$this->formatter) {
            // the object is already in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getServiceContainer()->getReadConnection(AmpSellerVersionTableMap::DATABASE_NAME);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     ConnectionInterface $con A connection object
     *
     * @return   ChildAmpSellerVersion A model object, or null if the key is not found
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT ID, REF, VISIBLE, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, EMAIL, PHONE, FAX, URL, FACEBOOK, TWITTER, PINTEREST, GOOGLE, YOUTUBE, INSTAGRAM, LATITUDE, LONGITUDE, CREATED_AT, UPDATED_AT, VERSION, VERSION_CREATED_AT, VERSION_CREATED_BY, AMP_SELLER_ADMIN_IDS, AMP_SELLER_ADMIN_VERSIONS, AMP_SELLER_PRODUCT_IDS, AMP_SELLER_PRODUCT_VERSIONS, AMP_SELLER_ORDER_IDS, AMP_SELLER_ORDER_VERSIONS FROM amp_seller_version WHERE ID = :p0 AND VERSION = :p1';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
            $stmt->bindValue(':p1', $key[1], PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
            $obj = new ChildAmpSellerVersion();
            $obj->hydrate($row);
            AmpSellerVersionTableMap::addInstanceToPool($obj, serialize(array((string) $key[0], (string) $key[1])));
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     ConnectionInterface $con A connection object
     *
     * @return ChildAmpSellerVersion|array|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $dataFetcher = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($dataFetcher);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(array(12, 56), array(832, 123), array(123, 456)), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     ConnectionInterface $con an optional connection object
     *
     * @return ObjectCollection|array|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $dataFetcher = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($dataFetcher);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {
        $this->addUsingAlias(AmpSellerVersionTableMap::ID, $key[0], Criteria::EQUAL);
        $this->addUsingAlias(AmpSellerVersionTableMap::VERSION, $key[1], Criteria::EQUAL);

        return $this;
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {
        if (empty($keys)) {
            return $this->add(null, '1<>1', Criteria::CUSTOM);
        }
        foreach ($keys as $key) {
            $cton0 = $this->getNewCriterion(AmpSellerVersionTableMap::ID, $key[0], Criteria::EQUAL);
            $cton1 = $this->getNewCriterion(AmpSellerVersionTableMap::VERSION, $key[1], Criteria::EQUAL);
            $cton0->addAnd($cton1);
            $this->addOr($cton0);
        }

        return $this;
    }

    /**
     * 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>
     *
     * @see       filterByAmpSeller()
     *
     * @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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id)) {
            $useMinMax = false;
            if (isset($id['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($id['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::ID, $id, $comparison);
    }

    /**
     * Filter the query on the ref column
     *
     * Example usage:
     * <code>
     * $query->filterByRef('fooValue');   // WHERE ref = 'fooValue'
     * $query->filterByRef('%fooValue%'); // WHERE ref LIKE '%fooValue%'
     * </code>
     *
     * @param     string $ref 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByRef($ref = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($ref)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $ref)) {
                $ref = str_replace('*', '%', $ref);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::REF, $ref, $comparison);
    }

    /**
     * Filter the query on the visible column
     *
     * Example usage:
     * <code>
     * $query->filterByVisible(1234); // WHERE visible = 1234
     * $query->filterByVisible(array(12, 34)); // WHERE visible IN (12, 34)
     * $query->filterByVisible(array('min' => 12)); // WHERE visible > 12
     * </code>
     *
     * @param     mixed $visible 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByVisible($visible = null, $comparison = null)
    {
        if (is_array($visible)) {
            $useMinMax = false;
            if (isset($visible['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::VISIBLE, $visible['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($visible['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::VISIBLE, $visible['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::VISIBLE, $visible, $comparison);
    }

    /**
     * Filter the query on the address1 column
     *
     * Example usage:
     * <code>
     * $query->filterByAddress1('fooValue');   // WHERE address1 = 'fooValue'
     * $query->filterByAddress1('%fooValue%'); // WHERE address1 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $address1 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAddress1($address1 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($address1)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $address1)) {
                $address1 = str_replace('*', '%', $address1);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::ADDRESS1, $address1, $comparison);
    }

    /**
     * Filter the query on the address2 column
     *
     * Example usage:
     * <code>
     * $query->filterByAddress2('fooValue');   // WHERE address2 = 'fooValue'
     * $query->filterByAddress2('%fooValue%'); // WHERE address2 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $address2 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAddress2($address2 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($address2)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $address2)) {
                $address2 = str_replace('*', '%', $address2);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::ADDRESS2, $address2, $comparison);
    }

    /**
     * Filter the query on the address3 column
     *
     * Example usage:
     * <code>
     * $query->filterByAddress3('fooValue');   // WHERE address3 = 'fooValue'
     * $query->filterByAddress3('%fooValue%'); // WHERE address3 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $address3 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAddress3($address3 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($address3)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $address3)) {
                $address3 = str_replace('*', '%', $address3);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::ADDRESS3, $address3, $comparison);
    }

    /**
     * Filter the query on the zipcode column
     *
     * Example usage:
     * <code>
     * $query->filterByZipcode('fooValue');   // WHERE zipcode = 'fooValue'
     * $query->filterByZipcode('%fooValue%'); // WHERE zipcode LIKE '%fooValue%'
     * </code>
     *
     * @param     string $zipcode 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByZipcode($zipcode = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($zipcode)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $zipcode)) {
                $zipcode = str_replace('*', '%', $zipcode);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::ZIPCODE, $zipcode, $comparison);
    }

    /**
     * Filter the query on the city column
     *
     * Example usage:
     * <code>
     * $query->filterByCity('fooValue');   // WHERE city = 'fooValue'
     * $query->filterByCity('%fooValue%'); // WHERE city LIKE '%fooValue%'
     * </code>
     *
     * @param     string $city 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByCity($city = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($city)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $city)) {
                $city = str_replace('*', '%', $city);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::CITY, $city, $comparison);
    }

    /**
     * Filter the query on the country_id column
     *
     * Example usage:
     * <code>
     * $query->filterByCountryId(1234); // WHERE country_id = 1234
     * $query->filterByCountryId(array(12, 34)); // WHERE country_id IN (12, 34)
     * $query->filterByCountryId(array('min' => 12)); // WHERE country_id > 12
     * </code>
     *
     * @param     mixed $countryId 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByCountryId($countryId = null, $comparison = null)
    {
        if (is_array($countryId)) {
            $useMinMax = false;
            if (isset($countryId['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::COUNTRY_ID, $countryId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($countryId['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::COUNTRY_ID, $countryId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::COUNTRY_ID, $countryId, $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 ChildAmpSellerVersionQuery 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(AmpSellerVersionTableMap::EMAIL, $email, $comparison);
    }

    /**
     * Filter the query on the phone column
     *
     * Example usage:
     * <code>
     * $query->filterByPhone('fooValue');   // WHERE phone = 'fooValue'
     * $query->filterByPhone('%fooValue%'); // WHERE phone LIKE '%fooValue%'
     * </code>
     *
     * @param     string $phone 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByPhone($phone = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($phone)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $phone)) {
                $phone = str_replace('*', '%', $phone);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::PHONE, $phone, $comparison);
    }

    /**
     * Filter the query on the fax column
     *
     * Example usage:
     * <code>
     * $query->filterByFax('fooValue');   // WHERE fax = 'fooValue'
     * $query->filterByFax('%fooValue%'); // WHERE fax LIKE '%fooValue%'
     * </code>
     *
     * @param     string $fax 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByFax($fax = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($fax)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $fax)) {
                $fax = str_replace('*', '%', $fax);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::FAX, $fax, $comparison);
    }

    /**
     * Filter the query on the url column
     *
     * Example usage:
     * <code>
     * $query->filterByUrl('fooValue');   // WHERE url = 'fooValue'
     * $query->filterByUrl('%fooValue%'); // WHERE url LIKE '%fooValue%'
     * </code>
     *
     * @param     string $url 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByUrl($url = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($url)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $url)) {
                $url = str_replace('*', '%', $url);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::URL, $url, $comparison);
    }

    /**
     * Filter the query on the facebook column
     *
     * Example usage:
     * <code>
     * $query->filterByFacebook('fooValue');   // WHERE facebook = 'fooValue'
     * $query->filterByFacebook('%fooValue%'); // WHERE facebook LIKE '%fooValue%'
     * </code>
     *
     * @param     string $facebook 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByFacebook($facebook = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($facebook)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $facebook)) {
                $facebook = str_replace('*', '%', $facebook);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::FACEBOOK, $facebook, $comparison);
    }

    /**
     * Filter the query on the twitter column
     *
     * Example usage:
     * <code>
     * $query->filterByTwitter('fooValue');   // WHERE twitter = 'fooValue'
     * $query->filterByTwitter('%fooValue%'); // WHERE twitter LIKE '%fooValue%'
     * </code>
     *
     * @param     string $twitter 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByTwitter($twitter = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($twitter)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $twitter)) {
                $twitter = str_replace('*', '%', $twitter);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::TWITTER, $twitter, $comparison);
    }

    /**
     * Filter the query on the pinterest column
     *
     * Example usage:
     * <code>
     * $query->filterByPinterest('fooValue');   // WHERE pinterest = 'fooValue'
     * $query->filterByPinterest('%fooValue%'); // WHERE pinterest LIKE '%fooValue%'
     * </code>
     *
     * @param     string $pinterest 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByPinterest($pinterest = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($pinterest)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $pinterest)) {
                $pinterest = str_replace('*', '%', $pinterest);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::PINTEREST, $pinterest, $comparison);
    }

    /**
     * Filter the query on the google column
     *
     * Example usage:
     * <code>
     * $query->filterByGoogle('fooValue');   // WHERE google = 'fooValue'
     * $query->filterByGoogle('%fooValue%'); // WHERE google LIKE '%fooValue%'
     * </code>
     *
     * @param     string $google 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByGoogle($google = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($google)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $google)) {
                $google = str_replace('*', '%', $google);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::GOOGLE, $google, $comparison);
    }

    /**
     * Filter the query on the youtube column
     *
     * Example usage:
     * <code>
     * $query->filterByYoutube('fooValue');   // WHERE youtube = 'fooValue'
     * $query->filterByYoutube('%fooValue%'); // WHERE youtube LIKE '%fooValue%'
     * </code>
     *
     * @param     string $youtube 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByYoutube($youtube = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($youtube)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $youtube)) {
                $youtube = str_replace('*', '%', $youtube);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::YOUTUBE, $youtube, $comparison);
    }

    /**
     * Filter the query on the instagram column
     *
     * Example usage:
     * <code>
     * $query->filterByInstagram('fooValue');   // WHERE instagram = 'fooValue'
     * $query->filterByInstagram('%fooValue%'); // WHERE instagram LIKE '%fooValue%'
     * </code>
     *
     * @param     string $instagram 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByInstagram($instagram = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($instagram)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $instagram)) {
                $instagram = str_replace('*', '%', $instagram);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::INSTAGRAM, $instagram, $comparison);
    }

    /**
     * Filter the query on the latitude column
     *
     * Example usage:
     * <code>
     * $query->filterByLatitude(1234); // WHERE latitude = 1234
     * $query->filterByLatitude(array(12, 34)); // WHERE latitude IN (12, 34)
     * $query->filterByLatitude(array('min' => 12)); // WHERE latitude > 12
     * </code>
     *
     * @param     mixed $latitude 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByLatitude($latitude = null, $comparison = null)
    {
        if (is_array($latitude)) {
            $useMinMax = false;
            if (isset($latitude['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::LATITUDE, $latitude['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($latitude['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::LATITUDE, $latitude['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::LATITUDE, $latitude, $comparison);
    }

    /**
     * Filter the query on the longitude column
     *
     * Example usage:
     * <code>
     * $query->filterByLongitude(1234); // WHERE longitude = 1234
     * $query->filterByLongitude(array(12, 34)); // WHERE longitude IN (12, 34)
     * $query->filterByLongitude(array('min' => 12)); // WHERE longitude > 12
     * </code>
     *
     * @param     mixed $longitude 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByLongitude($longitude = null, $comparison = null)
    {
        if (is_array($longitude)) {
            $useMinMax = false;
            if (isset($longitude['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::LONGITUDE, $longitude['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($longitude['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::LONGITUDE, $longitude['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::LONGITUDE, $longitude, $comparison);
    }

    /**
     * Filter the query on the created_at column
     *
     * Example usage:
     * <code>
     * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
     * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
     * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
     * </code>
     *
     * @param     mixed $createdAt The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByCreatedAt($createdAt = null, $comparison = null)
    {
        if (is_array($createdAt)) {
            $useMinMax = false;
            if (isset($createdAt['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($createdAt['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::CREATED_AT, $createdAt, $comparison);
    }

    /**
     * Filter the query on the updated_at column
     *
     * Example usage:
     * <code>
     * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
     * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
     * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
     * </code>
     *
     * @param     mixed $updatedAt The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByUpdatedAt($updatedAt = null, $comparison = null)
    {
        if (is_array($updatedAt)) {
            $useMinMax = false;
            if (isset($updatedAt['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($updatedAt['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::UPDATED_AT, $updatedAt, $comparison);
    }

    /**
     * Filter the query on the version column
     *
     * Example usage:
     * <code>
     * $query->filterByVersion(1234); // WHERE version = 1234
     * $query->filterByVersion(array(12, 34)); // WHERE version IN (12, 34)
     * $query->filterByVersion(array('min' => 12)); // WHERE version > 12
     * </code>
     *
     * @param     mixed $version 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByVersion($version = null, $comparison = null)
    {
        if (is_array($version)) {
            $useMinMax = false;
            if (isset($version['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::VERSION, $version['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($version['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::VERSION, $version['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::VERSION, $version, $comparison);
    }

    /**
     * Filter the query on the version_created_at column
     *
     * Example usage:
     * <code>
     * $query->filterByVersionCreatedAt('2011-03-14'); // WHERE version_created_at = '2011-03-14'
     * $query->filterByVersionCreatedAt('now'); // WHERE version_created_at = '2011-03-14'
     * $query->filterByVersionCreatedAt(array('max' => 'yesterday')); // WHERE version_created_at > '2011-03-13'
     * </code>
     *
     * @param     mixed $versionCreatedAt The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByVersionCreatedAt($versionCreatedAt = null, $comparison = null)
    {
        if (is_array($versionCreatedAt)) {
            $useMinMax = false;
            if (isset($versionCreatedAt['min'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($versionCreatedAt['max'])) {
                $this->addUsingAlias(AmpSellerVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::VERSION_CREATED_AT, $versionCreatedAt, $comparison);
    }

    /**
     * Filter the query on the version_created_by column
     *
     * Example usage:
     * <code>
     * $query->filterByVersionCreatedBy('fooValue');   // WHERE version_created_by = 'fooValue'
     * $query->filterByVersionCreatedBy('%fooValue%'); // WHERE version_created_by LIKE '%fooValue%'
     * </code>
     *
     * @param     string $versionCreatedBy 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 ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByVersionCreatedBy($versionCreatedBy = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($versionCreatedBy)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $versionCreatedBy)) {
                $versionCreatedBy = str_replace('*', '%', $versionCreatedBy);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::VERSION_CREATED_BY, $versionCreatedBy, $comparison);
    }

    /**
     * Filter the query on the amp_seller_admin_ids column
     *
     * @param     array $ampSellerAdminIds The values to use as filter.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerAdminIds($ampSellerAdminIds = null, $comparison = null)
    {
        $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_IDS);
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            foreach ($ampSellerAdminIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_SOME) {
            foreach ($ampSellerAdminIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addOr($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            foreach ($ampSellerAdminIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::NOT_LIKE);
                } else {
                    $this->add($key, $value, Criteria::NOT_LIKE);
                }
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_IDS, $ampSellerAdminIds, $comparison);
    }

    /**
     * Filter the query on the amp_seller_admin_ids column
     * @param     mixed $ampSellerAdminIds The value to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerAdminId($ampSellerAdminIds = null, $comparison = null)
    {
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            if (is_scalar($ampSellerAdminIds)) {
                $ampSellerAdminIds = '%| ' . $ampSellerAdminIds . ' |%';
                $comparison = Criteria::LIKE;
            }
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            $ampSellerAdminIds = '%| ' . $ampSellerAdminIds . ' |%';
            $comparison = Criteria::NOT_LIKE;
            $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_IDS);
            if ($this->containsKey($key)) {
                $this->addAnd($key, $ampSellerAdminIds, $comparison);
            } else {
                $this->addAnd($key, $ampSellerAdminIds, $comparison);
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_IDS, $ampSellerAdminIds, $comparison);
    }

    /**
     * Filter the query on the amp_seller_admin_versions column
     *
     * @param     array $ampSellerAdminVersions The values to use as filter.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerAdminVersions($ampSellerAdminVersions = null, $comparison = null)
    {
        $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_VERSIONS);
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            foreach ($ampSellerAdminVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_SOME) {
            foreach ($ampSellerAdminVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addOr($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            foreach ($ampSellerAdminVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::NOT_LIKE);
                } else {
                    $this->add($key, $value, Criteria::NOT_LIKE);
                }
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_VERSIONS, $ampSellerAdminVersions, $comparison);
    }

    /**
     * Filter the query on the amp_seller_admin_versions column
     * @param     mixed $ampSellerAdminVersions The value to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerAdminVersion($ampSellerAdminVersions = null, $comparison = null)
    {
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            if (is_scalar($ampSellerAdminVersions)) {
                $ampSellerAdminVersions = '%| ' . $ampSellerAdminVersions . ' |%';
                $comparison = Criteria::LIKE;
            }
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            $ampSellerAdminVersions = '%| ' . $ampSellerAdminVersions . ' |%';
            $comparison = Criteria::NOT_LIKE;
            $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_VERSIONS);
            if ($this->containsKey($key)) {
                $this->addAnd($key, $ampSellerAdminVersions, $comparison);
            } else {
                $this->addAnd($key, $ampSellerAdminVersions, $comparison);
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ADMIN_VERSIONS, $ampSellerAdminVersions, $comparison);
    }

    /**
     * Filter the query on the amp_seller_product_ids column
     *
     * @param     array $ampSellerProductIds The values to use as filter.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerProductIds($ampSellerProductIds = null, $comparison = null)
    {
        $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_IDS);
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            foreach ($ampSellerProductIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_SOME) {
            foreach ($ampSellerProductIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addOr($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            foreach ($ampSellerProductIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::NOT_LIKE);
                } else {
                    $this->add($key, $value, Criteria::NOT_LIKE);
                }
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_IDS, $ampSellerProductIds, $comparison);
    }

    /**
     * Filter the query on the amp_seller_product_ids column
     * @param     mixed $ampSellerProductIds The value to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerProductId($ampSellerProductIds = null, $comparison = null)
    {
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            if (is_scalar($ampSellerProductIds)) {
                $ampSellerProductIds = '%| ' . $ampSellerProductIds . ' |%';
                $comparison = Criteria::LIKE;
            }
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            $ampSellerProductIds = '%| ' . $ampSellerProductIds . ' |%';
            $comparison = Criteria::NOT_LIKE;
            $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_IDS);
            if ($this->containsKey($key)) {
                $this->addAnd($key, $ampSellerProductIds, $comparison);
            } else {
                $this->addAnd($key, $ampSellerProductIds, $comparison);
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_IDS, $ampSellerProductIds, $comparison);
    }

    /**
     * Filter the query on the amp_seller_product_versions column
     *
     * @param     array $ampSellerProductVersions The values to use as filter.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerProductVersions($ampSellerProductVersions = null, $comparison = null)
    {
        $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_VERSIONS);
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            foreach ($ampSellerProductVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_SOME) {
            foreach ($ampSellerProductVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addOr($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            foreach ($ampSellerProductVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::NOT_LIKE);
                } else {
                    $this->add($key, $value, Criteria::NOT_LIKE);
                }
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_VERSIONS, $ampSellerProductVersions, $comparison);
    }

    /**
     * Filter the query on the amp_seller_product_versions column
     * @param     mixed $ampSellerProductVersions The value to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerProductVersion($ampSellerProductVersions = null, $comparison = null)
    {
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            if (is_scalar($ampSellerProductVersions)) {
                $ampSellerProductVersions = '%| ' . $ampSellerProductVersions . ' |%';
                $comparison = Criteria::LIKE;
            }
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            $ampSellerProductVersions = '%| ' . $ampSellerProductVersions . ' |%';
            $comparison = Criteria::NOT_LIKE;
            $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_VERSIONS);
            if ($this->containsKey($key)) {
                $this->addAnd($key, $ampSellerProductVersions, $comparison);
            } else {
                $this->addAnd($key, $ampSellerProductVersions, $comparison);
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_PRODUCT_VERSIONS, $ampSellerProductVersions, $comparison);
    }

    /**
     * Filter the query on the amp_seller_order_ids column
     *
     * @param     array $ampSellerOrderIds The values to use as filter.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerOrderIds($ampSellerOrderIds = null, $comparison = null)
    {
        $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ORDER_IDS);
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            foreach ($ampSellerOrderIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_SOME) {
            foreach ($ampSellerOrderIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addOr($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            foreach ($ampSellerOrderIds as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::NOT_LIKE);
                } else {
                    $this->add($key, $value, Criteria::NOT_LIKE);
                }
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ORDER_IDS, $ampSellerOrderIds, $comparison);
    }

    /**
     * Filter the query on the amp_seller_order_ids column
     * @param     mixed $ampSellerOrderIds The value to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerOrderId($ampSellerOrderIds = null, $comparison = null)
    {
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            if (is_scalar($ampSellerOrderIds)) {
                $ampSellerOrderIds = '%| ' . $ampSellerOrderIds . ' |%';
                $comparison = Criteria::LIKE;
            }
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            $ampSellerOrderIds = '%| ' . $ampSellerOrderIds . ' |%';
            $comparison = Criteria::NOT_LIKE;
            $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ORDER_IDS);
            if ($this->containsKey($key)) {
                $this->addAnd($key, $ampSellerOrderIds, $comparison);
            } else {
                $this->addAnd($key, $ampSellerOrderIds, $comparison);
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ORDER_IDS, $ampSellerOrderIds, $comparison);
    }

    /**
     * Filter the query on the amp_seller_order_versions column
     *
     * @param     array $ampSellerOrderVersions The values to use as filter.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerOrderVersions($ampSellerOrderVersions = null, $comparison = null)
    {
        $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ORDER_VERSIONS);
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            foreach ($ampSellerOrderVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_SOME) {
            foreach ($ampSellerOrderVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addOr($key, $value, Criteria::LIKE);
                } else {
                    $this->add($key, $value, Criteria::LIKE);
                }
            }

            return $this;
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            foreach ($ampSellerOrderVersions as $value) {
                $value = '%| ' . $value . ' |%';
                if ($this->containsKey($key)) {
                    $this->addAnd($key, $value, Criteria::NOT_LIKE);
                } else {
                    $this->add($key, $value, Criteria::NOT_LIKE);
                }
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ORDER_VERSIONS, $ampSellerOrderVersions, $comparison);
    }

    /**
     * Filter the query on the amp_seller_order_versions column
     * @param     mixed $ampSellerOrderVersions The value to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::CONTAINS_ALL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSellerOrderVersion($ampSellerOrderVersions = null, $comparison = null)
    {
        if (null === $comparison || $comparison == Criteria::CONTAINS_ALL) {
            if (is_scalar($ampSellerOrderVersions)) {
                $ampSellerOrderVersions = '%| ' . $ampSellerOrderVersions . ' |%';
                $comparison = Criteria::LIKE;
            }
        } elseif ($comparison == Criteria::CONTAINS_NONE) {
            $ampSellerOrderVersions = '%| ' . $ampSellerOrderVersions . ' |%';
            $comparison = Criteria::NOT_LIKE;
            $key = $this->getAliasedColName(AmpSellerVersionTableMap::AMP_SELLER_ORDER_VERSIONS);
            if ($this->containsKey($key)) {
                $this->addAnd($key, $ampSellerOrderVersions, $comparison);
            } else {
                $this->addAnd($key, $ampSellerOrderVersions, $comparison);
            }
            $this->addOr($key, null, Criteria::ISNULL);

            return $this;
        }

        return $this->addUsingAlias(AmpSellerVersionTableMap::AMP_SELLER_ORDER_VERSIONS, $ampSellerOrderVersions, $comparison);
    }

    /**
     * Filter the query by a related \ArtabanMarketplace\Model\AmpSeller object
     *
     * @param \ArtabanMarketplace\Model\AmpSeller|ObjectCollection $ampSeller The related object(s) to use as filter
     * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function filterByAmpSeller($ampSeller, $comparison = null)
    {
        if ($ampSeller instanceof \ArtabanMarketplace\Model\AmpSeller) {
            return $this
                ->addUsingAlias(AmpSellerVersionTableMap::ID, $ampSeller->getId(), $comparison);
        } elseif ($ampSeller instanceof ObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(AmpSellerVersionTableMap::ID, $ampSeller->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByAmpSeller() only accepts arguments of type \ArtabanMarketplace\Model\AmpSeller or Collection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the AmpSeller relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function joinAmpSeller($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('AmpSeller');

        // 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, 'AmpSeller');
        }

        return $this;
    }

    /**
     * Use the AmpSeller relation AmpSeller 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   \ArtabanMarketplace\Model\AmpSellerQuery A secondary query class using the current class as primary query
     */
    public function useAmpSellerQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinAmpSeller($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'AmpSeller', '\ArtabanMarketplace\Model\AmpSellerQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   ChildAmpSellerVersion $ampSellerVersion Object to remove from the list of results
     *
     * @return ChildAmpSellerVersionQuery The current query, for fluid interface
     */
    public function prune($ampSellerVersion = null)
    {
        if ($ampSellerVersion) {
            $this->addCond('pruneCond0', $this->getAliasedColName(AmpSellerVersionTableMap::ID), $ampSellerVersion->getId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(AmpSellerVersionTableMap::VERSION), $ampSellerVersion->getVersion(), Criteria::NOT_EQUAL);
            $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
        }

        return $this;
    }

    /**
     * Deletes all rows from the amp_seller_version table.
     *
     * @param ConnectionInterface $con the connection to use
     * @return int The number of affected rows (if supported by underlying database driver).
     */
    public function doDeleteAll(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(AmpSellerVersionTableMap::DATABASE_NAME);
        }
        $affectedRows = 0; // initialize var to track total num of affected rows
        try {
            // use transaction because $criteria could contain info
            // for more than one table or we could emulating ON DELETE CASCADE, etc.
            $con->beginTransaction();
            $affectedRows += parent::doDeleteAll($con);
            // Because this db requires some delete cascade/set null emulation, we have to
            // clear the cached instance *after* the emulation has happened (since
            // instances get re-added by the select statement contained therein).
            AmpSellerVersionTableMap::clearInstancePool();
            AmpSellerVersionTableMap::clearRelatedInstancePool();

            $con->commit();
        } catch (PropelException $e) {
            $con->rollBack();
            throw $e;
        }

        return $affectedRows;
    }

    /**
     * Performs a DELETE on the database, given a ChildAmpSellerVersion or Criteria object OR a primary key value.
     *
     * @param mixed               $values Criteria or ChildAmpSellerVersion object or primary key or array of primary keys
     *              which is used to create the DELETE statement
     * @param ConnectionInterface $con the connection to use
     * @return int The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
     *                if supported by native driver or if emulated using Propel.
     * @throws PropelException Any exceptions caught during processing will be
     *         rethrown wrapped into a PropelException.
     */
     public function delete(ConnectionInterface $con = null)
     {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(AmpSellerVersionTableMap::DATABASE_NAME);
        }

        $criteria = $this;

        // Set the correct dbName
        $criteria->setDbName(AmpSellerVersionTableMap::DATABASE_NAME);

        $affectedRows = 0; // initialize var to track total num of affected rows

        try {
            // use transaction because $criteria could contain info
            // for more than one table or we could emulating ON DELETE CASCADE, etc.
            $con->beginTransaction();


        AmpSellerVersionTableMap::removeInstanceFromPool($criteria);

            $affectedRows += ModelCriteria::delete($con);
            AmpSellerVersionTableMap::clearRelatedInstancePool();
            $con->commit();

            return $affectedRows;
        } catch (PropelException $e) {
            $con->rollBack();
            throw $e;
        }
    }

} // AmpSellerVersionQuery
