Commit du module Colissimo

This commit is contained in:
2020-09-09 12:52:39 +02:00
parent de4bc540e4
commit b5d5fd110e
123 changed files with 28431 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,964 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\AddressSocolissimo as ChildAddressSocolissimo;
use SoColissimo\Model\AddressSocolissimoQuery as ChildAddressSocolissimoQuery;
use SoColissimo\Model\Map\AddressSocolissimoTableMap;
use SoColissimo\Model\Thelia\Model\Country;
use SoColissimo\Model\Thelia\Model\CustomerTitle;
/**
* Base class that represents a query for the 'address_socolissimo' table.
*
*
*
* @method ChildAddressSocolissimoQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildAddressSocolissimoQuery orderByTitleId($order = Criteria::ASC) Order by the title_id column
* @method ChildAddressSocolissimoQuery orderByCompany($order = Criteria::ASC) Order by the company column
* @method ChildAddressSocolissimoQuery orderByFirstname($order = Criteria::ASC) Order by the firstname column
* @method ChildAddressSocolissimoQuery orderByLastname($order = Criteria::ASC) Order by the lastname column
* @method ChildAddressSocolissimoQuery orderByAddress1($order = Criteria::ASC) Order by the address1 column
* @method ChildAddressSocolissimoQuery orderByAddress2($order = Criteria::ASC) Order by the address2 column
* @method ChildAddressSocolissimoQuery orderByAddress3($order = Criteria::ASC) Order by the address3 column
* @method ChildAddressSocolissimoQuery orderByZipcode($order = Criteria::ASC) Order by the zipcode column
* @method ChildAddressSocolissimoQuery orderByCity($order = Criteria::ASC) Order by the city column
* @method ChildAddressSocolissimoQuery orderByCountryId($order = Criteria::ASC) Order by the country_id column
* @method ChildAddressSocolissimoQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildAddressSocolissimoQuery orderByType($order = Criteria::ASC) Order by the type column
* @method ChildAddressSocolissimoQuery orderByCellphone($order = Criteria::ASC) Order by the cellphone column
*
* @method ChildAddressSocolissimoQuery groupById() Group by the id column
* @method ChildAddressSocolissimoQuery groupByTitleId() Group by the title_id column
* @method ChildAddressSocolissimoQuery groupByCompany() Group by the company column
* @method ChildAddressSocolissimoQuery groupByFirstname() Group by the firstname column
* @method ChildAddressSocolissimoQuery groupByLastname() Group by the lastname column
* @method ChildAddressSocolissimoQuery groupByAddress1() Group by the address1 column
* @method ChildAddressSocolissimoQuery groupByAddress2() Group by the address2 column
* @method ChildAddressSocolissimoQuery groupByAddress3() Group by the address3 column
* @method ChildAddressSocolissimoQuery groupByZipcode() Group by the zipcode column
* @method ChildAddressSocolissimoQuery groupByCity() Group by the city column
* @method ChildAddressSocolissimoQuery groupByCountryId() Group by the country_id column
* @method ChildAddressSocolissimoQuery groupByCode() Group by the code column
* @method ChildAddressSocolissimoQuery groupByType() Group by the type column
* @method ChildAddressSocolissimoQuery groupByCellphone() Group by the cellphone column
*
* @method ChildAddressSocolissimoQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildAddressSocolissimoQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildAddressSocolissimoQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildAddressSocolissimoQuery leftJoinCustomerTitle($relationAlias = null) Adds a LEFT JOIN clause to the query using the CustomerTitle relation
* @method ChildAddressSocolissimoQuery rightJoinCustomerTitle($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CustomerTitle relation
* @method ChildAddressSocolissimoQuery innerJoinCustomerTitle($relationAlias = null) Adds a INNER JOIN clause to the query using the CustomerTitle relation
*
* @method ChildAddressSocolissimoQuery leftJoinCountry($relationAlias = null) Adds a LEFT JOIN clause to the query using the Country relation
* @method ChildAddressSocolissimoQuery rightJoinCountry($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Country relation
* @method ChildAddressSocolissimoQuery innerJoinCountry($relationAlias = null) Adds a INNER JOIN clause to the query using the Country relation
*
* @method ChildAddressSocolissimo findOne(ConnectionInterface $con = null) Return the first ChildAddressSocolissimo matching the query
* @method ChildAddressSocolissimo findOneOrCreate(ConnectionInterface $con = null) Return the first ChildAddressSocolissimo matching the query, or a new ChildAddressSocolissimo object populated from the query conditions when no match is found
*
* @method ChildAddressSocolissimo findOneById(int $id) Return the first ChildAddressSocolissimo filtered by the id column
* @method ChildAddressSocolissimo findOneByTitleId(int $title_id) Return the first ChildAddressSocolissimo filtered by the title_id column
* @method ChildAddressSocolissimo findOneByCompany(string $company) Return the first ChildAddressSocolissimo filtered by the company column
* @method ChildAddressSocolissimo findOneByFirstname(string $firstname) Return the first ChildAddressSocolissimo filtered by the firstname column
* @method ChildAddressSocolissimo findOneByLastname(string $lastname) Return the first ChildAddressSocolissimo filtered by the lastname column
* @method ChildAddressSocolissimo findOneByAddress1(string $address1) Return the first ChildAddressSocolissimo filtered by the address1 column
* @method ChildAddressSocolissimo findOneByAddress2(string $address2) Return the first ChildAddressSocolissimo filtered by the address2 column
* @method ChildAddressSocolissimo findOneByAddress3(string $address3) Return the first ChildAddressSocolissimo filtered by the address3 column
* @method ChildAddressSocolissimo findOneByZipcode(string $zipcode) Return the first ChildAddressSocolissimo filtered by the zipcode column
* @method ChildAddressSocolissimo findOneByCity(string $city) Return the first ChildAddressSocolissimo filtered by the city column
* @method ChildAddressSocolissimo findOneByCountryId(int $country_id) Return the first ChildAddressSocolissimo filtered by the country_id column
* @method ChildAddressSocolissimo findOneByCode(string $code) Return the first ChildAddressSocolissimo filtered by the code column
* @method ChildAddressSocolissimo findOneByType(string $type) Return the first ChildAddressSocolissimo filtered by the type column
* @method ChildAddressSocolissimo findOneByCellphone(string $cellphone) Return the first ChildAddressSocolissimo filtered by the cellphone column
*
* @method array findById(int $id) Return ChildAddressSocolissimo objects filtered by the id column
* @method array findByTitleId(int $title_id) Return ChildAddressSocolissimo objects filtered by the title_id column
* @method array findByCompany(string $company) Return ChildAddressSocolissimo objects filtered by the company column
* @method array findByFirstname(string $firstname) Return ChildAddressSocolissimo objects filtered by the firstname column
* @method array findByLastname(string $lastname) Return ChildAddressSocolissimo objects filtered by the lastname column
* @method array findByAddress1(string $address1) Return ChildAddressSocolissimo objects filtered by the address1 column
* @method array findByAddress2(string $address2) Return ChildAddressSocolissimo objects filtered by the address2 column
* @method array findByAddress3(string $address3) Return ChildAddressSocolissimo objects filtered by the address3 column
* @method array findByZipcode(string $zipcode) Return ChildAddressSocolissimo objects filtered by the zipcode column
* @method array findByCity(string $city) Return ChildAddressSocolissimo objects filtered by the city column
* @method array findByCountryId(int $country_id) Return ChildAddressSocolissimo objects filtered by the country_id column
* @method array findByCode(string $code) Return ChildAddressSocolissimo objects filtered by the code column
* @method array findByType(string $type) Return ChildAddressSocolissimo objects filtered by the type column
* @method array findByCellphone(string $cellphone) Return ChildAddressSocolissimo objects filtered by the cellphone column
*
*/
abstract class AddressSocolissimoQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\AddressSocolissimoQuery 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 = '\\SoColissimo\\Model\\AddressSocolissimo', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildAddressSocolissimoQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildAddressSocolissimoQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\AddressSocolissimoQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\AddressSocolissimoQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildAddressSocolissimo|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AddressSocolissimoTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(AddressSocolissimoTableMap::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 ChildAddressSocolissimo A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, TITLE_ID, COMPANY, FIRSTNAME, LASTNAME, ADDRESS1, ADDRESS2, ADDRESS3, ZIPCODE, CITY, COUNTRY_ID, CODE, TYPE, CELLPHONE FROM address_socolissimo WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildAddressSocolissimo();
$obj->hydrate($row);
AddressSocolissimoTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildAddressSocolissimo|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(12, 56, 832), $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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AddressSocolissimoTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the title_id column
*
* Example usage:
* <code>
* $query->filterByTitleId(1234); // WHERE title_id = 1234
* $query->filterByTitleId(array(12, 34)); // WHERE title_id IN (12, 34)
* $query->filterByTitleId(array('min' => 12)); // WHERE title_id > 12
* </code>
*
* @see filterByCustomerTitle()
*
* @param mixed $titleId 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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByTitleId($titleId = null, $comparison = null)
{
if (is_array($titleId)) {
$useMinMax = false;
if (isset($titleId['min'])) {
$this->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $titleId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($titleId['max'])) {
$this->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $titleId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $titleId, $comparison);
}
/**
* Filter the query on the company column
*
* Example usage:
* <code>
* $query->filterByCompany('fooValue'); // WHERE company = 'fooValue'
* $query->filterByCompany('%fooValue%'); // WHERE company LIKE '%fooValue%'
* </code>
*
* @param string $company 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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByCompany($company = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($company)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $company)) {
$company = str_replace('*', '%', $company);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::COMPANY, $company, $comparison);
}
/**
* Filter the query on the firstname column
*
* Example usage:
* <code>
* $query->filterByFirstname('fooValue'); // WHERE firstname = 'fooValue'
* $query->filterByFirstname('%fooValue%'); // WHERE firstname 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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::FIRSTNAME, $firstname, $comparison);
}
/**
* Filter the query on the lastname column
*
* Example usage:
* <code>
* $query->filterByLastname('fooValue'); // WHERE lastname = 'fooValue'
* $query->filterByLastname('%fooValue%'); // WHERE lastname 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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::LASTNAME, $lastname, $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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::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>
*
* @see filterByCountry()
*
* @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 ChildAddressSocolissimoQuery 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(AddressSocolissimoTableMap::COUNTRY_ID, $countryId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($countryId['max'])) {
$this->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $countryId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $countryId, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code 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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the type column
*
* Example usage:
* <code>
* $query->filterByType('fooValue'); // WHERE type = 'fooValue'
* $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%'
* </code>
*
* @param string $type 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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByType($type = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($type)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $type)) {
$type = str_replace('*', '%', $type);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::TYPE, $type, $comparison);
}
/**
* Filter the query on the cellphone column
*
* Example usage:
* <code>
* $query->filterByCellphone('fooValue'); // WHERE cellphone = 'fooValue'
* $query->filterByCellphone('%fooValue%'); // WHERE cellphone LIKE '%fooValue%'
* </code>
*
* @param string $cellphone 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 ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByCellphone($cellphone = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($cellphone)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $cellphone)) {
$cellphone = str_replace('*', '%', $cellphone);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AddressSocolissimoTableMap::CELLPHONE, $cellphone, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\CustomerTitle object
*
* @param \SoColissimo\Model\Thelia\Model\CustomerTitle|ObjectCollection $customerTitle The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByCustomerTitle($customerTitle, $comparison = null)
{
if ($customerTitle instanceof \SoColissimo\Model\Thelia\Model\CustomerTitle) {
return $this
->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $customerTitle->getId(), $comparison);
} elseif ($customerTitle instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AddressSocolissimoTableMap::TITLE_ID, $customerTitle->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCustomerTitle() only accepts arguments of type \SoColissimo\Model\Thelia\Model\CustomerTitle or Collection');
}
}
/**
* Adds a JOIN clause to the query using the CustomerTitle relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function joinCustomerTitle($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CustomerTitle');
// 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, 'CustomerTitle');
}
return $this;
}
/**
* Use the CustomerTitle relation CustomerTitle 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 \SoColissimo\Model\Thelia\Model\CustomerTitleQuery A secondary query class using the current class as primary query
*/
public function useCustomerTitleQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCustomerTitle($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CustomerTitle', '\SoColissimo\Model\Thelia\Model\CustomerTitleQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\Country object
*
* @param \SoColissimo\Model\Thelia\Model\Country|ObjectCollection $country The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByCountry($country, $comparison = null)
{
if ($country instanceof \SoColissimo\Model\Thelia\Model\Country) {
return $this
->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $country->getId(), $comparison);
} elseif ($country instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(AddressSocolissimoTableMap::COUNTRY_ID, $country->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCountry() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Country or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Country relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function joinCountry($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Country');
// 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, 'Country');
}
return $this;
}
/**
* Use the Country relation Country 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 \SoColissimo\Model\Thelia\Model\CountryQuery A secondary query class using the current class as primary query
*/
public function useCountryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCountry($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Country', '\SoColissimo\Model\Thelia\Model\CountryQuery');
}
/**
* Exclude object from result
*
* @param ChildAddressSocolissimo $addressSocolissimo Object to remove from the list of results
*
* @return ChildAddressSocolissimoQuery The current query, for fluid interface
*/
public function prune($addressSocolissimo = null)
{
if ($addressSocolissimo) {
$this->addUsingAlias(AddressSocolissimoTableMap::ID, $addressSocolissimo->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the address_socolissimo 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(AddressSocolissimoTableMap::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).
AddressSocolissimoTableMap::clearInstancePool();
AddressSocolissimoTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildAddressSocolissimo or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildAddressSocolissimo 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(AddressSocolissimoTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(AddressSocolissimoTableMap::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();
AddressSocolissimoTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
AddressSocolissimoTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // AddressSocolissimoQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,495 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\OrderAddressSocolissimo as ChildOrderAddressSocolissimo;
use SoColissimo\Model\OrderAddressSocolissimoQuery as ChildOrderAddressSocolissimoQuery;
use SoColissimo\Model\Map\OrderAddressSocolissimoTableMap;
use SoColissimo\Model\Thelia\Model\OrderAddress;
/**
* Base class that represents a query for the 'order_address_socolissimo' table.
*
*
*
* @method ChildOrderAddressSocolissimoQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildOrderAddressSocolissimoQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildOrderAddressSocolissimoQuery orderByType($order = Criteria::ASC) Order by the type column
*
* @method ChildOrderAddressSocolissimoQuery groupById() Group by the id column
* @method ChildOrderAddressSocolissimoQuery groupByCode() Group by the code column
* @method ChildOrderAddressSocolissimoQuery groupByType() Group by the type column
*
* @method ChildOrderAddressSocolissimoQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildOrderAddressSocolissimoQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildOrderAddressSocolissimoQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildOrderAddressSocolissimoQuery leftJoinOrderAddress($relationAlias = null) Adds a LEFT JOIN clause to the query using the OrderAddress relation
* @method ChildOrderAddressSocolissimoQuery rightJoinOrderAddress($relationAlias = null) Adds a RIGHT JOIN clause to the query using the OrderAddress relation
* @method ChildOrderAddressSocolissimoQuery innerJoinOrderAddress($relationAlias = null) Adds a INNER JOIN clause to the query using the OrderAddress relation
*
* @method ChildOrderAddressSocolissimo findOne(ConnectionInterface $con = null) Return the first ChildOrderAddressSocolissimo matching the query
* @method ChildOrderAddressSocolissimo findOneOrCreate(ConnectionInterface $con = null) Return the first ChildOrderAddressSocolissimo matching the query, or a new ChildOrderAddressSocolissimo object populated from the query conditions when no match is found
*
* @method ChildOrderAddressSocolissimo findOneById(int $id) Return the first ChildOrderAddressSocolissimo filtered by the id column
* @method ChildOrderAddressSocolissimo findOneByCode(string $code) Return the first ChildOrderAddressSocolissimo filtered by the code column
* @method ChildOrderAddressSocolissimo findOneByType(string $type) Return the first ChildOrderAddressSocolissimo filtered by the type column
*
* @method array findById(int $id) Return ChildOrderAddressSocolissimo objects filtered by the id column
* @method array findByCode(string $code) Return ChildOrderAddressSocolissimo objects filtered by the code column
* @method array findByType(string $type) Return ChildOrderAddressSocolissimo objects filtered by the type column
*
*/
abstract class OrderAddressSocolissimoQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\OrderAddressSocolissimoQuery 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 = '\\SoColissimo\\Model\\OrderAddressSocolissimo', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildOrderAddressSocolissimoQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildOrderAddressSocolissimoQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\OrderAddressSocolissimoQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\OrderAddressSocolissimoQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildOrderAddressSocolissimo|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = OrderAddressSocolissimoTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(OrderAddressSocolissimoTableMap::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 ChildOrderAddressSocolissimo A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, CODE, TYPE FROM order_address_socolissimo WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildOrderAddressSocolissimo();
$obj->hydrate($row);
OrderAddressSocolissimoTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildOrderAddressSocolissimo|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(12, 56, 832), $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 ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(OrderAddressSocolissimoTableMap::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 ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(OrderAddressSocolissimoTableMap::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>
*
* @see filterByOrderAddress()
*
* @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 ChildOrderAddressSocolissimoQuery 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(OrderAddressSocolissimoTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code 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 ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderAddressSocolissimoTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the type column
*
* Example usage:
* <code>
* $query->filterByType('fooValue'); // WHERE type = 'fooValue'
* $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%'
* </code>
*
* @param string $type 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 ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByType($type = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($type)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $type)) {
$type = str_replace('*', '%', $type);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(OrderAddressSocolissimoTableMap::TYPE, $type, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\OrderAddress object
*
* @param \SoColissimo\Model\Thelia\Model\OrderAddress|ObjectCollection $orderAddress The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function filterByOrderAddress($orderAddress, $comparison = null)
{
if ($orderAddress instanceof \SoColissimo\Model\Thelia\Model\OrderAddress) {
return $this
->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddress->getId(), $comparison);
} elseif ($orderAddress instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddress->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByOrderAddress() only accepts arguments of type \SoColissimo\Model\Thelia\Model\OrderAddress or Collection');
}
}
/**
* Adds a JOIN clause to the query using the OrderAddress relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function joinOrderAddress($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('OrderAddress');
// 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, 'OrderAddress');
}
return $this;
}
/**
* Use the OrderAddress relation OrderAddress 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 \SoColissimo\Model\Thelia\Model\OrderAddressQuery A secondary query class using the current class as primary query
*/
public function useOrderAddressQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinOrderAddress($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'OrderAddress', '\SoColissimo\Model\Thelia\Model\OrderAddressQuery');
}
/**
* Exclude object from result
*
* @param ChildOrderAddressSocolissimo $orderAddressSocolissimo Object to remove from the list of results
*
* @return ChildOrderAddressSocolissimoQuery The current query, for fluid interface
*/
public function prune($orderAddressSocolissimo = null)
{
if ($orderAddressSocolissimo) {
$this->addUsingAlias(OrderAddressSocolissimoTableMap::ID, $orderAddressSocolissimo->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the order_address_socolissimo 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(OrderAddressSocolissimoTableMap::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).
OrderAddressSocolissimoTableMap::clearInstancePool();
OrderAddressSocolissimoTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildOrderAddressSocolissimo or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildOrderAddressSocolissimo 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(OrderAddressSocolissimoTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(OrderAddressSocolissimoTableMap::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();
OrderAddressSocolissimoTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
OrderAddressSocolissimoTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // OrderAddressSocolissimoQuery

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,645 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\SocolissimoAreaFreeshippingDom as ChildSocolissimoAreaFreeshippingDom;
use SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery as ChildSocolissimoAreaFreeshippingDomQuery;
use SoColissimo\Model\Map\SocolissimoAreaFreeshippingDomTableMap;
use SoColissimo\Model\Thelia\Model\Area;
/**
* Base class that represents a query for the 'socolissimo_area_freeshipping_dom' table.
*
*
*
* @method ChildSocolissimoAreaFreeshippingDomQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSocolissimoAreaFreeshippingDomQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildSocolissimoAreaFreeshippingDomQuery orderByDeliveryModeId($order = Criteria::ASC) Order by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingDomQuery orderByCartAmount($order = Criteria::ASC) Order by the cart_amount column
*
* @method ChildSocolissimoAreaFreeshippingDomQuery groupById() Group by the id column
* @method ChildSocolissimoAreaFreeshippingDomQuery groupByAreaId() Group by the area_id column
* @method ChildSocolissimoAreaFreeshippingDomQuery groupByDeliveryModeId() Group by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingDomQuery groupByCartAmount() Group by the cart_amount column
*
* @method ChildSocolissimoAreaFreeshippingDomQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSocolissimoAreaFreeshippingDomQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSocolissimoAreaFreeshippingDomQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSocolissimoAreaFreeshippingDomQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildSocolissimoAreaFreeshippingDomQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildSocolissimoAreaFreeshippingDomQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildSocolissimoAreaFreeshippingDomQuery leftJoinSocolissimoDeliveryMode($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoAreaFreeshippingDomQuery rightJoinSocolissimoDeliveryMode($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoAreaFreeshippingDomQuery innerJoinSocolissimoDeliveryMode($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @method ChildSocolissimoAreaFreeshippingDom findOne(ConnectionInterface $con = null) Return the first ChildSocolissimoAreaFreeshippingDom matching the query
* @method ChildSocolissimoAreaFreeshippingDom findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSocolissimoAreaFreeshippingDom matching the query, or a new ChildSocolissimoAreaFreeshippingDom object populated from the query conditions when no match is found
*
* @method ChildSocolissimoAreaFreeshippingDom findOneById(int $id) Return the first ChildSocolissimoAreaFreeshippingDom filtered by the id column
* @method ChildSocolissimoAreaFreeshippingDom findOneByAreaId(int $area_id) Return the first ChildSocolissimoAreaFreeshippingDom filtered by the area_id column
* @method ChildSocolissimoAreaFreeshippingDom findOneByDeliveryModeId(int $delivery_mode_id) Return the first ChildSocolissimoAreaFreeshippingDom filtered by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingDom findOneByCartAmount(string $cart_amount) Return the first ChildSocolissimoAreaFreeshippingDom filtered by the cart_amount column
*
* @method array findById(int $id) Return ChildSocolissimoAreaFreeshippingDom objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildSocolissimoAreaFreeshippingDom objects filtered by the area_id column
* @method array findByDeliveryModeId(int $delivery_mode_id) Return ChildSocolissimoAreaFreeshippingDom objects filtered by the delivery_mode_id column
* @method array findByCartAmount(string $cart_amount) Return ChildSocolissimoAreaFreeshippingDom objects filtered by the cart_amount column
*
*/
abstract class SocolissimoAreaFreeshippingDomQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\SocolissimoAreaFreeshippingDomQuery 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 = '\\SoColissimo\\Model\\SocolissimoAreaFreeshippingDom', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSocolissimoAreaFreeshippingDomQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSocolissimoAreaFreeshippingDomQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSocolissimoAreaFreeshippingDom|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SocolissimoAreaFreeshippingDomTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingDomTableMap::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 ChildSocolissimoAreaFreeshippingDom A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, CART_AMOUNT FROM socolissimo_area_freeshipping_dom WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildSocolissimoAreaFreeshippingDom();
$obj->hydrate($row);
SocolissimoAreaFreeshippingDomTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildSocolissimoAreaFreeshippingDom|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(12, 56, 832), $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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::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 ChildSocolissimoAreaFreeshippingDomQuery 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(SocolissimoAreaFreeshippingDomTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the area_id column
*
* Example usage:
* <code>
* $query->filterByAreaId(1234); // WHERE area_id = 1234
* $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
* $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
* </code>
*
* @see filterByArea()
*
* @param mixed $areaId 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the delivery_mode_id column
*
* Example usage:
* <code>
* $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
* $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
* $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
* </code>
*
* @see filterBySocolissimoDeliveryMode()
*
* @param mixed $deliveryModeId 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
{
if (is_array($deliveryModeId)) {
$useMinMax = false;
if (isset($deliveryModeId['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($deliveryModeId['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
}
/**
* Filter the query on the cart_amount column
*
* Example usage:
* <code>
* $query->filterByCartAmount(1234); // WHERE cart_amount = 1234
* $query->filterByCartAmount(array(12, 34)); // WHERE cart_amount IN (12, 34)
* $query->filterByCartAmount(array('min' => 12)); // WHERE cart_amount > 12
* </code>
*
* @param mixed $cartAmount 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 ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterByCartAmount($cartAmount = null, $comparison = null)
{
if (is_array($cartAmount)) {
$useMinMax = false;
if (isset($cartAmount['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cartAmount['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::CART_AMOUNT, $cartAmount, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
*
* @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
return $this
->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Area relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
// 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, 'Area');
}
return $this;
}
/**
* Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
*
* @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
{
if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
return $this
->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
} elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
// 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, 'SocolissimoDeliveryMode');
}
return $this;
}
/**
* Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoDeliveryMode($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
}
/**
* Exclude object from result
*
* @param ChildSocolissimoAreaFreeshippingDom $socolissimoAreaFreeshippingDom Object to remove from the list of results
*
* @return ChildSocolissimoAreaFreeshippingDomQuery The current query, for fluid interface
*/
public function prune($socolissimoAreaFreeshippingDom = null)
{
if ($socolissimoAreaFreeshippingDom) {
$this->addUsingAlias(SocolissimoAreaFreeshippingDomTableMap::ID, $socolissimoAreaFreeshippingDom->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the socolissimo_area_freeshipping_dom 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(SocolissimoAreaFreeshippingDomTableMap::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).
SocolissimoAreaFreeshippingDomTableMap::clearInstancePool();
SocolissimoAreaFreeshippingDomTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSocolissimoAreaFreeshippingDom or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSocolissimoAreaFreeshippingDom 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(SocolissimoAreaFreeshippingDomTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SocolissimoAreaFreeshippingDomTableMap::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();
SocolissimoAreaFreeshippingDomTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SocolissimoAreaFreeshippingDomTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SocolissimoAreaFreeshippingDomQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,645 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\SocolissimoAreaFreeshippingPr as ChildSocolissimoAreaFreeshippingPr;
use SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery as ChildSocolissimoAreaFreeshippingPrQuery;
use SoColissimo\Model\Map\SocolissimoAreaFreeshippingPrTableMap;
use SoColissimo\Model\Thelia\Model\Area;
/**
* Base class that represents a query for the 'socolissimo_area_freeshipping_pr' table.
*
*
*
* @method ChildSocolissimoAreaFreeshippingPrQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSocolissimoAreaFreeshippingPrQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildSocolissimoAreaFreeshippingPrQuery orderByDeliveryModeId($order = Criteria::ASC) Order by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingPrQuery orderByCartAmount($order = Criteria::ASC) Order by the cart_amount column
*
* @method ChildSocolissimoAreaFreeshippingPrQuery groupById() Group by the id column
* @method ChildSocolissimoAreaFreeshippingPrQuery groupByAreaId() Group by the area_id column
* @method ChildSocolissimoAreaFreeshippingPrQuery groupByDeliveryModeId() Group by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingPrQuery groupByCartAmount() Group by the cart_amount column
*
* @method ChildSocolissimoAreaFreeshippingPrQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSocolissimoAreaFreeshippingPrQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSocolissimoAreaFreeshippingPrQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSocolissimoAreaFreeshippingPrQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildSocolissimoAreaFreeshippingPrQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildSocolissimoAreaFreeshippingPrQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildSocolissimoAreaFreeshippingPrQuery leftJoinSocolissimoDeliveryMode($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoAreaFreeshippingPrQuery rightJoinSocolissimoDeliveryMode($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoAreaFreeshippingPrQuery innerJoinSocolissimoDeliveryMode($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @method ChildSocolissimoAreaFreeshippingPr findOne(ConnectionInterface $con = null) Return the first ChildSocolissimoAreaFreeshippingPr matching the query
* @method ChildSocolissimoAreaFreeshippingPr findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSocolissimoAreaFreeshippingPr matching the query, or a new ChildSocolissimoAreaFreeshippingPr object populated from the query conditions when no match is found
*
* @method ChildSocolissimoAreaFreeshippingPr findOneById(int $id) Return the first ChildSocolissimoAreaFreeshippingPr filtered by the id column
* @method ChildSocolissimoAreaFreeshippingPr findOneByAreaId(int $area_id) Return the first ChildSocolissimoAreaFreeshippingPr filtered by the area_id column
* @method ChildSocolissimoAreaFreeshippingPr findOneByDeliveryModeId(int $delivery_mode_id) Return the first ChildSocolissimoAreaFreeshippingPr filtered by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingPr findOneByCartAmount(string $cart_amount) Return the first ChildSocolissimoAreaFreeshippingPr filtered by the cart_amount column
*
* @method array findById(int $id) Return ChildSocolissimoAreaFreeshippingPr objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildSocolissimoAreaFreeshippingPr objects filtered by the area_id column
* @method array findByDeliveryModeId(int $delivery_mode_id) Return ChildSocolissimoAreaFreeshippingPr objects filtered by the delivery_mode_id column
* @method array findByCartAmount(string $cart_amount) Return ChildSocolissimoAreaFreeshippingPr objects filtered by the cart_amount column
*
*/
abstract class SocolissimoAreaFreeshippingPrQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\SocolissimoAreaFreeshippingPrQuery 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 = '\\SoColissimo\\Model\\SocolissimoAreaFreeshippingPr', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSocolissimoAreaFreeshippingPrQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSocolissimoAreaFreeshippingPrQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSocolissimoAreaFreeshippingPr|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SocolissimoAreaFreeshippingPrTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingPrTableMap::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 ChildSocolissimoAreaFreeshippingPr A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, CART_AMOUNT FROM socolissimo_area_freeshipping_pr WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildSocolissimoAreaFreeshippingPr();
$obj->hydrate($row);
SocolissimoAreaFreeshippingPrTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildSocolissimoAreaFreeshippingPr|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(12, 56, 832), $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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::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 ChildSocolissimoAreaFreeshippingPrQuery 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(SocolissimoAreaFreeshippingPrTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the area_id column
*
* Example usage:
* <code>
* $query->filterByAreaId(1234); // WHERE area_id = 1234
* $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
* $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
* </code>
*
* @see filterByArea()
*
* @param mixed $areaId 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the delivery_mode_id column
*
* Example usage:
* <code>
* $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
* $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
* $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
* </code>
*
* @see filterBySocolissimoDeliveryMode()
*
* @param mixed $deliveryModeId 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
{
if (is_array($deliveryModeId)) {
$useMinMax = false;
if (isset($deliveryModeId['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($deliveryModeId['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
}
/**
* Filter the query on the cart_amount column
*
* Example usage:
* <code>
* $query->filterByCartAmount(1234); // WHERE cart_amount = 1234
* $query->filterByCartAmount(array(12, 34)); // WHERE cart_amount IN (12, 34)
* $query->filterByCartAmount(array('min' => 12)); // WHERE cart_amount > 12
* </code>
*
* @param mixed $cartAmount 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 ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterByCartAmount($cartAmount = null, $comparison = null)
{
if (is_array($cartAmount)) {
$useMinMax = false;
if (isset($cartAmount['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cartAmount['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::CART_AMOUNT, $cartAmount, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
*
* @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
return $this
->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Area relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
// 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, 'Area');
}
return $this;
}
/**
* Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
*
* @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
{
if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
return $this
->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
} elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
// 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, 'SocolissimoDeliveryMode');
}
return $this;
}
/**
* Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoDeliveryMode($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
}
/**
* Exclude object from result
*
* @param ChildSocolissimoAreaFreeshippingPr $socolissimoAreaFreeshippingPr Object to remove from the list of results
*
* @return ChildSocolissimoAreaFreeshippingPrQuery The current query, for fluid interface
*/
public function prune($socolissimoAreaFreeshippingPr = null)
{
if ($socolissimoAreaFreeshippingPr) {
$this->addUsingAlias(SocolissimoAreaFreeshippingPrTableMap::ID, $socolissimoAreaFreeshippingPr->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the socolissimo_area_freeshipping_pr 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(SocolissimoAreaFreeshippingPrTableMap::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).
SocolissimoAreaFreeshippingPrTableMap::clearInstancePool();
SocolissimoAreaFreeshippingPrTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSocolissimoAreaFreeshippingPr or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSocolissimoAreaFreeshippingPr 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(SocolissimoAreaFreeshippingPrTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SocolissimoAreaFreeshippingPrTableMap::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();
SocolissimoAreaFreeshippingPrTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SocolissimoAreaFreeshippingPrTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SocolissimoAreaFreeshippingPrQuery

View File

@@ -0,0 +1,645 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\SocolissimoAreaFreeshipping as ChildSocolissimoAreaFreeshipping;
use SoColissimo\Model\SocolissimoAreaFreeshippingQuery as ChildSocolissimoAreaFreeshippingQuery;
use SoColissimo\Model\Map\SocolissimoAreaFreeshippingTableMap;
use SoColissimo\Model\Thelia\Model\Area;
/**
* Base class that represents a query for the 'socolissimo_area_freeshipping' table.
*
*
*
* @method ChildSocolissimoAreaFreeshippingQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSocolissimoAreaFreeshippingQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildSocolissimoAreaFreeshippingQuery orderByDeliveryModeId($order = Criteria::ASC) Order by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingQuery orderByCartAmount($order = Criteria::ASC) Order by the cart_amount column
*
* @method ChildSocolissimoAreaFreeshippingQuery groupById() Group by the id column
* @method ChildSocolissimoAreaFreeshippingQuery groupByAreaId() Group by the area_id column
* @method ChildSocolissimoAreaFreeshippingQuery groupByDeliveryModeId() Group by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshippingQuery groupByCartAmount() Group by the cart_amount column
*
* @method ChildSocolissimoAreaFreeshippingQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSocolissimoAreaFreeshippingQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSocolissimoAreaFreeshippingQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSocolissimoAreaFreeshippingQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildSocolissimoAreaFreeshippingQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildSocolissimoAreaFreeshippingQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildSocolissimoAreaFreeshippingQuery leftJoinSocolissimoDeliveryMode($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoAreaFreeshippingQuery rightJoinSocolissimoDeliveryMode($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoAreaFreeshippingQuery innerJoinSocolissimoDeliveryMode($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @method ChildSocolissimoAreaFreeshipping findOne(ConnectionInterface $con = null) Return the first ChildSocolissimoAreaFreeshipping matching the query
* @method ChildSocolissimoAreaFreeshipping findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSocolissimoAreaFreeshipping matching the query, or a new ChildSocolissimoAreaFreeshipping object populated from the query conditions when no match is found
*
* @method ChildSocolissimoAreaFreeshipping findOneById(int $id) Return the first ChildSocolissimoAreaFreeshipping filtered by the id column
* @method ChildSocolissimoAreaFreeshipping findOneByAreaId(int $area_id) Return the first ChildSocolissimoAreaFreeshipping filtered by the area_id column
* @method ChildSocolissimoAreaFreeshipping findOneByDeliveryModeId(int $delivery_mode_id) Return the first ChildSocolissimoAreaFreeshipping filtered by the delivery_mode_id column
* @method ChildSocolissimoAreaFreeshipping findOneByCartAmount(string $cart_amount) Return the first ChildSocolissimoAreaFreeshipping filtered by the cart_amount column
*
* @method array findById(int $id) Return ChildSocolissimoAreaFreeshipping objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildSocolissimoAreaFreeshipping objects filtered by the area_id column
* @method array findByDeliveryModeId(int $delivery_mode_id) Return ChildSocolissimoAreaFreeshipping objects filtered by the delivery_mode_id column
* @method array findByCartAmount(string $cart_amount) Return ChildSocolissimoAreaFreeshipping objects filtered by the cart_amount column
*
*/
abstract class SocolissimoAreaFreeshippingQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\SocolissimoAreaFreeshippingQuery 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 = '\\SoColissimo\\Model\\SocolissimoAreaFreeshipping', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSocolissimoAreaFreeshippingQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSocolissimoAreaFreeshippingQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\SocolissimoAreaFreeshippingQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSocolissimoAreaFreeshipping|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SocolissimoAreaFreeshippingTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SocolissimoAreaFreeshippingTableMap::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 ChildSocolissimoAreaFreeshipping A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, CART_AMOUNT FROM socolissimo_area_freeshipping WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildSocolissimoAreaFreeshipping();
$obj->hydrate($row);
SocolissimoAreaFreeshippingTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildSocolissimoAreaFreeshipping|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(12, 56, 832), $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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::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 ChildSocolissimoAreaFreeshippingQuery 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(SocolissimoAreaFreeshippingTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the area_id column
*
* Example usage:
* <code>
* $query->filterByAreaId(1234); // WHERE area_id = 1234
* $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
* $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
* </code>
*
* @see filterByArea()
*
* @param mixed $areaId 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the delivery_mode_id column
*
* Example usage:
* <code>
* $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
* $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
* $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
* </code>
*
* @see filterBySocolissimoDeliveryMode()
*
* @param mixed $deliveryModeId 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
{
if (is_array($deliveryModeId)) {
$useMinMax = false;
if (isset($deliveryModeId['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($deliveryModeId['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
}
/**
* Filter the query on the cart_amount column
*
* Example usage:
* <code>
* $query->filterByCartAmount(1234); // WHERE cart_amount = 1234
* $query->filterByCartAmount(array(12, 34)); // WHERE cart_amount IN (12, 34)
* $query->filterByCartAmount(array('min' => 12)); // WHERE cart_amount > 12
* </code>
*
* @param mixed $cartAmount 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 ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterByCartAmount($cartAmount = null, $comparison = null)
{
if (is_array($cartAmount)) {
$useMinMax = false;
if (isset($cartAmount['min'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cartAmount['max'])) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
*
* @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
return $this
->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoAreaFreeshippingTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Area relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
// 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, 'Area');
}
return $this;
}
/**
* Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
*
* @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
{
if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
return $this
->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
} elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoAreaFreeshippingTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
// 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, 'SocolissimoDeliveryMode');
}
return $this;
}
/**
* Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoDeliveryMode($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
}
/**
* Exclude object from result
*
* @param ChildSocolissimoAreaFreeshipping $socolissimoAreaFreeshipping Object to remove from the list of results
*
* @return ChildSocolissimoAreaFreeshippingQuery The current query, for fluid interface
*/
public function prune($socolissimoAreaFreeshipping = null)
{
if ($socolissimoAreaFreeshipping) {
$this->addUsingAlias(SocolissimoAreaFreeshippingTableMap::ID, $socolissimoAreaFreeshipping->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the socolissimo_area_freeshipping 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(SocolissimoAreaFreeshippingTableMap::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).
SocolissimoAreaFreeshippingTableMap::clearInstancePool();
SocolissimoAreaFreeshippingTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSocolissimoAreaFreeshipping or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSocolissimoAreaFreeshipping 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(SocolissimoAreaFreeshippingTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SocolissimoAreaFreeshippingTableMap::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();
SocolissimoAreaFreeshippingTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SocolissimoAreaFreeshippingTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SocolissimoAreaFreeshippingQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,720 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\SocolissimoDeliveryMode as ChildSocolissimoDeliveryMode;
use SoColissimo\Model\SocolissimoDeliveryModeQuery as ChildSocolissimoDeliveryModeQuery;
use SoColissimo\Model\Map\SocolissimoDeliveryModeTableMap;
/**
* Base class that represents a query for the 'socolissimo_delivery_mode' table.
*
*
*
* @method ChildSocolissimoDeliveryModeQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSocolissimoDeliveryModeQuery orderByTitle($order = Criteria::ASC) Order by the title column
* @method ChildSocolissimoDeliveryModeQuery orderByCode($order = Criteria::ASC) Order by the code column
* @method ChildSocolissimoDeliveryModeQuery orderByFreeshippingActive($order = Criteria::ASC) Order by the freeshipping_active column
* @method ChildSocolissimoDeliveryModeQuery orderByFreeshippingFrom($order = Criteria::ASC) Order by the freeshipping_from column
*
* @method ChildSocolissimoDeliveryModeQuery groupById() Group by the id column
* @method ChildSocolissimoDeliveryModeQuery groupByTitle() Group by the title column
* @method ChildSocolissimoDeliveryModeQuery groupByCode() Group by the code column
* @method ChildSocolissimoDeliveryModeQuery groupByFreeshippingActive() Group by the freeshipping_active column
* @method ChildSocolissimoDeliveryModeQuery groupByFreeshippingFrom() Group by the freeshipping_from column
*
* @method ChildSocolissimoDeliveryModeQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSocolissimoDeliveryModeQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSocolissimoDeliveryModeQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSocolissimoDeliveryModeQuery leftJoinSocolissimoPrice($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoPrice relation
* @method ChildSocolissimoDeliveryModeQuery rightJoinSocolissimoPrice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoPrice relation
* @method ChildSocolissimoDeliveryModeQuery innerJoinSocolissimoPrice($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoPrice relation
*
* @method ChildSocolissimoDeliveryModeQuery leftJoinSocolissimoAreaFreeshippingDom($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoAreaFreeshippingDom relation
* @method ChildSocolissimoDeliveryModeQuery rightJoinSocolissimoAreaFreeshippingDom($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoAreaFreeshippingDom relation
* @method ChildSocolissimoDeliveryModeQuery innerJoinSocolissimoAreaFreeshippingDom($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoAreaFreeshippingDom relation
*
* @method ChildSocolissimoDeliveryModeQuery leftJoinSocolissimoAreaFreeshippingPr($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoAreaFreeshippingPr relation
* @method ChildSocolissimoDeliveryModeQuery rightJoinSocolissimoAreaFreeshippingPr($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoAreaFreeshippingPr relation
* @method ChildSocolissimoDeliveryModeQuery innerJoinSocolissimoAreaFreeshippingPr($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoAreaFreeshippingPr relation
*
* @method ChildSocolissimoDeliveryMode findOne(ConnectionInterface $con = null) Return the first ChildSocolissimoDeliveryMode matching the query
* @method ChildSocolissimoDeliveryMode findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSocolissimoDeliveryMode matching the query, or a new ChildSocolissimoDeliveryMode object populated from the query conditions when no match is found
*
* @method ChildSocolissimoDeliveryMode findOneById(int $id) Return the first ChildSocolissimoDeliveryMode filtered by the id column
* @method ChildSocolissimoDeliveryMode findOneByTitle(string $title) Return the first ChildSocolissimoDeliveryMode filtered by the title column
* @method ChildSocolissimoDeliveryMode findOneByCode(string $code) Return the first ChildSocolissimoDeliveryMode filtered by the code column
* @method ChildSocolissimoDeliveryMode findOneByFreeshippingActive(boolean $freeshipping_active) Return the first ChildSocolissimoDeliveryMode filtered by the freeshipping_active column
* @method ChildSocolissimoDeliveryMode findOneByFreeshippingFrom(double $freeshipping_from) Return the first ChildSocolissimoDeliveryMode filtered by the freeshipping_from column
*
* @method array findById(int $id) Return ChildSocolissimoDeliveryMode objects filtered by the id column
* @method array findByTitle(string $title) Return ChildSocolissimoDeliveryMode objects filtered by the title column
* @method array findByCode(string $code) Return ChildSocolissimoDeliveryMode objects filtered by the code column
* @method array findByFreeshippingActive(boolean $freeshipping_active) Return ChildSocolissimoDeliveryMode objects filtered by the freeshipping_active column
* @method array findByFreeshippingFrom(double $freeshipping_from) Return ChildSocolissimoDeliveryMode objects filtered by the freeshipping_from column
*
*/
abstract class SocolissimoDeliveryModeQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\SocolissimoDeliveryModeQuery 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 = '\\SoColissimo\\Model\\SocolissimoDeliveryMode', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSocolissimoDeliveryModeQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSocolissimoDeliveryModeQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\SocolissimoDeliveryModeQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\SocolissimoDeliveryModeQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSocolissimoDeliveryMode|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SocolissimoDeliveryModeTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SocolissimoDeliveryModeTableMap::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 ChildSocolissimoDeliveryMode A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, TITLE, CODE, FREESHIPPING_ACTIVE, FREESHIPPING_FROM FROM socolissimo_delivery_mode WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildSocolissimoDeliveryMode();
$obj->hydrate($row);
SocolissimoDeliveryModeTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildSocolissimoDeliveryMode|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(12, 56, 832), $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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::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 ChildSocolissimoDeliveryModeQuery 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(SocolissimoDeliveryModeTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the title column
*
* Example usage:
* <code>
* $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
* $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
* </code>
*
* @param string $title 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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterByTitle($title = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($title)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $title)) {
$title = str_replace('*', '%', $title);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::TITLE, $title, $comparison);
}
/**
* Filter the query on the code column
*
* Example usage:
* <code>
* $query->filterByCode('fooValue'); // WHERE code = 'fooValue'
* $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
* </code>
*
* @param string $code 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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterByCode($code = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($code)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $code)) {
$code = str_replace('*', '%', $code);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::CODE, $code, $comparison);
}
/**
* Filter the query on the freeshipping_active column
*
* Example usage:
* <code>
* $query->filterByFreeshippingActive(true); // WHERE freeshipping_active = true
* $query->filterByFreeshippingActive('yes'); // WHERE freeshipping_active = true
* </code>
*
* @param boolean|string $freeshippingActive The value to use as filter.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterByFreeshippingActive($freeshippingActive = null, $comparison = null)
{
if (is_string($freeshippingActive)) {
$freeshipping_active = in_array(strtolower($freeshippingActive), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_ACTIVE, $freeshippingActive, $comparison);
}
/**
* Filter the query on the freeshipping_from column
*
* Example usage:
* <code>
* $query->filterByFreeshippingFrom(1234); // WHERE freeshipping_from = 1234
* $query->filterByFreeshippingFrom(array(12, 34)); // WHERE freeshipping_from IN (12, 34)
* $query->filterByFreeshippingFrom(array('min' => 12)); // WHERE freeshipping_from > 12
* </code>
*
* @param mixed $freeshippingFrom 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 ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterByFreeshippingFrom($freeshippingFrom = null, $comparison = null)
{
if (is_array($freeshippingFrom)) {
$useMinMax = false;
if (isset($freeshippingFrom['min'])) {
$this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($freeshippingFrom['max'])) {
$this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoPrice object
*
* @param \SoColissimo\Model\SocolissimoPrice|ObjectCollection $socolissimoPrice the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterBySocolissimoPrice($socolissimoPrice, $comparison = null)
{
if ($socolissimoPrice instanceof \SoColissimo\Model\SocolissimoPrice) {
return $this
->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoPrice->getDeliveryModeId(), $comparison);
} elseif ($socolissimoPrice instanceof ObjectCollection) {
return $this
->useSocolissimoPriceQuery()
->filterByPrimaryKeys($socolissimoPrice->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySocolissimoPrice() only accepts arguments of type \SoColissimo\Model\SocolissimoPrice or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoPrice relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function joinSocolissimoPrice($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoPrice');
// 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, 'SocolissimoPrice');
}
return $this;
}
/**
* Use the SocolissimoPrice relation SocolissimoPrice 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 \SoColissimo\Model\SocolissimoPriceQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoPriceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoPrice($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoPrice', '\SoColissimo\Model\SocolissimoPriceQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoAreaFreeshippingDom object
*
* @param \SoColissimo\Model\SocolissimoAreaFreeshippingDom|ObjectCollection $socolissimoAreaFreeshippingDom the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterBySocolissimoAreaFreeshippingDom($socolissimoAreaFreeshippingDom, $comparison = null)
{
if ($socolissimoAreaFreeshippingDom instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingDom) {
return $this
->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoAreaFreeshippingDom->getDeliveryModeId(), $comparison);
} elseif ($socolissimoAreaFreeshippingDom instanceof ObjectCollection) {
return $this
->useSocolissimoAreaFreeshippingDomQuery()
->filterByPrimaryKeys($socolissimoAreaFreeshippingDom->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySocolissimoAreaFreeshippingDom() only accepts arguments of type \SoColissimo\Model\SocolissimoAreaFreeshippingDom or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoAreaFreeshippingDom relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function joinSocolissimoAreaFreeshippingDom($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoAreaFreeshippingDom');
// 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, 'SocolissimoAreaFreeshippingDom');
}
return $this;
}
/**
* Use the SocolissimoAreaFreeshippingDom relation SocolissimoAreaFreeshippingDom 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 \SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoAreaFreeshippingDomQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoAreaFreeshippingDom($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoAreaFreeshippingDom', '\SoColissimo\Model\SocolissimoAreaFreeshippingDomQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoAreaFreeshippingPr object
*
* @param \SoColissimo\Model\SocolissimoAreaFreeshippingPr|ObjectCollection $socolissimoAreaFreeshippingPr the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function filterBySocolissimoAreaFreeshippingPr($socolissimoAreaFreeshippingPr, $comparison = null)
{
if ($socolissimoAreaFreeshippingPr instanceof \SoColissimo\Model\SocolissimoAreaFreeshippingPr) {
return $this
->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoAreaFreeshippingPr->getDeliveryModeId(), $comparison);
} elseif ($socolissimoAreaFreeshippingPr instanceof ObjectCollection) {
return $this
->useSocolissimoAreaFreeshippingPrQuery()
->filterByPrimaryKeys($socolissimoAreaFreeshippingPr->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySocolissimoAreaFreeshippingPr() only accepts arguments of type \SoColissimo\Model\SocolissimoAreaFreeshippingPr or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoAreaFreeshippingPr relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function joinSocolissimoAreaFreeshippingPr($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoAreaFreeshippingPr');
// 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, 'SocolissimoAreaFreeshippingPr');
}
return $this;
}
/**
* Use the SocolissimoAreaFreeshippingPr relation SocolissimoAreaFreeshippingPr 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 \SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoAreaFreeshippingPrQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoAreaFreeshippingPr($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoAreaFreeshippingPr', '\SoColissimo\Model\SocolissimoAreaFreeshippingPrQuery');
}
/**
* Exclude object from result
*
* @param ChildSocolissimoDeliveryMode $socolissimoDeliveryMode Object to remove from the list of results
*
* @return ChildSocolissimoDeliveryModeQuery The current query, for fluid interface
*/
public function prune($socolissimoDeliveryMode = null)
{
if ($socolissimoDeliveryMode) {
$this->addUsingAlias(SocolissimoDeliveryModeTableMap::ID, $socolissimoDeliveryMode->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the socolissimo_delivery_mode 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(SocolissimoDeliveryModeTableMap::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).
SocolissimoDeliveryModeTableMap::clearInstancePool();
SocolissimoDeliveryModeTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSocolissimoDeliveryMode or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSocolissimoDeliveryMode 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(SocolissimoDeliveryModeTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SocolissimoDeliveryModeTableMap::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();
SocolissimoDeliveryModeTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SocolissimoDeliveryModeTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SocolissimoDeliveryModeQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,535 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use SoColissimo\Model\SocolissimoFreeshipping as ChildSocolissimoFreeshipping;
use SoColissimo\Model\SocolissimoFreeshippingQuery as ChildSocolissimoFreeshippingQuery;
use SoColissimo\Model\Map\SocolissimoFreeshippingTableMap;
/**
* Base class that represents a query for the 'socolissimo_freeshipping' table.
*
*
*
* @method ChildSocolissimoFreeshippingQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSocolissimoFreeshippingQuery orderByActive($order = Criteria::ASC) Order by the active column
* @method ChildSocolissimoFreeshippingQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
* @method ChildSocolissimoFreeshippingQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
*
* @method ChildSocolissimoFreeshippingQuery groupById() Group by the id column
* @method ChildSocolissimoFreeshippingQuery groupByActive() Group by the active column
* @method ChildSocolissimoFreeshippingQuery groupByCreatedAt() Group by the created_at column
* @method ChildSocolissimoFreeshippingQuery groupByUpdatedAt() Group by the updated_at column
*
* @method ChildSocolissimoFreeshippingQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSocolissimoFreeshippingQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSocolissimoFreeshippingQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSocolissimoFreeshipping findOne(ConnectionInterface $con = null) Return the first ChildSocolissimoFreeshipping matching the query
* @method ChildSocolissimoFreeshipping findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSocolissimoFreeshipping matching the query, or a new ChildSocolissimoFreeshipping object populated from the query conditions when no match is found
*
* @method ChildSocolissimoFreeshipping findOneById(int $id) Return the first ChildSocolissimoFreeshipping filtered by the id column
* @method ChildSocolissimoFreeshipping findOneByActive(boolean $active) Return the first ChildSocolissimoFreeshipping filtered by the active column
* @method ChildSocolissimoFreeshipping findOneByCreatedAt(string $created_at) Return the first ChildSocolissimoFreeshipping filtered by the created_at column
* @method ChildSocolissimoFreeshipping findOneByUpdatedAt(string $updated_at) Return the first ChildSocolissimoFreeshipping filtered by the updated_at column
*
* @method array findById(int $id) Return ChildSocolissimoFreeshipping objects filtered by the id column
* @method array findByActive(boolean $active) Return ChildSocolissimoFreeshipping objects filtered by the active column
* @method array findByCreatedAt(string $created_at) Return ChildSocolissimoFreeshipping objects filtered by the created_at column
* @method array findByUpdatedAt(string $updated_at) Return ChildSocolissimoFreeshipping objects filtered by the updated_at column
*
*/
abstract class SocolissimoFreeshippingQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\SocolissimoFreeshippingQuery 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 = '\\SoColissimo\\Model\\SocolissimoFreeshipping', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSocolissimoFreeshippingQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSocolissimoFreeshippingQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\SocolissimoFreeshippingQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\SocolissimoFreeshippingQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSocolissimoFreeshipping|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SocolissimoFreeshippingTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SocolissimoFreeshippingTableMap::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 ChildSocolissimoFreeshipping A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, ACTIVE, CREATED_AT, UPDATED_AT FROM socolissimo_freeshipping WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildSocolissimoFreeshipping();
$obj->hydrate($row);
SocolissimoFreeshippingTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildSocolissimoFreeshipping|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(12, 56, 832), $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 ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::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 ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::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 ChildSocolissimoFreeshippingQuery 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(SocolissimoFreeshippingTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the active column
*
* Example usage:
* <code>
* $query->filterByActive(true); // WHERE active = true
* $query->filterByActive('yes'); // WHERE active = true
* </code>
*
* @param boolean|string $active The value to use as filter.
* Non-boolean arguments are converted using the following rules:
* * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
* * 0, '0', 'false', 'off', and 'no' are converted to boolean false
* Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function filterByActive($active = null, $comparison = null)
{
if (is_string($active)) {
$active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::ACTIVE, $active, $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 ChildSocolissimoFreeshippingQuery 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(SocolissimoFreeshippingTableMap::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($createdAt['max'])) {
$this->addUsingAlias(SocolissimoFreeshippingTableMap::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::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 ChildSocolissimoFreeshippingQuery 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(SocolissimoFreeshippingTableMap::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($updatedAt['max'])) {
$this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, $updatedAt, $comparison);
}
/**
* Exclude object from result
*
* @param ChildSocolissimoFreeshipping $socolissimoFreeshipping Object to remove from the list of results
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function prune($socolissimoFreeshipping = null)
{
if ($socolissimoFreeshipping) {
$this->addUsingAlias(SocolissimoFreeshippingTableMap::ID, $socolissimoFreeshipping->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the socolissimo_freeshipping 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(SocolissimoFreeshippingTableMap::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).
SocolissimoFreeshippingTableMap::clearInstancePool();
SocolissimoFreeshippingTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSocolissimoFreeshipping or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSocolissimoFreeshipping 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(SocolissimoFreeshippingTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SocolissimoFreeshippingTableMap::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();
SocolissimoFreeshippingTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SocolissimoFreeshippingTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SocolissimoFreeshippingTableMap::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SocolissimoFreeshippingTableMap::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SocolissimoFreeshippingTableMap::UPDATED_AT);
}
/**
* Order by create date desc
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SocolissimoFreeshippingTableMap::CREATED_AT);
}
/**
* Order by create date asc
*
* @return ChildSocolissimoFreeshippingQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SocolissimoFreeshippingTableMap::CREATED_AT);
}
} // SocolissimoFreeshippingQuery

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,780 @@
<?php
namespace SoColissimo\Model\Base;
use \Exception;
use \PDO;
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;
use SoColissimo\Model\SocolissimoPrice as ChildSocolissimoPrice;
use SoColissimo\Model\SocolissimoPriceQuery as ChildSocolissimoPriceQuery;
use SoColissimo\Model\Map\SocolissimoPriceTableMap;
use SoColissimo\Model\Thelia\Model\Area;
/**
* Base class that represents a query for the 'socolissimo_price' table.
*
*
*
* @method ChildSocolissimoPriceQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildSocolissimoPriceQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
* @method ChildSocolissimoPriceQuery orderByDeliveryModeId($order = Criteria::ASC) Order by the delivery_mode_id column
* @method ChildSocolissimoPriceQuery orderByWeightMax($order = Criteria::ASC) Order by the weight_max column
* @method ChildSocolissimoPriceQuery orderByPriceMax($order = Criteria::ASC) Order by the price_max column
* @method ChildSocolissimoPriceQuery orderByFrancoMinPrice($order = Criteria::ASC) Order by the franco_min_price column
* @method ChildSocolissimoPriceQuery orderByPrice($order = Criteria::ASC) Order by the price column
*
* @method ChildSocolissimoPriceQuery groupById() Group by the id column
* @method ChildSocolissimoPriceQuery groupByAreaId() Group by the area_id column
* @method ChildSocolissimoPriceQuery groupByDeliveryModeId() Group by the delivery_mode_id column
* @method ChildSocolissimoPriceQuery groupByWeightMax() Group by the weight_max column
* @method ChildSocolissimoPriceQuery groupByPriceMax() Group by the price_max column
* @method ChildSocolissimoPriceQuery groupByFrancoMinPrice() Group by the franco_min_price column
* @method ChildSocolissimoPriceQuery groupByPrice() Group by the price column
*
* @method ChildSocolissimoPriceQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildSocolissimoPriceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildSocolissimoPriceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildSocolissimoPriceQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
* @method ChildSocolissimoPriceQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
* @method ChildSocolissimoPriceQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
*
* @method ChildSocolissimoPriceQuery leftJoinSocolissimoDeliveryMode($relationAlias = null) Adds a LEFT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoPriceQuery rightJoinSocolissimoDeliveryMode($relationAlias = null) Adds a RIGHT JOIN clause to the query using the SocolissimoDeliveryMode relation
* @method ChildSocolissimoPriceQuery innerJoinSocolissimoDeliveryMode($relationAlias = null) Adds a INNER JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @method ChildSocolissimoPrice findOne(ConnectionInterface $con = null) Return the first ChildSocolissimoPrice matching the query
* @method ChildSocolissimoPrice findOneOrCreate(ConnectionInterface $con = null) Return the first ChildSocolissimoPrice matching the query, or a new ChildSocolissimoPrice object populated from the query conditions when no match is found
*
* @method ChildSocolissimoPrice findOneById(int $id) Return the first ChildSocolissimoPrice filtered by the id column
* @method ChildSocolissimoPrice findOneByAreaId(int $area_id) Return the first ChildSocolissimoPrice filtered by the area_id column
* @method ChildSocolissimoPrice findOneByDeliveryModeId(int $delivery_mode_id) Return the first ChildSocolissimoPrice filtered by the delivery_mode_id column
* @method ChildSocolissimoPrice findOneByWeightMax(double $weight_max) Return the first ChildSocolissimoPrice filtered by the weight_max column
* @method ChildSocolissimoPrice findOneByPriceMax(double $price_max) Return the first ChildSocolissimoPrice filtered by the price_max column
* @method ChildSocolissimoPrice findOneByFrancoMinPrice(double $franco_min_price) Return the first ChildSocolissimoPrice filtered by the franco_min_price column
* @method ChildSocolissimoPrice findOneByPrice(double $price) Return the first ChildSocolissimoPrice filtered by the price column
*
* @method array findById(int $id) Return ChildSocolissimoPrice objects filtered by the id column
* @method array findByAreaId(int $area_id) Return ChildSocolissimoPrice objects filtered by the area_id column
* @method array findByDeliveryModeId(int $delivery_mode_id) Return ChildSocolissimoPrice objects filtered by the delivery_mode_id column
* @method array findByWeightMax(double $weight_max) Return ChildSocolissimoPrice objects filtered by the weight_max column
* @method array findByPriceMax(double $price_max) Return ChildSocolissimoPrice objects filtered by the price_max column
* @method array findByFrancoMinPrice(double $franco_min_price) Return ChildSocolissimoPrice objects filtered by the franco_min_price column
* @method array findByPrice(double $price) Return ChildSocolissimoPrice objects filtered by the price column
*
*/
abstract class SocolissimoPriceQuery extends ModelCriteria
{
/**
* Initializes internal state of \SoColissimo\Model\Base\SocolissimoPriceQuery 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 = '\\SoColissimo\\Model\\SocolissimoPrice', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new ChildSocolissimoPriceQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return ChildSocolissimoPriceQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof \SoColissimo\Model\SocolissimoPriceQuery) {
return $criteria;
}
$query = new \SoColissimo\Model\SocolissimoPriceQuery();
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(12, $con);
* </code>
*
* @param mixed $key Primary key to use for the query
* @param ConnectionInterface $con an optional connection object
*
* @return ChildSocolissimoPrice|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = SocolissimoPriceTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getServiceContainer()->getReadConnection(SocolissimoPriceTableMap::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 ChildSocolissimoPrice A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT ID, AREA_ID, DELIVERY_MODE_ID, WEIGHT_MAX, PRICE_MAX, FRANCO_MIN_PRICE, PRICE FROM socolissimo_price WHERE ID = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, 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 ChildSocolissimoPrice();
$obj->hydrate($row);
SocolissimoPriceTableMap::addInstanceToPool($obj, (string) $key);
}
$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 ChildSocolissimoPrice|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(12, 56, 832), $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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(SocolissimoPriceTableMap::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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(SocolissimoPriceTableMap::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 ChildSocolissimoPriceQuery 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(SocolissimoPriceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::ID, $id, $comparison);
}
/**
* Filter the query on the area_id column
*
* Example usage:
* <code>
* $query->filterByAreaId(1234); // WHERE area_id = 1234
* $query->filterByAreaId(array(12, 34)); // WHERE area_id IN (12, 34)
* $query->filterByAreaId(array('min' => 12)); // WHERE area_id > 12
* </code>
*
* @see filterByArea()
*
* @param mixed $areaId 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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByAreaId($areaId = null, $comparison = null)
{
if (is_array($areaId)) {
$useMinMax = false;
if (isset($areaId['min'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($areaId['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $areaId, $comparison);
}
/**
* Filter the query on the delivery_mode_id column
*
* Example usage:
* <code>
* $query->filterByDeliveryModeId(1234); // WHERE delivery_mode_id = 1234
* $query->filterByDeliveryModeId(array(12, 34)); // WHERE delivery_mode_id IN (12, 34)
* $query->filterByDeliveryModeId(array('min' => 12)); // WHERE delivery_mode_id > 12
* </code>
*
* @see filterBySocolissimoDeliveryMode()
*
* @param mixed $deliveryModeId 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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByDeliveryModeId($deliveryModeId = null, $comparison = null)
{
if (is_array($deliveryModeId)) {
$useMinMax = false;
if (isset($deliveryModeId['min'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($deliveryModeId['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId, $comparison);
}
/**
* Filter the query on the weight_max column
*
* Example usage:
* <code>
* $query->filterByWeightMax(1234); // WHERE weight_max = 1234
* $query->filterByWeightMax(array(12, 34)); // WHERE weight_max IN (12, 34)
* $query->filterByWeightMax(array('min' => 12)); // WHERE weight_max > 12
* </code>
*
* @param mixed $weightMax 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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByWeightMax($weightMax = null, $comparison = null)
{
if (is_array($weightMax)) {
$useMinMax = false;
if (isset($weightMax['min'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::WEIGHT_MAX, $weightMax['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($weightMax['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::WEIGHT_MAX, $weightMax['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::WEIGHT_MAX, $weightMax, $comparison);
}
/**
* Filter the query on the price_max column
*
* Example usage:
* <code>
* $query->filterByPriceMax(1234); // WHERE price_max = 1234
* $query->filterByPriceMax(array(12, 34)); // WHERE price_max IN (12, 34)
* $query->filterByPriceMax(array('min' => 12)); // WHERE price_max > 12
* </code>
*
* @param mixed $priceMax 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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByPriceMax($priceMax = null, $comparison = null)
{
if (is_array($priceMax)) {
$useMinMax = false;
if (isset($priceMax['min'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::PRICE_MAX, $priceMax['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($priceMax['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::PRICE_MAX, $priceMax['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::PRICE_MAX, $priceMax, $comparison);
}
/**
* Filter the query on the franco_min_price column
*
* Example usage:
* <code>
* $query->filterByFrancoMinPrice(1234); // WHERE franco_min_price = 1234
* $query->filterByFrancoMinPrice(array(12, 34)); // WHERE franco_min_price IN (12, 34)
* $query->filterByFrancoMinPrice(array('min' => 12)); // WHERE franco_min_price > 12
* </code>
*
* @param mixed $francoMinPrice 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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByFrancoMinPrice($francoMinPrice = null, $comparison = null)
{
if (is_array($francoMinPrice)) {
$useMinMax = false;
if (isset($francoMinPrice['min'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($francoMinPrice['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice, $comparison);
}
/**
* Filter the query on the price column
*
* Example usage:
* <code>
* $query->filterByPrice(1234); // WHERE price = 1234
* $query->filterByPrice(array(12, 34)); // WHERE price IN (12, 34)
* $query->filterByPrice(array('min' => 12)); // WHERE price > 12
* </code>
*
* @param mixed $price 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 ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByPrice($price = null, $comparison = null)
{
if (is_array($price)) {
$useMinMax = false;
if (isset($price['min'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($price['max'])) {
$this->addUsingAlias(SocolissimoPriceTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(SocolissimoPriceTableMap::PRICE, $price, $comparison);
}
/**
* Filter the query by a related \SoColissimo\Model\Thelia\Model\Area object
*
* @param \SoColissimo\Model\Thelia\Model\Area|ObjectCollection $area The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterByArea($area, $comparison = null)
{
if ($area instanceof \SoColissimo\Model\Thelia\Model\Area) {
return $this
->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $area->getId(), $comparison);
} elseif ($area instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoPriceTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByArea() only accepts arguments of type \SoColissimo\Model\Thelia\Model\Area or Collection');
}
}
/**
* Adds a JOIN clause to the query using the Area relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function joinArea($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Area');
// 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, 'Area');
}
return $this;
}
/**
* Use the Area relation Area 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 \SoColissimo\Model\Thelia\Model\AreaQuery A secondary query class using the current class as primary query
*/
public function useAreaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinArea($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Area', '\SoColissimo\Model\Thelia\Model\AreaQuery');
}
/**
* Filter the query by a related \SoColissimo\Model\SocolissimoDeliveryMode object
*
* @param \SoColissimo\Model\SocolissimoDeliveryMode|ObjectCollection $socolissimoDeliveryMode The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function filterBySocolissimoDeliveryMode($socolissimoDeliveryMode, $comparison = null)
{
if ($socolissimoDeliveryMode instanceof \SoColissimo\Model\SocolissimoDeliveryMode) {
return $this
->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->getId(), $comparison);
} elseif ($socolissimoDeliveryMode instanceof ObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this
->addUsingAlias(SocolissimoPriceTableMap::DELIVERY_MODE_ID, $socolissimoDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySocolissimoDeliveryMode() only accepts arguments of type \SoColissimo\Model\SocolissimoDeliveryMode or Collection');
}
}
/**
* Adds a JOIN clause to the query using the SocolissimoDeliveryMode relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function joinSocolissimoDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('SocolissimoDeliveryMode');
// 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, 'SocolissimoDeliveryMode');
}
return $this;
}
/**
* Use the SocolissimoDeliveryMode relation SocolissimoDeliveryMode 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 \SoColissimo\Model\SocolissimoDeliveryModeQuery A secondary query class using the current class as primary query
*/
public function useSocolissimoDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinSocolissimoDeliveryMode($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'SocolissimoDeliveryMode', '\SoColissimo\Model\SocolissimoDeliveryModeQuery');
}
/**
* Exclude object from result
*
* @param ChildSocolissimoPrice $socolissimoPrice Object to remove from the list of results
*
* @return ChildSocolissimoPriceQuery The current query, for fluid interface
*/
public function prune($socolissimoPrice = null)
{
if ($socolissimoPrice) {
$this->addUsingAlias(SocolissimoPriceTableMap::ID, $socolissimoPrice->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
/**
* Deletes all rows from the socolissimo_price 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(SocolissimoPriceTableMap::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).
SocolissimoPriceTableMap::clearInstancePool();
SocolissimoPriceTableMap::clearRelatedInstancePool();
$con->commit();
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
return $affectedRows;
}
/**
* Performs a DELETE on the database, given a ChildSocolissimoPrice or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ChildSocolissimoPrice 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(SocolissimoPriceTableMap::DATABASE_NAME);
}
$criteria = $this;
// Set the correct dbName
$criteria->setDbName(SocolissimoPriceTableMap::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();
SocolissimoPriceTableMap::removeInstanceFromPool($criteria);
$affectedRows += ModelCriteria::delete($con);
SocolissimoPriceTableMap::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
} // SocolissimoPriceQuery