Ajout et config du module Chronopost
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,645 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping as ChildChronopostHomeDeliveryAreaFreeshipping;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshippingQuery as ChildChronopostHomeDeliveryAreaFreeshippingQuery;
|
||||
use ChronopostHomeDelivery\Model\Map\ChronopostHomeDeliveryAreaFreeshippingTableMap;
|
||||
use ChronopostHomeDelivery\Model\Thelia\Model\Area;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'chronopost_home_delivery_area_freeshipping' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery orderByDeliveryModeId($order = Criteria::ASC) Order by the delivery_mode_id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery orderByCartAmount($order = Criteria::ASC) Order by the cart_amount column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery groupById() Group by the id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery groupByAreaId() Group by the area_id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery groupByDeliveryModeId() Group by the delivery_mode_id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery groupByCartAmount() Group by the cart_amount column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery leftJoinChronopostHomeDeliveryDeliveryMode($relationAlias = null) Adds a LEFT JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery rightJoinChronopostHomeDeliveryDeliveryMode($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshippingQuery innerJoinChronopostHomeDeliveryDeliveryMode($relationAlias = null) Adds a INNER JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshipping findOne(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryAreaFreeshipping matching the query
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshipping findOneOrCreate(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryAreaFreeshipping matching the query, or a new ChildChronopostHomeDeliveryAreaFreeshipping object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshipping findOneById(int $id) Return the first ChildChronopostHomeDeliveryAreaFreeshipping filtered by the id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshipping findOneByAreaId(int $area_id) Return the first ChildChronopostHomeDeliveryAreaFreeshipping filtered by the area_id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshipping findOneByDeliveryModeId(int $delivery_mode_id) Return the first ChildChronopostHomeDeliveryAreaFreeshipping filtered by the delivery_mode_id column
|
||||
* @method ChildChronopostHomeDeliveryAreaFreeshipping findOneByCartAmount(string $cart_amount) Return the first ChildChronopostHomeDeliveryAreaFreeshipping filtered by the cart_amount column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildChronopostHomeDeliveryAreaFreeshipping objects filtered by the id column
|
||||
* @method array findByAreaId(int $area_id) Return ChildChronopostHomeDeliveryAreaFreeshipping objects filtered by the area_id column
|
||||
* @method array findByDeliveryModeId(int $delivery_mode_id) Return ChildChronopostHomeDeliveryAreaFreeshipping objects filtered by the delivery_mode_id column
|
||||
* @method array findByCartAmount(string $cart_amount) Return ChildChronopostHomeDeliveryAreaFreeshipping objects filtered by the cart_amount column
|
||||
*
|
||||
*/
|
||||
abstract class ChronopostHomeDeliveryAreaFreeshippingQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryAreaFreeshippingQuery 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 = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryAreaFreeshipping', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildChronopostHomeDeliveryAreaFreeshippingQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryAreaFreeshippingQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshippingQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshippingQuery();
|
||||
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 ChildChronopostHomeDeliveryAreaFreeshipping|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ChronopostHomeDeliveryAreaFreeshippingTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ChronopostHomeDeliveryAreaFreeshippingTableMap::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 ChildChronopostHomeDeliveryAreaFreeshipping 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 chronopost_home_delivery_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 ChildChronopostHomeDeliveryAreaFreeshipping();
|
||||
$obj->hydrate($row);
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::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 ChildChronopostHomeDeliveryAreaFreeshipping|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 ChildChronopostHomeDeliveryAreaFreeshippingQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::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 ChildChronopostHomeDeliveryAreaFreeshippingQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::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 ChildChronopostHomeDeliveryAreaFreeshippingQuery 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(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::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 ChildChronopostHomeDeliveryAreaFreeshippingQuery 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(ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($areaId['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::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 filterByChronopostHomeDeliveryDeliveryMode()
|
||||
*
|
||||
* @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 ChildChronopostHomeDeliveryAreaFreeshippingQuery 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(ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($deliveryModeId['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::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 ChildChronopostHomeDeliveryAreaFreeshippingQuery 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(ChronopostHomeDeliveryAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($cartAmount['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::CART_AMOUNT, $cartAmount, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\Thelia\Model\Area object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\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 ChildChronopostHomeDeliveryAreaFreeshippingQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByArea($area, $comparison = null)
|
||||
{
|
||||
if ($area instanceof \ChronopostHomeDelivery\Model\Thelia\Model\Area) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID, $area->getId(), $comparison);
|
||||
} elseif ($area instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByArea() only accepts arguments of type \ChronopostHomeDelivery\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 ChildChronopostHomeDeliveryAreaFreeshippingQuery 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 \ChronopostHomeDelivery\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', '\ChronopostHomeDelivery\Model\Thelia\Model\AreaQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode|ObjectCollection $chronopostHomeDeliveryDeliveryMode The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryAreaFreeshippingQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChronopostHomeDeliveryDeliveryMode($chronopostHomeDeliveryDeliveryMode, $comparison = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryDeliveryMode instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID, $chronopostHomeDeliveryDeliveryMode->getId(), $comparison);
|
||||
} elseif ($chronopostHomeDeliveryDeliveryMode instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID, $chronopostHomeDeliveryDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByChronopostHomeDeliveryDeliveryMode() only accepts arguments of type \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryAreaFreeshippingQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinChronopostHomeDeliveryDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ChronopostHomeDeliveryDeliveryMode');
|
||||
|
||||
// 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, 'ChronopostHomeDeliveryDeliveryMode');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ChronopostHomeDeliveryDeliveryMode relation ChronopostHomeDeliveryDeliveryMode 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 \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useChronopostHomeDeliveryDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinChronopostHomeDeliveryDeliveryMode($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ChronopostHomeDeliveryDeliveryMode', '\ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildChronopostHomeDeliveryAreaFreeshipping $chronopostHomeDeliveryAreaFreeshipping Object to remove from the list of results
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryAreaFreeshippingQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($chronopostHomeDeliveryAreaFreeshipping = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryAreaFreeshipping) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID, $chronopostHomeDeliveryAreaFreeshipping->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_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(ChronopostHomeDeliveryAreaFreeshippingTableMap::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).
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::clearInstancePool();
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildChronopostHomeDeliveryAreaFreeshipping or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildChronopostHomeDeliveryAreaFreeshipping 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(ChronopostHomeDeliveryAreaFreeshippingTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ChronopostHomeDeliveryAreaFreeshippingTableMap::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();
|
||||
|
||||
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryAreaFreeshippingQuery
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,643 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode as ChildChronopostHomeDeliveryDeliveryMode;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery as ChildChronopostHomeDeliveryDeliveryModeQuery;
|
||||
use ChronopostHomeDelivery\Model\Map\ChronopostHomeDeliveryDeliveryModeTableMap;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'chronopost_home_delivery_delivery_mode' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery orderByTitle($order = Criteria::ASC) Order by the title column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery orderByCode($order = Criteria::ASC) Order by the code column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery orderByFreeshippingActive($order = Criteria::ASC) Order by the freeshipping_active column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery orderByFreeshippingFrom($order = Criteria::ASC) Order by the freeshipping_from column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery groupById() Group by the id column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery groupByTitle() Group by the title column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery groupByCode() Group by the code column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery groupByFreeshippingActive() Group by the freeshipping_active column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery groupByFreeshippingFrom() Group by the freeshipping_from column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery leftJoinChronopostHomeDeliveryPrice($relationAlias = null) Adds a LEFT JOIN clause to the query using the ChronopostHomeDeliveryPrice relation
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery rightJoinChronopostHomeDeliveryPrice($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ChronopostHomeDeliveryPrice relation
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery innerJoinChronopostHomeDeliveryPrice($relationAlias = null) Adds a INNER JOIN clause to the query using the ChronopostHomeDeliveryPrice relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery leftJoinChronopostHomeDeliveryAreaFreeshipping($relationAlias = null) Adds a LEFT JOIN clause to the query using the ChronopostHomeDeliveryAreaFreeshipping relation
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery rightJoinChronopostHomeDeliveryAreaFreeshipping($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ChronopostHomeDeliveryAreaFreeshipping relation
|
||||
* @method ChildChronopostHomeDeliveryDeliveryModeQuery innerJoinChronopostHomeDeliveryAreaFreeshipping($relationAlias = null) Adds a INNER JOIN clause to the query using the ChronopostHomeDeliveryAreaFreeshipping relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOne(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryDeliveryMode matching the query
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOneOrCreate(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryDeliveryMode matching the query, or a new ChildChronopostHomeDeliveryDeliveryMode object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOneById(int $id) Return the first ChildChronopostHomeDeliveryDeliveryMode filtered by the id column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOneByTitle(string $title) Return the first ChildChronopostHomeDeliveryDeliveryMode filtered by the title column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOneByCode(string $code) Return the first ChildChronopostHomeDeliveryDeliveryMode filtered by the code column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOneByFreeshippingActive(boolean $freeshipping_active) Return the first ChildChronopostHomeDeliveryDeliveryMode filtered by the freeshipping_active column
|
||||
* @method ChildChronopostHomeDeliveryDeliveryMode findOneByFreeshippingFrom(double $freeshipping_from) Return the first ChildChronopostHomeDeliveryDeliveryMode filtered by the freeshipping_from column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildChronopostHomeDeliveryDeliveryMode objects filtered by the id column
|
||||
* @method array findByTitle(string $title) Return ChildChronopostHomeDeliveryDeliveryMode objects filtered by the title column
|
||||
* @method array findByCode(string $code) Return ChildChronopostHomeDeliveryDeliveryMode objects filtered by the code column
|
||||
* @method array findByFreeshippingActive(boolean $freeshipping_active) Return ChildChronopostHomeDeliveryDeliveryMode objects filtered by the freeshipping_active column
|
||||
* @method array findByFreeshippingFrom(double $freeshipping_from) Return ChildChronopostHomeDeliveryDeliveryMode objects filtered by the freeshipping_from column
|
||||
*
|
||||
*/
|
||||
abstract class ChronopostHomeDeliveryDeliveryModeQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryDeliveryModeQuery 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 = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryDeliveryMode', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildChronopostHomeDeliveryDeliveryModeQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryDeliveryModeQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery();
|
||||
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 ChildChronopostHomeDeliveryDeliveryMode|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ChronopostHomeDeliveryDeliveryModeTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryMode 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 chronopost_home_delivery_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 ChildChronopostHomeDeliveryDeliveryMode();
|
||||
$obj->hydrate($row);
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryMode|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 ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryModeQuery 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(ChronopostHomeDeliveryDeliveryModeTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryModeQuery 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(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryModeQuery 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(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryModeQuery 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(ChronopostHomeDeliveryDeliveryModeTableMap::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 ChildChronopostHomeDeliveryDeliveryModeQuery 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(ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($freeshippingFrom['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_FROM, $freeshippingFrom, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice|ObjectCollection $chronopostHomeDeliveryPrice the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChronopostHomeDeliveryPrice($chronopostHomeDeliveryPrice, $comparison = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryPrice instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::ID, $chronopostHomeDeliveryPrice->getDeliveryModeId(), $comparison);
|
||||
} elseif ($chronopostHomeDeliveryPrice instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useChronopostHomeDeliveryPriceQuery()
|
||||
->filterByPrimaryKeys($chronopostHomeDeliveryPrice->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByChronopostHomeDeliveryPrice() only accepts arguments of type \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ChronopostHomeDeliveryPrice relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinChronopostHomeDeliveryPrice($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ChronopostHomeDeliveryPrice');
|
||||
|
||||
// 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, 'ChronopostHomeDeliveryPrice');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ChronopostHomeDeliveryPrice relation ChronopostHomeDeliveryPrice 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 \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPriceQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useChronopostHomeDeliveryPriceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinChronopostHomeDeliveryPrice($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ChronopostHomeDeliveryPrice', '\ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPriceQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping|ObjectCollection $chronopostHomeDeliveryAreaFreeshipping the related object to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChronopostHomeDeliveryAreaFreeshipping($chronopostHomeDeliveryAreaFreeshipping, $comparison = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryAreaFreeshipping instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::ID, $chronopostHomeDeliveryAreaFreeshipping->getDeliveryModeId(), $comparison);
|
||||
} elseif ($chronopostHomeDeliveryAreaFreeshipping instanceof ObjectCollection) {
|
||||
return $this
|
||||
->useChronopostHomeDeliveryAreaFreeshippingQuery()
|
||||
->filterByPrimaryKeys($chronopostHomeDeliveryAreaFreeshipping->getPrimaryKeys())
|
||||
->endUse();
|
||||
} else {
|
||||
throw new PropelException('filterByChronopostHomeDeliveryAreaFreeshipping() only accepts arguments of type \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ChronopostHomeDeliveryAreaFreeshipping relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinChronopostHomeDeliveryAreaFreeshipping($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ChronopostHomeDeliveryAreaFreeshipping');
|
||||
|
||||
// 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, 'ChronopostHomeDeliveryAreaFreeshipping');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ChronopostHomeDeliveryAreaFreeshipping relation ChronopostHomeDeliveryAreaFreeshipping 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 \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshippingQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useChronopostHomeDeliveryAreaFreeshippingQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinChronopostHomeDeliveryAreaFreeshipping($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ChronopostHomeDeliveryAreaFreeshipping', '\ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshippingQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildChronopostHomeDeliveryDeliveryMode $chronopostHomeDeliveryDeliveryMode Object to remove from the list of results
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryDeliveryModeQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($chronopostHomeDeliveryDeliveryMode = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryDeliveryMode) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryDeliveryModeTableMap::ID, $chronopostHomeDeliveryDeliveryMode->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_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(ChronopostHomeDeliveryDeliveryModeTableMap::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).
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::clearInstancePool();
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildChronopostHomeDeliveryDeliveryMode or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildChronopostHomeDeliveryDeliveryMode 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(ChronopostHomeDeliveryDeliveryModeTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ChronopostHomeDeliveryDeliveryModeTableMap::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();
|
||||
|
||||
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryDeliveryModeQuery
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,606 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrder as ChildChronopostHomeDeliveryOrder;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrderQuery as ChildChronopostHomeDeliveryOrderQuery;
|
||||
use ChronopostHomeDelivery\Model\Map\ChronopostHomeDeliveryOrderTableMap;
|
||||
use ChronopostHomeDelivery\Model\Thelia\Model\Order;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'chronopost_home_delivery_order' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery orderByOrderId($order = Criteria::ASC) Order by the order_id column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery orderByDeliveryType($order = Criteria::ASC) Order by the delivery_type column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery orderByDeliveryCode($order = Criteria::ASC) Order by the delivery_code column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery orderByLabelDirectory($order = Criteria::ASC) Order by the label_directory column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery orderByLabelNumber($order = Criteria::ASC) Order by the label_number column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery groupById() Group by the id column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery groupByOrderId() Group by the order_id column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery groupByDeliveryType() Group by the delivery_type column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery groupByDeliveryCode() Group by the delivery_code column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery groupByLabelDirectory() Group by the label_directory column
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery groupByLabelNumber() Group by the label_number column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery leftJoinOrder($relationAlias = null) Adds a LEFT JOIN clause to the query using the Order relation
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery rightJoinOrder($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Order relation
|
||||
* @method ChildChronopostHomeDeliveryOrderQuery innerJoinOrder($relationAlias = null) Adds a INNER JOIN clause to the query using the Order relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryOrder findOne(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryOrder matching the query
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneOrCreate(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryOrder matching the query, or a new ChildChronopostHomeDeliveryOrder object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneById(int $id) Return the first ChildChronopostHomeDeliveryOrder filtered by the id column
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneByOrderId(int $order_id) Return the first ChildChronopostHomeDeliveryOrder filtered by the order_id column
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneByDeliveryType(string $delivery_type) Return the first ChildChronopostHomeDeliveryOrder filtered by the delivery_type column
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneByDeliveryCode(string $delivery_code) Return the first ChildChronopostHomeDeliveryOrder filtered by the delivery_code column
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneByLabelDirectory(string $label_directory) Return the first ChildChronopostHomeDeliveryOrder filtered by the label_directory column
|
||||
* @method ChildChronopostHomeDeliveryOrder findOneByLabelNumber(string $label_number) Return the first ChildChronopostHomeDeliveryOrder filtered by the label_number column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildChronopostHomeDeliveryOrder objects filtered by the id column
|
||||
* @method array findByOrderId(int $order_id) Return ChildChronopostHomeDeliveryOrder objects filtered by the order_id column
|
||||
* @method array findByDeliveryType(string $delivery_type) Return ChildChronopostHomeDeliveryOrder objects filtered by the delivery_type column
|
||||
* @method array findByDeliveryCode(string $delivery_code) Return ChildChronopostHomeDeliveryOrder objects filtered by the delivery_code column
|
||||
* @method array findByLabelDirectory(string $label_directory) Return ChildChronopostHomeDeliveryOrder objects filtered by the label_directory column
|
||||
* @method array findByLabelNumber(string $label_number) Return ChildChronopostHomeDeliveryOrder objects filtered by the label_number column
|
||||
*
|
||||
*/
|
||||
abstract class ChronopostHomeDeliveryOrderQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryOrderQuery 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 = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryOrder', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildChronopostHomeDeliveryOrderQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryOrderQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrderQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrderQuery();
|
||||
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 ChildChronopostHomeDeliveryOrder|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ChronopostHomeDeliveryOrderTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ChronopostHomeDeliveryOrderTableMap::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 ChildChronopostHomeDeliveryOrder A model object, or null if the key is not found
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, ORDER_ID, DELIVERY_TYPE, DELIVERY_CODE, LABEL_DIRECTORY, LABEL_NUMBER FROM chronopost_home_delivery_order 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 ChildChronopostHomeDeliveryOrder();
|
||||
$obj->hydrate($row);
|
||||
ChronopostHomeDeliveryOrderTableMap::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 ChildChronopostHomeDeliveryOrder|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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::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 ChildChronopostHomeDeliveryOrderQuery 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(ChronopostHomeDeliveryOrderTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ID, $id, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the order_id column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByOrderId(1234); // WHERE order_id = 1234
|
||||
* $query->filterByOrderId(array(12, 34)); // WHERE order_id IN (12, 34)
|
||||
* $query->filterByOrderId(array('min' => 12)); // WHERE order_id > 12
|
||||
* </code>
|
||||
*
|
||||
* @see filterByOrder()
|
||||
*
|
||||
* @param mixed $orderId 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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByOrderId($orderId = null, $comparison = null)
|
||||
{
|
||||
if (is_array($orderId)) {
|
||||
$useMinMax = false;
|
||||
if (isset($orderId['min'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ORDER_ID, $orderId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($orderId['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ORDER_ID, $orderId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ORDER_ID, $orderId, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the delivery_type column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDeliveryType('fooValue'); // WHERE delivery_type = 'fooValue'
|
||||
* $query->filterByDeliveryType('%fooValue%'); // WHERE delivery_type LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $deliveryType 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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDeliveryType($deliveryType = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($deliveryType)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $deliveryType)) {
|
||||
$deliveryType = str_replace('*', '%', $deliveryType);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::DELIVERY_TYPE, $deliveryType, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the delivery_code column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByDeliveryCode('fooValue'); // WHERE delivery_code = 'fooValue'
|
||||
* $query->filterByDeliveryCode('%fooValue%'); // WHERE delivery_code LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $deliveryCode 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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByDeliveryCode($deliveryCode = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($deliveryCode)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $deliveryCode)) {
|
||||
$deliveryCode = str_replace('*', '%', $deliveryCode);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::DELIVERY_CODE, $deliveryCode, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the label_directory column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLabelDirectory('fooValue'); // WHERE label_directory = 'fooValue'
|
||||
* $query->filterByLabelDirectory('%fooValue%'); // WHERE label_directory LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $labelDirectory 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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLabelDirectory($labelDirectory = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($labelDirectory)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $labelDirectory)) {
|
||||
$labelDirectory = str_replace('*', '%', $labelDirectory);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::LABEL_DIRECTORY, $labelDirectory, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the label_number column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByLabelNumber('fooValue'); // WHERE label_number = 'fooValue'
|
||||
* $query->filterByLabelNumber('%fooValue%'); // WHERE label_number LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $labelNumber 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 ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByLabelNumber($labelNumber = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($labelNumber)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $labelNumber)) {
|
||||
$labelNumber = str_replace('*', '%', $labelNumber);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::LABEL_NUMBER, $labelNumber, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\Thelia\Model\Order object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\Model\Thelia\Model\Order|ObjectCollection $order The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByOrder($order, $comparison = null)
|
||||
{
|
||||
if ($order instanceof \ChronopostHomeDelivery\Model\Thelia\Model\Order) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ORDER_ID, $order->getId(), $comparison);
|
||||
} elseif ($order instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ORDER_ID, $order->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByOrder() only accepts arguments of type \ChronopostHomeDelivery\Model\Thelia\Model\Order or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the Order relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinOrder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('Order');
|
||||
|
||||
// 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, 'Order');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the Order relation Order 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 \ChronopostHomeDelivery\Model\Thelia\Model\OrderQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useOrderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinOrder($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'Order', '\ChronopostHomeDelivery\Model\Thelia\Model\OrderQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildChronopostHomeDeliveryOrder $chronopostHomeDeliveryOrder Object to remove from the list of results
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryOrderQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($chronopostHomeDeliveryOrder = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryOrder) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryOrderTableMap::ID, $chronopostHomeDeliveryOrder->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_order 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(ChronopostHomeDeliveryOrderTableMap::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).
|
||||
ChronopostHomeDeliveryOrderTableMap::clearInstancePool();
|
||||
ChronopostHomeDeliveryOrderTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildChronopostHomeDeliveryOrder or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildChronopostHomeDeliveryOrder 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(ChronopostHomeDeliveryOrderTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ChronopostHomeDeliveryOrderTableMap::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();
|
||||
|
||||
|
||||
ChronopostHomeDeliveryOrderTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ChronopostHomeDeliveryOrderTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryOrderQuery
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,780 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Base;
|
||||
|
||||
use \Exception;
|
||||
use \PDO;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice as ChildChronopostHomeDeliveryPrice;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPriceQuery as ChildChronopostHomeDeliveryPriceQuery;
|
||||
use ChronopostHomeDelivery\Model\Map\ChronopostHomeDeliveryPriceTableMap;
|
||||
use ChronopostHomeDelivery\Model\Thelia\Model\Area;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveQuery\ModelJoin;
|
||||
use Propel\Runtime\Collection\Collection;
|
||||
use Propel\Runtime\Collection\ObjectCollection;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
|
||||
/**
|
||||
* Base class that represents a query for the 'chronopost_home_delivery_price' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderById($order = Criteria::ASC) Order by the id column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderByAreaId($order = Criteria::ASC) Order by the area_id column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderByDeliveryModeId($order = Criteria::ASC) Order by the delivery_mode_id column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderByWeightMax($order = Criteria::ASC) Order by the weight_max column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderByPriceMax($order = Criteria::ASC) Order by the price_max column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderByFrancoMinPrice($order = Criteria::ASC) Order by the franco_min_price column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery orderByPrice($order = Criteria::ASC) Order by the price column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupById() Group by the id column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupByAreaId() Group by the area_id column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupByDeliveryModeId() Group by the delivery_mode_id column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupByWeightMax() Group by the weight_max column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupByPriceMax() Group by the price_max column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupByFrancoMinPrice() Group by the franco_min_price column
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery groupByPrice() Group by the price column
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery leftJoinArea($relationAlias = null) Adds a LEFT JOIN clause to the query using the Area relation
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery rightJoinArea($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Area relation
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery innerJoinArea($relationAlias = null) Adds a INNER JOIN clause to the query using the Area relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery leftJoinChronopostHomeDeliveryDeliveryMode($relationAlias = null) Adds a LEFT JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery rightJoinChronopostHomeDeliveryDeliveryMode($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
* @method ChildChronopostHomeDeliveryPriceQuery innerJoinChronopostHomeDeliveryDeliveryMode($relationAlias = null) Adds a INNER JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPrice findOne(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryPrice matching the query
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneOrCreate(ConnectionInterface $con = null) Return the first ChildChronopostHomeDeliveryPrice matching the query, or a new ChildChronopostHomeDeliveryPrice object populated from the query conditions when no match is found
|
||||
*
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneById(int $id) Return the first ChildChronopostHomeDeliveryPrice filtered by the id column
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneByAreaId(int $area_id) Return the first ChildChronopostHomeDeliveryPrice filtered by the area_id column
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneByDeliveryModeId(int $delivery_mode_id) Return the first ChildChronopostHomeDeliveryPrice filtered by the delivery_mode_id column
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneByWeightMax(double $weight_max) Return the first ChildChronopostHomeDeliveryPrice filtered by the weight_max column
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneByPriceMax(double $price_max) Return the first ChildChronopostHomeDeliveryPrice filtered by the price_max column
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneByFrancoMinPrice(double $franco_min_price) Return the first ChildChronopostHomeDeliveryPrice filtered by the franco_min_price column
|
||||
* @method ChildChronopostHomeDeliveryPrice findOneByPrice(double $price) Return the first ChildChronopostHomeDeliveryPrice filtered by the price column
|
||||
*
|
||||
* @method array findById(int $id) Return ChildChronopostHomeDeliveryPrice objects filtered by the id column
|
||||
* @method array findByAreaId(int $area_id) Return ChildChronopostHomeDeliveryPrice objects filtered by the area_id column
|
||||
* @method array findByDeliveryModeId(int $delivery_mode_id) Return ChildChronopostHomeDeliveryPrice objects filtered by the delivery_mode_id column
|
||||
* @method array findByWeightMax(double $weight_max) Return ChildChronopostHomeDeliveryPrice objects filtered by the weight_max column
|
||||
* @method array findByPriceMax(double $price_max) Return ChildChronopostHomeDeliveryPrice objects filtered by the price_max column
|
||||
* @method array findByFrancoMinPrice(double $franco_min_price) Return ChildChronopostHomeDeliveryPrice objects filtered by the franco_min_price column
|
||||
* @method array findByPrice(double $price) Return ChildChronopostHomeDeliveryPrice objects filtered by the price column
|
||||
*
|
||||
*/
|
||||
abstract class ChronopostHomeDeliveryPriceQuery extends ModelCriteria
|
||||
{
|
||||
|
||||
/**
|
||||
* Initializes internal state of \ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryPriceQuery 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 = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryPrice', $modelAlias = null)
|
||||
{
|
||||
parent::__construct($dbName, $modelName, $modelAlias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new ChildChronopostHomeDeliveryPriceQuery object.
|
||||
*
|
||||
* @param string $modelAlias The alias of a model in the query
|
||||
* @param Criteria $criteria Optional Criteria to build the query from
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryPriceQuery
|
||||
*/
|
||||
public static function create($modelAlias = null, $criteria = null)
|
||||
{
|
||||
if ($criteria instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPriceQuery) {
|
||||
return $criteria;
|
||||
}
|
||||
$query = new \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPriceQuery();
|
||||
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 ChildChronopostHomeDeliveryPrice|array|mixed the result, formatted by the current formatter
|
||||
*/
|
||||
public function findPk($key, $con = null)
|
||||
{
|
||||
if ($key === null) {
|
||||
return null;
|
||||
}
|
||||
if ((null !== ($obj = ChronopostHomeDeliveryPriceTableMap::getInstanceFromPool((string) $key))) && !$this->formatter) {
|
||||
// the object is already in the instance pool
|
||||
return $obj;
|
||||
}
|
||||
if ($con === null) {
|
||||
$con = Propel::getServiceContainer()->getReadConnection(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPrice 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 chronopost_home_delivery_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 ChildChronopostHomeDeliveryPrice();
|
||||
$obj->hydrate($row);
|
||||
ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPrice|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 ChildChronopostHomeDeliveryPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKey($key)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByPrimaryKeys($keys)
|
||||
{
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::ID, $id['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($id['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::ID, $id['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::AREA_ID, $areaId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($areaId['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::AREA_ID, $areaId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 filterByChronopostHomeDeliveryDeliveryMode()
|
||||
*
|
||||
* @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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($deliveryModeId['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID, $deliveryModeId['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::WEIGHT_MAX, $weightMax['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($weightMax['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::WEIGHT_MAX, $weightMax['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::PRICE_MAX, $priceMax['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($priceMax['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::PRICE_MAX, $priceMax['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($francoMinPrice['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::FRANCO_MIN_PRICE, $francoMinPrice['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::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 ChildChronopostHomeDeliveryPriceQuery 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(ChronopostHomeDeliveryPriceTableMap::PRICE, $price['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($price['max'])) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::PRICE, $price['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::PRICE, $price, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\Thelia\Model\Area object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\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 ChildChronopostHomeDeliveryPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByArea($area, $comparison = null)
|
||||
{
|
||||
if ($area instanceof \ChronopostHomeDelivery\Model\Thelia\Model\Area) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::AREA_ID, $area->getId(), $comparison);
|
||||
} elseif ($area instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::AREA_ID, $area->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByArea() only accepts arguments of type \ChronopostHomeDelivery\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 ChildChronopostHomeDeliveryPriceQuery 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 \ChronopostHomeDelivery\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', '\ChronopostHomeDelivery\Model\Thelia\Model\AreaQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query by a related \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode object
|
||||
*
|
||||
* @param \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode|ObjectCollection $chronopostHomeDeliveryDeliveryMode The related object(s) to use as filter
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByChronopostHomeDeliveryDeliveryMode($chronopostHomeDeliveryDeliveryMode, $comparison = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryDeliveryMode instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode) {
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID, $chronopostHomeDeliveryDeliveryMode->getId(), $comparison);
|
||||
} elseif ($chronopostHomeDeliveryDeliveryMode instanceof ObjectCollection) {
|
||||
if (null === $comparison) {
|
||||
$comparison = Criteria::IN;
|
||||
}
|
||||
|
||||
return $this
|
||||
->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID, $chronopostHomeDeliveryDeliveryMode->toKeyValue('PrimaryKey', 'Id'), $comparison);
|
||||
} else {
|
||||
throw new PropelException('filterByChronopostHomeDeliveryDeliveryMode() only accepts arguments of type \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode or Collection');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a JOIN clause to the query using the ChronopostHomeDeliveryDeliveryMode relation
|
||||
*
|
||||
* @param string $relationAlias optional alias for the relation
|
||||
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function joinChronopostHomeDeliveryDeliveryMode($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
$tableMap = $this->getTableMap();
|
||||
$relationMap = $tableMap->getRelation('ChronopostHomeDeliveryDeliveryMode');
|
||||
|
||||
// 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, 'ChronopostHomeDeliveryDeliveryMode');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the ChronopostHomeDeliveryDeliveryMode relation ChronopostHomeDeliveryDeliveryMode 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 \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery A secondary query class using the current class as primary query
|
||||
*/
|
||||
public function useChronopostHomeDeliveryDeliveryModeQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
|
||||
{
|
||||
return $this
|
||||
->joinChronopostHomeDeliveryDeliveryMode($relationAlias, $joinType)
|
||||
->useQuery($relationAlias ? $relationAlias : 'ChronopostHomeDeliveryDeliveryMode', '\ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery');
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude object from result
|
||||
*
|
||||
* @param ChildChronopostHomeDeliveryPrice $chronopostHomeDeliveryPrice Object to remove from the list of results
|
||||
*
|
||||
* @return ChildChronopostHomeDeliveryPriceQuery The current query, for fluid interface
|
||||
*/
|
||||
public function prune($chronopostHomeDeliveryPrice = null)
|
||||
{
|
||||
if ($chronopostHomeDeliveryPrice) {
|
||||
$this->addUsingAlias(ChronopostHomeDeliveryPriceTableMap::ID, $chronopostHomeDeliveryPrice->getId(), Criteria::NOT_EQUAL);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_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(ChronopostHomeDeliveryPriceTableMap::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).
|
||||
ChronopostHomeDeliveryPriceTableMap::clearInstancePool();
|
||||
ChronopostHomeDeliveryPriceTableMap::clearRelatedInstancePool();
|
||||
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $affectedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChildChronopostHomeDeliveryPrice or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChildChronopostHomeDeliveryPrice 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(ChronopostHomeDeliveryPriceTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = $this;
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ChronopostHomeDeliveryPriceTableMap::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();
|
||||
|
||||
|
||||
ChronopostHomeDeliveryPriceTableMap::removeInstanceFromPool($criteria);
|
||||
|
||||
$affectedRows += ModelCriteria::delete($con);
|
||||
ChronopostHomeDeliveryPriceTableMap::clearRelatedInstancePool();
|
||||
$con->commit();
|
||||
|
||||
return $affectedRows;
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryPriceQuery
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryAreaFreeshipping as BaseChronopostHomeDeliveryAreaFreeshipping;
|
||||
|
||||
class ChronopostHomeDeliveryAreaFreeshipping extends BaseChronopostHomeDeliveryAreaFreeshipping
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryAreaFreeshippingQuery as BaseChronopostHomeDeliveryAreaFreeshippingQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'chronopost_home_delivery_area_freeshipping' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryAreaFreeshippingQuery extends BaseChronopostHomeDeliveryAreaFreeshippingQuery
|
||||
{
|
||||
|
||||
} // ChronopostHomeDeliveryAreaFreeshippingQuery
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryDeliveryMode as BaseChronopostHomeDeliveryDeliveryMode;
|
||||
|
||||
class ChronopostHomeDeliveryDeliveryMode extends BaseChronopostHomeDeliveryDeliveryMode
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryDeliveryModeQuery as BaseChronopostHomeDeliveryDeliveryModeQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'chronopost_home_delivery_delivery_mode' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryDeliveryModeQuery extends BaseChronopostHomeDeliveryDeliveryModeQuery
|
||||
{
|
||||
|
||||
} // ChronopostHomeDeliveryDeliveryModeQuery
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryOrder as BaseChronopostHomeDeliveryOrder;
|
||||
|
||||
class ChronopostHomeDeliveryOrder extends BaseChronopostHomeDeliveryOrder
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryOrderQuery as BaseChronopostHomeDeliveryOrderQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'chronopost_home_delivery_order' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryOrderQuery extends BaseChronopostHomeDeliveryOrderQuery
|
||||
{
|
||||
|
||||
} // ChronopostHomeDeliveryOrderQuery
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryPrice as BaseChronopostHomeDeliveryPrice;
|
||||
|
||||
class ChronopostHomeDeliveryPrice extends BaseChronopostHomeDeliveryPrice
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model;
|
||||
|
||||
use ChronopostHomeDelivery\Model\Base\ChronopostHomeDeliveryPriceQuery as BaseChronopostHomeDeliveryPriceQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for performing query and update operations on the 'chronopost_home_delivery_price' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryPriceQuery extends BaseChronopostHomeDeliveryPriceQuery
|
||||
{
|
||||
|
||||
} // ChronopostHomeDeliveryPriceQuery
|
||||
@@ -0,0 +1,428 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Map;
|
||||
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshippingQuery;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'chronopost_home_delivery_area_freeshipping' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryAreaFreeshippingTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'ChronopostHomeDelivery.Model.Map.ChronopostHomeDeliveryAreaFreeshippingTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'chronopost_home_delivery_area_freeshipping';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryAreaFreeshipping';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'ChronopostHomeDelivery.Model.ChronopostHomeDeliveryAreaFreeshipping';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 4;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 4;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'chronopost_home_delivery_area_freeshipping.ID';
|
||||
|
||||
/**
|
||||
* the column name for the AREA_ID field
|
||||
*/
|
||||
const AREA_ID = 'chronopost_home_delivery_area_freeshipping.AREA_ID';
|
||||
|
||||
/**
|
||||
* the column name for the DELIVERY_MODE_ID field
|
||||
*/
|
||||
const DELIVERY_MODE_ID = 'chronopost_home_delivery_area_freeshipping.DELIVERY_MODE_ID';
|
||||
|
||||
/**
|
||||
* the column name for the CART_AMOUNT field
|
||||
*/
|
||||
const CART_AMOUNT = 'chronopost_home_delivery_area_freeshipping.CART_AMOUNT';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'AreaId', 'DeliveryModeId', 'CartAmount', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModeId', 'cartAmount', ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID, ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID, ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID, ChronopostHomeDeliveryAreaFreeshippingTableMap::CART_AMOUNT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODE_ID', 'CART_AMOUNT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_mode_id', 'cart_amount', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModeId' => 2, 'CartAmount' => 3, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModeId' => 2, 'cartAmount' => 3, ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID => 0, ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID => 1, ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID => 2, ChronopostHomeDeliveryAreaFreeshippingTableMap::CART_AMOUNT => 3, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODE_ID' => 2, 'CART_AMOUNT' => 3, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_mode_id' => 2, 'cart_amount' => 3, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('chronopost_home_delivery_area_freeshipping');
|
||||
$this->setPhpName('ChronopostHomeDeliveryAreaFreeshipping');
|
||||
$this->setClassName('\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryAreaFreeshipping');
|
||||
$this->setPackage('ChronopostHomeDelivery.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
|
||||
$this->addForeignKey('DELIVERY_MODE_ID', 'DeliveryModeId', 'INTEGER', 'chronopost_home_delivery_delivery_mode', 'ID', true, null, null);
|
||||
$this->addColumn('CART_AMOUNT', 'CartAmount', 'DECIMAL', false, 16, 0);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Area', '\\ChronopostHomeDelivery\\Model\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'RESTRICT', 'RESTRICT');
|
||||
$this->addRelation('ChronopostHomeDeliveryDeliveryMode', '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryDeliveryMode', RelationMap::MANY_TO_ONE, array('delivery_mode_id' => 'id', ), 'RESTRICT', 'RESTRICT');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ChronopostHomeDeliveryAreaFreeshippingTableMap::CLASS_DEFAULT : ChronopostHomeDeliveryAreaFreeshippingTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ChronopostHomeDeliveryAreaFreeshipping object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ChronopostHomeDeliveryAreaFreeshippingTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ChronopostHomeDeliveryAreaFreeshippingTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ChronopostHomeDeliveryAreaFreeshippingTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ChronopostHomeDeliveryAreaFreeshippingTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ChronopostHomeDeliveryAreaFreeshippingTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ChronopostHomeDeliveryAreaFreeshippingTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryAreaFreeshippingTableMap::AREA_ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryAreaFreeshippingTableMap::DELIVERY_MODE_ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryAreaFreeshippingTableMap::CART_AMOUNT);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.AREA_ID');
|
||||
$criteria->addSelectColumn($alias . '.DELIVERY_MODE_ID');
|
||||
$criteria->addSelectColumn($alias . '.CART_AMOUNT');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryAreaFreeshippingTableMap::DATABASE_NAME)->getTable(ChronopostHomeDeliveryAreaFreeshippingTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryAreaFreeshippingTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ChronopostHomeDeliveryAreaFreeshippingTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ChronopostHomeDeliveryAreaFreeshippingTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChronopostHomeDeliveryAreaFreeshipping or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChronopostHomeDeliveryAreaFreeshipping 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 static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryAreaFreeshippingTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryAreaFreeshipping) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ChronopostHomeDeliveryAreaFreeshippingTableMap::DATABASE_NAME);
|
||||
$criteria->add(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ChronopostHomeDeliveryAreaFreeshippingQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ChronopostHomeDeliveryAreaFreeshippingTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ChronopostHomeDeliveryAreaFreeshippingTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_area_freeshipping table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ChronopostHomeDeliveryAreaFreeshippingQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ChronopostHomeDeliveryAreaFreeshipping or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ChronopostHomeDeliveryAreaFreeshipping object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryAreaFreeshippingTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ChronopostHomeDeliveryAreaFreeshipping object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID) && $criteria->keyContainsValue(ChronopostHomeDeliveryAreaFreeshippingTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ChronopostHomeDeliveryAreaFreeshippingTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ChronopostHomeDeliveryAreaFreeshippingQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryAreaFreeshippingTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ChronopostHomeDeliveryAreaFreeshippingTableMap::buildTableMap();
|
||||
@@ -0,0 +1,436 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Map;
|
||||
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryModeQuery;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'chronopost_home_delivery_delivery_mode' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryDeliveryModeTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'ChronopostHomeDelivery.Model.Map.ChronopostHomeDeliveryDeliveryModeTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'chronopost_home_delivery_delivery_mode';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryDeliveryMode';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'ChronopostHomeDelivery.Model.ChronopostHomeDeliveryDeliveryMode';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 5;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 5;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'chronopost_home_delivery_delivery_mode.ID';
|
||||
|
||||
/**
|
||||
* the column name for the TITLE field
|
||||
*/
|
||||
const TITLE = 'chronopost_home_delivery_delivery_mode.TITLE';
|
||||
|
||||
/**
|
||||
* the column name for the CODE field
|
||||
*/
|
||||
const CODE = 'chronopost_home_delivery_delivery_mode.CODE';
|
||||
|
||||
/**
|
||||
* the column name for the FREESHIPPING_ACTIVE field
|
||||
*/
|
||||
const FREESHIPPING_ACTIVE = 'chronopost_home_delivery_delivery_mode.FREESHIPPING_ACTIVE';
|
||||
|
||||
/**
|
||||
* the column name for the FREESHIPPING_FROM field
|
||||
*/
|
||||
const FREESHIPPING_FROM = 'chronopost_home_delivery_delivery_mode.FREESHIPPING_FROM';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'Title', 'Code', 'FreeshippingActive', 'FreeshippingFrom', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'title', 'code', 'freeshippingActive', 'freeshippingFrom', ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryDeliveryModeTableMap::ID, ChronopostHomeDeliveryDeliveryModeTableMap::TITLE, ChronopostHomeDeliveryDeliveryModeTableMap::CODE, ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_ACTIVE, ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_FROM, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'TITLE', 'CODE', 'FREESHIPPING_ACTIVE', 'FREESHIPPING_FROM', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'title', 'code', 'freeshipping_active', 'freeshipping_from', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'Title' => 1, 'Code' => 2, 'FreeshippingActive' => 3, 'FreeshippingFrom' => 4, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'freeshippingActive' => 3, 'freeshippingFrom' => 4, ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryDeliveryModeTableMap::ID => 0, ChronopostHomeDeliveryDeliveryModeTableMap::TITLE => 1, ChronopostHomeDeliveryDeliveryModeTableMap::CODE => 2, ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_ACTIVE => 3, ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_FROM => 4, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TITLE' => 1, 'CODE' => 2, 'FREESHIPPING_ACTIVE' => 3, 'FREESHIPPING_FROM' => 4, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'title' => 1, 'code' => 2, 'freeshipping_active' => 3, 'freeshipping_from' => 4, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('chronopost_home_delivery_delivery_mode');
|
||||
$this->setPhpName('ChronopostHomeDeliveryDeliveryMode');
|
||||
$this->setClassName('\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryDeliveryMode');
|
||||
$this->setPackage('ChronopostHomeDelivery.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('CODE', 'Code', 'VARCHAR', true, 55, null);
|
||||
$this->addColumn('FREESHIPPING_ACTIVE', 'FreeshippingActive', 'BOOLEAN', false, 1, null);
|
||||
$this->addColumn('FREESHIPPING_FROM', 'FreeshippingFrom', 'FLOAT', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('ChronopostHomeDeliveryPrice', '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryPrice', RelationMap::ONE_TO_MANY, array('id' => 'delivery_mode_id', ), 'RESTRICT', 'RESTRICT', 'ChronopostHomeDeliveryPrices');
|
||||
$this->addRelation('ChronopostHomeDeliveryAreaFreeshipping', '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryAreaFreeshipping', RelationMap::ONE_TO_MANY, array('id' => 'delivery_mode_id', ), 'RESTRICT', 'RESTRICT', 'ChronopostHomeDeliveryAreaFreeshippings');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ChronopostHomeDeliveryDeliveryModeTableMap::CLASS_DEFAULT : ChronopostHomeDeliveryDeliveryModeTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ChronopostHomeDeliveryDeliveryMode object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ChronopostHomeDeliveryDeliveryModeTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ChronopostHomeDeliveryDeliveryModeTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ChronopostHomeDeliveryDeliveryModeTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ChronopostHomeDeliveryDeliveryModeTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ChronopostHomeDeliveryDeliveryModeTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ChronopostHomeDeliveryDeliveryModeTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryDeliveryModeTableMap::ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryDeliveryModeTableMap::TITLE);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryDeliveryModeTableMap::CODE);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_ACTIVE);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryDeliveryModeTableMap::FREESHIPPING_FROM);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.TITLE');
|
||||
$criteria->addSelectColumn($alias . '.CODE');
|
||||
$criteria->addSelectColumn($alias . '.FREESHIPPING_ACTIVE');
|
||||
$criteria->addSelectColumn($alias . '.FREESHIPPING_FROM');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryDeliveryModeTableMap::DATABASE_NAME)->getTable(ChronopostHomeDeliveryDeliveryModeTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryDeliveryModeTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ChronopostHomeDeliveryDeliveryModeTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ChronopostHomeDeliveryDeliveryModeTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChronopostHomeDeliveryDeliveryMode or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChronopostHomeDeliveryDeliveryMode 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 static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryDeliveryModeTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryDeliveryMode) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ChronopostHomeDeliveryDeliveryModeTableMap::DATABASE_NAME);
|
||||
$criteria->add(ChronopostHomeDeliveryDeliveryModeTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ChronopostHomeDeliveryDeliveryModeQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ChronopostHomeDeliveryDeliveryModeTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ChronopostHomeDeliveryDeliveryModeTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_delivery_mode table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ChronopostHomeDeliveryDeliveryModeQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ChronopostHomeDeliveryDeliveryMode or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ChronopostHomeDeliveryDeliveryMode object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryDeliveryModeTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ChronopostHomeDeliveryDeliveryMode object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ChronopostHomeDeliveryDeliveryModeTableMap::ID) && $criteria->keyContainsValue(ChronopostHomeDeliveryDeliveryModeTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ChronopostHomeDeliveryDeliveryModeTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ChronopostHomeDeliveryDeliveryModeQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryDeliveryModeTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ChronopostHomeDeliveryDeliveryModeTableMap::buildTableMap();
|
||||
@@ -0,0 +1,443 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Map;
|
||||
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrder;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrderQuery;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'chronopost_home_delivery_order' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryOrderTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'ChronopostHomeDelivery.Model.Map.ChronopostHomeDeliveryOrderTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'chronopost_home_delivery_order';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryOrder';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'ChronopostHomeDelivery.Model.ChronopostHomeDeliveryOrder';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 6;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'chronopost_home_delivery_order.ID';
|
||||
|
||||
/**
|
||||
* the column name for the ORDER_ID field
|
||||
*/
|
||||
const ORDER_ID = 'chronopost_home_delivery_order.ORDER_ID';
|
||||
|
||||
/**
|
||||
* the column name for the DELIVERY_TYPE field
|
||||
*/
|
||||
const DELIVERY_TYPE = 'chronopost_home_delivery_order.DELIVERY_TYPE';
|
||||
|
||||
/**
|
||||
* the column name for the DELIVERY_CODE field
|
||||
*/
|
||||
const DELIVERY_CODE = 'chronopost_home_delivery_order.DELIVERY_CODE';
|
||||
|
||||
/**
|
||||
* the column name for the LABEL_DIRECTORY field
|
||||
*/
|
||||
const LABEL_DIRECTORY = 'chronopost_home_delivery_order.LABEL_DIRECTORY';
|
||||
|
||||
/**
|
||||
* the column name for the LABEL_NUMBER field
|
||||
*/
|
||||
const LABEL_NUMBER = 'chronopost_home_delivery_order.LABEL_NUMBER';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'OrderId', 'DeliveryType', 'DeliveryCode', 'LabelDirectory', 'LabelNumber', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'orderId', 'deliveryType', 'deliveryCode', 'labelDirectory', 'labelNumber', ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryOrderTableMap::ID, ChronopostHomeDeliveryOrderTableMap::ORDER_ID, ChronopostHomeDeliveryOrderTableMap::DELIVERY_TYPE, ChronopostHomeDeliveryOrderTableMap::DELIVERY_CODE, ChronopostHomeDeliveryOrderTableMap::LABEL_DIRECTORY, ChronopostHomeDeliveryOrderTableMap::LABEL_NUMBER, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'ORDER_ID', 'DELIVERY_TYPE', 'DELIVERY_CODE', 'LABEL_DIRECTORY', 'LABEL_NUMBER', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'order_id', 'delivery_type', 'delivery_code', 'label_directory', 'label_number', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'OrderId' => 1, 'DeliveryType' => 2, 'DeliveryCode' => 3, 'LabelDirectory' => 4, 'LabelNumber' => 5, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'orderId' => 1, 'deliveryType' => 2, 'deliveryCode' => 3, 'labelDirectory' => 4, 'labelNumber' => 5, ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryOrderTableMap::ID => 0, ChronopostHomeDeliveryOrderTableMap::ORDER_ID => 1, ChronopostHomeDeliveryOrderTableMap::DELIVERY_TYPE => 2, ChronopostHomeDeliveryOrderTableMap::DELIVERY_CODE => 3, ChronopostHomeDeliveryOrderTableMap::LABEL_DIRECTORY => 4, ChronopostHomeDeliveryOrderTableMap::LABEL_NUMBER => 5, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'ORDER_ID' => 1, 'DELIVERY_TYPE' => 2, 'DELIVERY_CODE' => 3, 'LABEL_DIRECTORY' => 4, 'LABEL_NUMBER' => 5, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'order_id' => 1, 'delivery_type' => 2, 'delivery_code' => 3, 'label_directory' => 4, 'label_number' => 5, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('chronopost_home_delivery_order');
|
||||
$this->setPhpName('ChronopostHomeDeliveryOrder');
|
||||
$this->setClassName('\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryOrder');
|
||||
$this->setPackage('ChronopostHomeDelivery.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('ORDER_ID', 'OrderId', 'INTEGER', 'order', 'ID', true, null, null);
|
||||
$this->addColumn('DELIVERY_TYPE', 'DeliveryType', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('DELIVERY_CODE', 'DeliveryCode', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('LABEL_DIRECTORY', 'LabelDirectory', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('LABEL_NUMBER', 'LabelNumber', 'LONGVARCHAR', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Order', '\\ChronopostHomeDelivery\\Model\\Thelia\\Model\\Order', RelationMap::MANY_TO_ONE, array('order_id' => 'id', ), 'CASCADE', 'RESTRICT');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ChronopostHomeDeliveryOrderTableMap::CLASS_DEFAULT : ChronopostHomeDeliveryOrderTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ChronopostHomeDeliveryOrder object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ChronopostHomeDeliveryOrderTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ChronopostHomeDeliveryOrderTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ChronopostHomeDeliveryOrderTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ChronopostHomeDeliveryOrderTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ChronopostHomeDeliveryOrderTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ChronopostHomeDeliveryOrderTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ChronopostHomeDeliveryOrderTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ChronopostHomeDeliveryOrderTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryOrderTableMap::ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryOrderTableMap::ORDER_ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryOrderTableMap::DELIVERY_TYPE);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryOrderTableMap::DELIVERY_CODE);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryOrderTableMap::LABEL_DIRECTORY);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryOrderTableMap::LABEL_NUMBER);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.ORDER_ID');
|
||||
$criteria->addSelectColumn($alias . '.DELIVERY_TYPE');
|
||||
$criteria->addSelectColumn($alias . '.DELIVERY_CODE');
|
||||
$criteria->addSelectColumn($alias . '.LABEL_DIRECTORY');
|
||||
$criteria->addSelectColumn($alias . '.LABEL_NUMBER');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryOrderTableMap::DATABASE_NAME)->getTable(ChronopostHomeDeliveryOrderTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryOrderTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ChronopostHomeDeliveryOrderTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ChronopostHomeDeliveryOrderTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChronopostHomeDeliveryOrder or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChronopostHomeDeliveryOrder 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 static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryOrderTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryOrder) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ChronopostHomeDeliveryOrderTableMap::DATABASE_NAME);
|
||||
$criteria->add(ChronopostHomeDeliveryOrderTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ChronopostHomeDeliveryOrderQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ChronopostHomeDeliveryOrderTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ChronopostHomeDeliveryOrderTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_order table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ChronopostHomeDeliveryOrderQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ChronopostHomeDeliveryOrder or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ChronopostHomeDeliveryOrder object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryOrderTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ChronopostHomeDeliveryOrder object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ChronopostHomeDeliveryOrderTableMap::ID) && $criteria->keyContainsValue(ChronopostHomeDeliveryOrderTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ChronopostHomeDeliveryOrderTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ChronopostHomeDeliveryOrderQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryOrderTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ChronopostHomeDeliveryOrderTableMap::buildTableMap();
|
||||
@@ -0,0 +1,452 @@
|
||||
<?php
|
||||
|
||||
namespace ChronopostHomeDelivery\Model\Map;
|
||||
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice;
|
||||
use ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPriceQuery;
|
||||
use Propel\Runtime\Propel;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Propel\Runtime\DataFetcher\DataFetcherInterface;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Propel\Runtime\Map\RelationMap;
|
||||
use Propel\Runtime\Map\TableMap;
|
||||
use Propel\Runtime\Map\TableMapTrait;
|
||||
|
||||
|
||||
/**
|
||||
* This class defines the structure of the 'chronopost_home_delivery_price' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* This map class is used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
*/
|
||||
class ChronopostHomeDeliveryPriceTableMap extends TableMap
|
||||
{
|
||||
use InstancePoolTrait;
|
||||
use TableMapTrait;
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'ChronopostHomeDelivery.Model.Map.ChronopostHomeDeliveryPriceTableMap';
|
||||
|
||||
/**
|
||||
* The default database name for this class
|
||||
*/
|
||||
const DATABASE_NAME = 'thelia';
|
||||
|
||||
/**
|
||||
* The table name for this class
|
||||
*/
|
||||
const TABLE_NAME = 'chronopost_home_delivery_price';
|
||||
|
||||
/**
|
||||
* The related Propel class for this table
|
||||
*/
|
||||
const OM_CLASS = '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryPrice';
|
||||
|
||||
/**
|
||||
* A class that can be returned by this tableMap
|
||||
*/
|
||||
const CLASS_DEFAULT = 'ChronopostHomeDelivery.Model.ChronopostHomeDeliveryPrice';
|
||||
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 7;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
*/
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 7;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
*/
|
||||
const ID = 'chronopost_home_delivery_price.ID';
|
||||
|
||||
/**
|
||||
* the column name for the AREA_ID field
|
||||
*/
|
||||
const AREA_ID = 'chronopost_home_delivery_price.AREA_ID';
|
||||
|
||||
/**
|
||||
* the column name for the DELIVERY_MODE_ID field
|
||||
*/
|
||||
const DELIVERY_MODE_ID = 'chronopost_home_delivery_price.DELIVERY_MODE_ID';
|
||||
|
||||
/**
|
||||
* the column name for the WEIGHT_MAX field
|
||||
*/
|
||||
const WEIGHT_MAX = 'chronopost_home_delivery_price.WEIGHT_MAX';
|
||||
|
||||
/**
|
||||
* the column name for the PRICE_MAX field
|
||||
*/
|
||||
const PRICE_MAX = 'chronopost_home_delivery_price.PRICE_MAX';
|
||||
|
||||
/**
|
||||
* the column name for the FRANCO_MIN_PRICE field
|
||||
*/
|
||||
const FRANCO_MIN_PRICE = 'chronopost_home_delivery_price.FRANCO_MIN_PRICE';
|
||||
|
||||
/**
|
||||
* the column name for the PRICE field
|
||||
*/
|
||||
const PRICE = 'chronopost_home_delivery_price.PRICE';
|
||||
|
||||
/**
|
||||
* The default string format for model objects of the related table
|
||||
*/
|
||||
const DEFAULT_STRING_FORMAT = 'YAML';
|
||||
|
||||
/**
|
||||
* holds an array of fieldnames
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'AreaId', 'DeliveryModeId', 'WeightMax', 'PriceMax', 'FrancoMinPrice', 'Price', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'areaId', 'deliveryModeId', 'weightMax', 'priceMax', 'francoMinPrice', 'price', ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryPriceTableMap::ID, ChronopostHomeDeliveryPriceTableMap::AREA_ID, ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID, ChronopostHomeDeliveryPriceTableMap::WEIGHT_MAX, ChronopostHomeDeliveryPriceTableMap::PRICE_MAX, ChronopostHomeDeliveryPriceTableMap::FRANCO_MIN_PRICE, ChronopostHomeDeliveryPriceTableMap::PRICE, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'AREA_ID', 'DELIVERY_MODE_ID', 'WEIGHT_MAX', 'PRICE_MAX', 'FRANCO_MIN_PRICE', 'PRICE', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'area_id', 'delivery_mode_id', 'weight_max', 'price_max', 'franco_min_price', 'price', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
* holds an array of keys for quick access to the fieldnames array
|
||||
*
|
||||
* first dimension keys are the type constants
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'AreaId' => 1, 'DeliveryModeId' => 2, 'WeightMax' => 3, 'PriceMax' => 4, 'FrancoMinPrice' => 5, 'Price' => 6, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'areaId' => 1, 'deliveryModeId' => 2, 'weightMax' => 3, 'priceMax' => 4, 'francoMinPrice' => 5, 'price' => 6, ),
|
||||
self::TYPE_COLNAME => array(ChronopostHomeDeliveryPriceTableMap::ID => 0, ChronopostHomeDeliveryPriceTableMap::AREA_ID => 1, ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID => 2, ChronopostHomeDeliveryPriceTableMap::WEIGHT_MAX => 3, ChronopostHomeDeliveryPriceTableMap::PRICE_MAX => 4, ChronopostHomeDeliveryPriceTableMap::FRANCO_MIN_PRICE => 5, ChronopostHomeDeliveryPriceTableMap::PRICE => 6, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'AREA_ID' => 1, 'DELIVERY_MODE_ID' => 2, 'WEIGHT_MAX' => 3, 'PRICE_MAX' => 4, 'FRANCO_MIN_PRICE' => 5, 'PRICE' => 6, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'area_id' => 1, 'delivery_mode_id' => 2, 'weight_max' => 3, 'price_max' => 4, 'franco_min_price' => 5, 'price' => 6, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
|
||||
);
|
||||
|
||||
/**
|
||||
* Initialize the table attributes and columns
|
||||
* Relations are not initialized by this method since they are lazy loaded
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
// attributes
|
||||
$this->setName('chronopost_home_delivery_price');
|
||||
$this->setPhpName('ChronopostHomeDeliveryPrice');
|
||||
$this->setClassName('\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryPrice');
|
||||
$this->setPackage('ChronopostHomeDelivery.Model');
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addForeignKey('AREA_ID', 'AreaId', 'INTEGER', 'area', 'ID', true, null, null);
|
||||
$this->addForeignKey('DELIVERY_MODE_ID', 'DeliveryModeId', 'INTEGER', 'chronopost_home_delivery_delivery_mode', 'ID', true, null, null);
|
||||
$this->addColumn('WEIGHT_MAX', 'WeightMax', 'FLOAT', false, null, null);
|
||||
$this->addColumn('PRICE_MAX', 'PriceMax', 'FLOAT', false, null, null);
|
||||
$this->addColumn('FRANCO_MIN_PRICE', 'FrancoMinPrice', 'FLOAT', false, null, null);
|
||||
$this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
|
||||
} // initialize()
|
||||
|
||||
/**
|
||||
* Build the RelationMap objects for this table relationships
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Area', '\\ChronopostHomeDelivery\\Model\\Thelia\\Model\\Area', RelationMap::MANY_TO_ONE, array('area_id' => 'id', ), 'RESTRICT', 'RESTRICT');
|
||||
$this->addRelation('ChronopostHomeDeliveryDeliveryMode', '\\ChronopostHomeDelivery\\Model\\ChronopostHomeDeliveryDeliveryMode', RelationMap::MANY_TO_ONE, array('delivery_mode_id' => 'id', ), 'RESTRICT', 'RESTRICT');
|
||||
} // buildRelations()
|
||||
|
||||
/**
|
||||
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
|
||||
*
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, a serialize()d version of the primary key will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*/
|
||||
public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
// If the PK cannot be derived from the row, return NULL.
|
||||
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the primary key from the DB resultset row
|
||||
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
|
||||
* a multi-column primary key, an array of the primary key columns will be returned.
|
||||
*
|
||||
* @param array $row resultset row.
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
|
||||
*
|
||||
* @return mixed The primary key of the row
|
||||
*/
|
||||
public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
|
||||
return (int) $row[
|
||||
$indexType == TableMap::TYPE_NUM
|
||||
? 0 + $offset
|
||||
: self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that the tableMap will make instances of.
|
||||
*
|
||||
* If $withPrefix is true, the returned path
|
||||
* uses a dot-path notation which is translated into a path
|
||||
* relative to a location on the PHP include_path.
|
||||
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
|
||||
*
|
||||
* @param boolean $withPrefix Whether or not to return the path with the class name
|
||||
* @return string path.to.ClassName
|
||||
*/
|
||||
public static function getOMClass($withPrefix = true)
|
||||
{
|
||||
return $withPrefix ? ChronopostHomeDeliveryPriceTableMap::CLASS_DEFAULT : ChronopostHomeDeliveryPriceTableMap::OM_CLASS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populates an object of the default type or an object that inherit from the default.
|
||||
*
|
||||
* @param array $row row returned by DataFetcher->fetch().
|
||||
* @param int $offset The 0-based offset for reading from the resultset row.
|
||||
* @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
|
||||
One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME
|
||||
* TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
|
||||
*
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
* @return array (ChronopostHomeDeliveryPrice object, last column rank)
|
||||
*/
|
||||
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
|
||||
{
|
||||
$key = ChronopostHomeDeliveryPriceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
|
||||
if (null !== ($obj = ChronopostHomeDeliveryPriceTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, $offset, true); // rehydrate
|
||||
$col = $offset + ChronopostHomeDeliveryPriceTableMap::NUM_HYDRATE_COLUMNS;
|
||||
} else {
|
||||
$cls = ChronopostHomeDeliveryPriceTableMap::OM_CLASS;
|
||||
$obj = new $cls();
|
||||
$col = $obj->hydrate($row, $offset, false, $indexType);
|
||||
ChronopostHomeDeliveryPriceTableMap::addInstanceToPool($obj, $key);
|
||||
}
|
||||
|
||||
return array($obj, $col);
|
||||
}
|
||||
|
||||
/**
|
||||
* The returned array will contain objects of the default type or
|
||||
* objects that inherit from the default.
|
||||
*
|
||||
* @param DataFetcherInterface $dataFetcher
|
||||
* @return array
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function populateObjects(DataFetcherInterface $dataFetcher)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// set the class once to avoid overhead in the loop
|
||||
$cls = static::getOMClass(false);
|
||||
// populate the object(s)
|
||||
while ($row = $dataFetcher->fetch()) {
|
||||
$key = ChronopostHomeDeliveryPriceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
|
||||
if (null !== ($obj = ChronopostHomeDeliveryPriceTableMap::getInstanceFromPool($key))) {
|
||||
// We no longer rehydrate the object, since this can cause data loss.
|
||||
// See http://www.propelorm.org/ticket/509
|
||||
// $obj->hydrate($row, 0, true); // rehydrate
|
||||
$results[] = $obj;
|
||||
} else {
|
||||
$obj = new $cls();
|
||||
$obj->hydrate($row);
|
||||
$results[] = $obj;
|
||||
ChronopostHomeDeliveryPriceTableMap::addInstanceToPool($obj, $key);
|
||||
} // if key exists
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
/**
|
||||
* Add all the columns needed to create a new object.
|
||||
*
|
||||
* Note: any columns that were marked with lazyLoad="true" in the
|
||||
* XML schema will not be added to the select list and only loaded
|
||||
* on demand.
|
||||
*
|
||||
* @param Criteria $criteria object containing the columns to add.
|
||||
* @param string $alias optional table alias
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function addSelectColumns(Criteria $criteria, $alias = null)
|
||||
{
|
||||
if (null === $alias) {
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::AREA_ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::DELIVERY_MODE_ID);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::WEIGHT_MAX);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::PRICE_MAX);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::FRANCO_MIN_PRICE);
|
||||
$criteria->addSelectColumn(ChronopostHomeDeliveryPriceTableMap::PRICE);
|
||||
} else {
|
||||
$criteria->addSelectColumn($alias . '.ID');
|
||||
$criteria->addSelectColumn($alias . '.AREA_ID');
|
||||
$criteria->addSelectColumn($alias . '.DELIVERY_MODE_ID');
|
||||
$criteria->addSelectColumn($alias . '.WEIGHT_MAX');
|
||||
$criteria->addSelectColumn($alias . '.PRICE_MAX');
|
||||
$criteria->addSelectColumn($alias . '.FRANCO_MIN_PRICE');
|
||||
$criteria->addSelectColumn($alias . '.PRICE');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the TableMap related to this object.
|
||||
* This method is not needed for general use but a specific application could have a need.
|
||||
* @return TableMap
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function getTableMap()
|
||||
{
|
||||
return Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryPriceTableMap::DATABASE_NAME)->getTable(ChronopostHomeDeliveryPriceTableMap::TABLE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a TableMap instance to the database for this tableMap class.
|
||||
*/
|
||||
public static function buildTableMap()
|
||||
{
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ChronopostHomeDeliveryPriceTableMap::DATABASE_NAME);
|
||||
if (!$dbMap->hasTable(ChronopostHomeDeliveryPriceTableMap::TABLE_NAME)) {
|
||||
$dbMap->addTableObject(new ChronopostHomeDeliveryPriceTableMap());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a DELETE on the database, given a ChronopostHomeDeliveryPrice or Criteria object OR a primary key value.
|
||||
*
|
||||
* @param mixed $values Criteria or ChronopostHomeDeliveryPrice 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 static function doDelete($values, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryPriceTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($values instanceof Criteria) {
|
||||
// rename for clarity
|
||||
$criteria = $values;
|
||||
} elseif ($values instanceof \ChronopostHomeDelivery\Model\ChronopostHomeDeliveryPrice) { // it's a model object
|
||||
// create criteria based on pk values
|
||||
$criteria = $values->buildPkeyCriteria();
|
||||
} else { // it's a primary key, or an array of pks
|
||||
$criteria = new Criteria(ChronopostHomeDeliveryPriceTableMap::DATABASE_NAME);
|
||||
$criteria->add(ChronopostHomeDeliveryPriceTableMap::ID, (array) $values, Criteria::IN);
|
||||
}
|
||||
|
||||
$query = ChronopostHomeDeliveryPriceQuery::create()->mergeWith($criteria);
|
||||
|
||||
if ($values instanceof Criteria) { ChronopostHomeDeliveryPriceTableMap::clearInstancePool();
|
||||
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
|
||||
foreach ((array) $values as $singleval) { ChronopostHomeDeliveryPriceTableMap::removeInstanceFromPool($singleval);
|
||||
}
|
||||
}
|
||||
|
||||
return $query->delete($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes all rows from the chronopost_home_delivery_price table.
|
||||
*
|
||||
* @param ConnectionInterface $con the connection to use
|
||||
* @return int The number of affected rows (if supported by underlying database driver).
|
||||
*/
|
||||
public static function doDeleteAll(ConnectionInterface $con = null)
|
||||
{
|
||||
return ChronopostHomeDeliveryPriceQuery::create()->doDeleteAll($con);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs an INSERT on the database, given a ChronopostHomeDeliveryPrice or Criteria object.
|
||||
*
|
||||
* @param mixed $criteria Criteria or ChronopostHomeDeliveryPrice object containing data that is used to create the INSERT statement.
|
||||
* @param ConnectionInterface $con the ConnectionInterface connection to use
|
||||
* @return mixed The new primary key.
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function doInsert($criteria, ConnectionInterface $con = null)
|
||||
{
|
||||
if (null === $con) {
|
||||
$con = Propel::getServiceContainer()->getWriteConnection(ChronopostHomeDeliveryPriceTableMap::DATABASE_NAME);
|
||||
}
|
||||
|
||||
if ($criteria instanceof Criteria) {
|
||||
$criteria = clone $criteria; // rename for clarity
|
||||
} else {
|
||||
$criteria = $criteria->buildCriteria(); // build Criteria from ChronopostHomeDeliveryPrice object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ChronopostHomeDeliveryPriceTableMap::ID) && $criteria->keyContainsValue(ChronopostHomeDeliveryPriceTableMap::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ChronopostHomeDeliveryPriceTableMap::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$query = ChronopostHomeDeliveryPriceQuery::create()->mergeWith($criteria);
|
||||
|
||||
try {
|
||||
// use transaction because $criteria could contain info
|
||||
// for more than one table (I guess, conceivably)
|
||||
$con->beginTransaction();
|
||||
$pk = $query->doInsert($con);
|
||||
$con->commit();
|
||||
} catch (PropelException $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
} // ChronopostHomeDeliveryPriceTableMap
|
||||
// This is the static code needed to register the TableMap for this table with the main Propel class.
|
||||
//
|
||||
ChronopostHomeDeliveryPriceTableMap::buildTableMap();
|
||||
Reference in New Issue
Block a user