Merge branch 'cart'

Conflicts:
	composer.lock
	core/lib/Thelia/Model/Base/Attribute.php
	core/lib/Thelia/Model/Base/AttributeAv.php
	core/lib/Thelia/Model/Base/AttributeCombination.php
	core/lib/Thelia/Model/Base/AttributeCombinationQuery.php
	core/lib/Thelia/Model/Base/Cart.php
	core/lib/Thelia/Model/Base/CartItem.php
	core/lib/Thelia/Model/Base/CartItemQuery.php
	core/lib/Thelia/Model/Base/Currency.php
	core/lib/Thelia/Model/Base/CurrencyQuery.php
	core/lib/Thelia/Model/Base/Product.php
	core/lib/Thelia/Model/Base/ProductPrice.php
	core/lib/Thelia/Model/Base/ProductPriceQuery.php
	core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php
	core/lib/Thelia/Model/Map/CartItemTableMap.php
	core/lib/Thelia/Model/Map/CurrencyTableMap.php
	core/lib/Thelia/Model/Map/ProductPriceTableMap.php
	core/lib/Thelia/Model/Map/ProductTableMap.php
	install/thelia.sql
	local/config/schema.xml
This commit is contained in:
Manuel Raynaud
2013-08-01 10:52:17 +02:00
259 changed files with 3976 additions and 4353 deletions

0
core/lib/Thelia/Model/Map/AccessoryTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AddressTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AdminGroupTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AdminLogTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AdminTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AreaTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AttributeAvI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AttributeAvTableMap.php Executable file → Normal file
View File

View File

View File

@@ -80,9 +80,9 @@ class AttributeCombinationTableMap extends TableMap
const ATTRIBUTE_AV_ID = 'attribute_combination.ATTRIBUTE_AV_ID';
/**
* the column name for the STOCK_ID field
* the column name for the PRODUCT_SALE_ELEMENTS_ID field
*/
const STOCK_ID = 'attribute_combination.STOCK_ID';
const PRODUCT_SALE_ELEMENTS_ID = 'attribute_combination.PRODUCT_SALE_ELEMENTS_ID';
/**
* the column name for the CREATED_AT field
@@ -106,11 +106,11 @@ class AttributeCombinationTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('AttributeId', 'AttributeAvId', 'StockId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('attributeId', 'attributeAvId', 'stockId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AttributeCombinationTableMap::ATTRIBUTE_ID, AttributeCombinationTableMap::ATTRIBUTE_AV_ID, AttributeCombinationTableMap::STOCK_ID, AttributeCombinationTableMap::CREATED_AT, AttributeCombinationTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ATTRIBUTE_ID', 'ATTRIBUTE_AV_ID', 'STOCK_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('attribute_id', 'attribute_av_id', 'stock_id', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('AttributeId', 'AttributeAvId', 'ProductSaleElementsId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('attributeId', 'attributeAvId', 'productSaleElementsId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AttributeCombinationTableMap::ATTRIBUTE_ID, AttributeCombinationTableMap::ATTRIBUTE_AV_ID, AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, AttributeCombinationTableMap::CREATED_AT, AttributeCombinationTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ATTRIBUTE_ID', 'ATTRIBUTE_AV_ID', 'PRODUCT_SALE_ELEMENTS_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('attribute_id', 'attribute_av_id', 'product_sale_elements_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
@@ -121,11 +121,11 @@ class AttributeCombinationTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('AttributeId' => 0, 'AttributeAvId' => 1, 'StockId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('attributeId' => 0, 'attributeAvId' => 1, 'stockId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(AttributeCombinationTableMap::ATTRIBUTE_ID => 0, AttributeCombinationTableMap::ATTRIBUTE_AV_ID => 1, AttributeCombinationTableMap::STOCK_ID => 2, AttributeCombinationTableMap::CREATED_AT => 3, AttributeCombinationTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ATTRIBUTE_ID' => 0, 'ATTRIBUTE_AV_ID' => 1, 'STOCK_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('attribute_id' => 0, 'attribute_av_id' => 1, 'stock_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_PHPNAME => array('AttributeId' => 0, 'AttributeAvId' => 1, 'ProductSaleElementsId' => 2, 'CreatedAt' => 3, 'UpdatedAt' => 4, ),
self::TYPE_STUDLYPHPNAME => array('attributeId' => 0, 'attributeAvId' => 1, 'productSaleElementsId' => 2, 'createdAt' => 3, 'updatedAt' => 4, ),
self::TYPE_COLNAME => array(AttributeCombinationTableMap::ATTRIBUTE_ID => 0, AttributeCombinationTableMap::ATTRIBUTE_AV_ID => 1, AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID => 2, AttributeCombinationTableMap::CREATED_AT => 3, AttributeCombinationTableMap::UPDATED_AT => 4, ),
self::TYPE_RAW_COLNAME => array('ATTRIBUTE_ID' => 0, 'ATTRIBUTE_AV_ID' => 1, 'PRODUCT_SALE_ELEMENTS_ID' => 2, 'CREATED_AT' => 3, 'UPDATED_AT' => 4, ),
self::TYPE_FIELDNAME => array('attribute_id' => 0, 'attribute_av_id' => 1, 'product_sale_elements_id' => 2, 'created_at' => 3, 'updated_at' => 4, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, )
);
@@ -147,7 +147,7 @@ class AttributeCombinationTableMap extends TableMap
// columns
$this->addForeignPrimaryKey('ATTRIBUTE_ID', 'AttributeId', 'INTEGER' , 'attribute', 'ID', true, null, null);
$this->addForeignPrimaryKey('ATTRIBUTE_AV_ID', 'AttributeAvId', 'INTEGER' , 'attribute_av', 'ID', true, null, null);
$this->addForeignPrimaryKey('STOCK_ID', 'StockId', 'INTEGER' , 'stock', 'ID', true, null, null);
$this->addForeignPrimaryKey('PRODUCT_SALE_ELEMENTS_ID', 'ProductSaleElementsId', 'INTEGER' , 'product_sale_elements', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -159,7 +159,7 @@ class AttributeCombinationTableMap extends TableMap
{
$this->addRelation('Attribute', '\\Thelia\\Model\\Attribute', RelationMap::MANY_TO_ONE, array('attribute_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('AttributeAv', '\\Thelia\\Model\\AttributeAv', RelationMap::MANY_TO_ONE, array('attribute_av_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::MANY_TO_ONE, array('stock_id' => 'id', ), null, null);
$this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null);
} // buildRelations()
/**
@@ -190,7 +190,7 @@ class AttributeCombinationTableMap extends TableMap
{
if (Propel::isInstancePoolingEnabled()) {
if (null === $key) {
$key = serialize(array((string) $obj->getAttributeId(), (string) $obj->getAttributeAvId(), (string) $obj->getStockId()));
$key = serialize(array((string) $obj->getAttributeId(), (string) $obj->getAttributeAvId(), (string) $obj->getProductSaleElementsId()));
} // if key === null
self::$instances[$key] = $obj;
}
@@ -210,7 +210,7 @@ class AttributeCombinationTableMap extends TableMap
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\AttributeCombination) {
$key = serialize(array((string) $value->getAttributeId(), (string) $value->getAttributeAvId(), (string) $value->getStockId()));
$key = serialize(array((string) $value->getAttributeId(), (string) $value->getAttributeAvId(), (string) $value->getProductSaleElementsId()));
} elseif (is_array($value) && count($value) === 3) {
// assume we've been passed a primary key";
@@ -242,11 +242,11 @@ class AttributeCombinationTableMap extends TableMap
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('AttributeId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('StockId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('StockId', TableMap::TYPE_PHPNAME, $indexType)]));
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeAvId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('ProductSaleElementsId', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -364,13 +364,13 @@ class AttributeCombinationTableMap extends TableMap
if (null === $alias) {
$criteria->addSelectColumn(AttributeCombinationTableMap::ATTRIBUTE_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::ATTRIBUTE_AV_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::STOCK_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::CREATED_AT);
$criteria->addSelectColumn(AttributeCombinationTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ATTRIBUTE_ID');
$criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_ID');
$criteria->addSelectColumn($alias . '.STOCK_ID');
$criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -433,7 +433,7 @@ class AttributeCombinationTableMap extends TableMap
foreach ($values as $value) {
$criterion = $criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $value[1]));
$criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::STOCK_ID, $value[2]));
$criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::PRODUCT_SALE_ELEMENTS_ID, $value[2]));
$criteria->addOr($criterion);
}
}

0
core/lib/Thelia/Model/Map/AttributeI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/AttributeTableMap.php Executable file → Normal file
View File

View File

@@ -90,9 +90,9 @@ class CartItemTableMap extends TableMap
const QUANTITY = 'cart_item.QUANTITY';
/**
* the column name for the STOCK_ID field
* the column name for the PRODUCT_SALE_ELEMENTS_ID field
*/
const STOCK_ID = 'cart_item.STOCK_ID';
const PRODUCT_SALE_ELEMENTS_ID = 'cart_item.PRODUCT_SALE_ELEMENTS_ID';
/**
* the column name for the CREATED_AT field
@@ -116,11 +116,11 @@ class CartItemTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'CartId', 'ProductId', 'Quantity', 'StockId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'stockId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::STOCK_ID, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'STOCK_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'stock_id', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'CartId', 'ProductId', 'Quantity', 'ProductSaleElementsId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'productSaleElementsId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'PRODUCT_SALE_ELEMENTS_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'product_sale_elements_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -131,11 +131,11 @@ class CartItemTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'CartId' => 1, 'ProductId' => 2, 'Quantity' => 3, 'StockId' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'stockId' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::STOCK_ID => 4, CartItemTableMap::CREATED_AT => 5, CartItemTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CART_ID' => 1, 'PRODUCT_ID' => 2, 'QUANTITY' => 3, 'STOCK_ID' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'stock_id' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_PHPNAME => array('Id' => 0, 'CartId' => 1, 'ProductId' => 2, 'Quantity' => 3, 'ProductSaleElementsId' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'productSaleElementsId' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID => 4, CartItemTableMap::CREATED_AT => 5, CartItemTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CART_ID' => 1, 'PRODUCT_ID' => 2, 'QUANTITY' => 3, 'PRODUCT_SALE_ELEMENTS_ID' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'product_sale_elements_id' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -159,7 +159,7 @@ class CartItemTableMap extends TableMap
$this->addForeignKey('CART_ID', 'CartId', 'INTEGER', 'cart', 'ID', true, null, null);
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
$this->addColumn('QUANTITY', 'Quantity', 'FLOAT', false, null, 1);
$this->addForeignKey('STOCK_ID', 'StockId', 'INTEGER', 'stock', 'ID', true, null, null);
$this->addForeignKey('PRODUCT_SALE_ELEMENTS_ID', 'ProductSaleElementsId', 'INTEGER', 'product_sale_elements', 'ID', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -171,7 +171,7 @@ class CartItemTableMap extends TableMap
{
$this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::MANY_TO_ONE, array('cart_id' => 'id', ), null, null);
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), null, null);
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::MANY_TO_ONE, array('stock_id' => 'id', ), null, null);
$this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null);
} // buildRelations()
/**
@@ -329,7 +329,7 @@ class CartItemTableMap extends TableMap
$criteria->addSelectColumn(CartItemTableMap::CART_ID);
$criteria->addSelectColumn(CartItemTableMap::PRODUCT_ID);
$criteria->addSelectColumn(CartItemTableMap::QUANTITY);
$criteria->addSelectColumn(CartItemTableMap::STOCK_ID);
$criteria->addSelectColumn(CartItemTableMap::PRODUCT_SALE_ELEMENTS_ID);
$criteria->addSelectColumn(CartItemTableMap::CREATED_AT);
$criteria->addSelectColumn(CartItemTableMap::UPDATED_AT);
} else {
@@ -337,7 +337,7 @@ class CartItemTableMap extends TableMap
$criteria->addSelectColumn($alias . '.CART_ID');
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
$criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.STOCK_ID');
$criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

0
core/lib/Thelia/Model/Map/CategoryI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CategoryTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CategoryVersionTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ConfigI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ConfigTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ContentAssocTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ContentFolderTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ContentI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ContentTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ContentVersionTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CountryI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CountryTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CouponOrderTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CouponRuleTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/CouponTableMap.php Executable file → Normal file
View File

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\Combination;
use Thelia\Model\CombinationQuery;
use Thelia\Model\CurrencyI18n;
use Thelia\Model\CurrencyI18nQuery;
/**
* This class defines the structure of the 'combination' table.
* This class defines the structure of the 'currency_i18n' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\CombinationQuery;
* (i.e. if it's a text column type).
*
*/
class CombinationTableMap extends TableMap
class CurrencyI18nTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.CombinationTableMap';
const CLASS_NAME = 'Thelia.Model.Map.CurrencyI18nTableMap';
/**
* The default database name for this class
@@ -42,22 +42,22 @@ class CombinationTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'combination';
const TABLE_NAME = 'currency_i18n';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\Combination';
const OM_CLASS = '\\Thelia\\Model\\CurrencyI18n';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.Combination';
const CLASS_DEFAULT = 'Thelia.Model.CurrencyI18n';
/**
* The total number of columns
*/
const NUM_COLUMNS = 4;
const NUM_COLUMNS = 3;
/**
* The number of lazy-loaded columns
@@ -67,27 +67,22 @@ class CombinationTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 4;
const NUM_HYDRATE_COLUMNS = 3;
/**
* the column name for the ID field
*/
const ID = 'combination.ID';
const ID = 'currency_i18n.ID';
/**
* the column name for the REF field
* the column name for the LOCALE field
*/
const REF = 'combination.REF';
const LOCALE = 'currency_i18n.LOCALE';
/**
* the column name for the CREATED_AT field
* the column name for the NAME field
*/
const CREATED_AT = 'combination.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'combination.UPDATED_AT';
const NAME = 'currency_i18n.NAME';
/**
* The default string format for model objects of the related table
@@ -101,12 +96,12 @@ class CombinationTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Ref', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(CombinationTableMap::ID, CombinationTableMap::REF, CombinationTableMap::CREATED_AT, CombinationTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'REF', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'ref', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, )
self::TYPE_PHPNAME => array('Id', 'Locale', 'Name', ),
self::TYPE_STUDLYPHPNAME => array('id', 'locale', 'name', ),
self::TYPE_COLNAME => array(CurrencyI18nTableMap::ID, CurrencyI18nTableMap::LOCALE, CurrencyI18nTableMap::NAME, ),
self::TYPE_RAW_COLNAME => array('ID', 'LOCALE', 'NAME', ),
self::TYPE_FIELDNAME => array('id', 'locale', 'name', ),
self::TYPE_NUM => array(0, 1, 2, )
);
/**
@@ -116,12 +111,12 @@ class CombinationTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'CreatedAt' => 2, 'UpdatedAt' => 3, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'createdAt' => 2, 'updatedAt' => 3, ),
self::TYPE_COLNAME => array(CombinationTableMap::ID => 0, CombinationTableMap::REF => 1, CombinationTableMap::CREATED_AT => 2, CombinationTableMap::UPDATED_AT => 3, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'CREATED_AT' => 2, 'UPDATED_AT' => 3, ),
self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'created_at' => 2, 'updated_at' => 3, ),
self::TYPE_NUM => array(0, 1, 2, 3, )
self::TYPE_PHPNAME => array('Id' => 0, 'Locale' => 1, 'Name' => 2, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'locale' => 1, 'name' => 2, ),
self::TYPE_COLNAME => array(CurrencyI18nTableMap::ID => 0, CurrencyI18nTableMap::LOCALE => 1, CurrencyI18nTableMap::NAME => 2, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'LOCALE' => 1, 'NAME' => 2, ),
self::TYPE_FIELDNAME => array('id' => 0, 'locale' => 1, 'name' => 2, ),
self::TYPE_NUM => array(0, 1, 2, )
);
/**
@@ -134,16 +129,15 @@ class CombinationTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('combination');
$this->setPhpName('Combination');
$this->setClassName('\\Thelia\\Model\\Combination');
$this->setName('currency_i18n');
$this->setPhpName('CurrencyI18n');
$this->setClassName('\\Thelia\\Model\\CurrencyI18n');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
$this->setUseIdGenerator(false);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', false, 255, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'currency', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addColumn('NAME', 'Name', 'VARCHAR', false, 45, null);
} // initialize()
/**
@@ -151,34 +145,62 @@ class CombinationTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'combination_id', ), 'CASCADE', 'RESTRICT', 'AttributeCombinations');
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::ONE_TO_MANY, array('id' => 'combination_id', ), 'SET NULL', 'RESTRICT', 'Stocks');
$this->addRelation('CartItem', '\\Thelia\\Model\\CartItem', RelationMap::ONE_TO_MANY, array('id' => 'combination_id', ), null, null, 'CartItems');
$this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('id' => 'id', ), 'CASCADE', null);
} // buildRelations()
/**
* Adds an object to the instance pool.
*
* Gets the list of behaviors registered for this table
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by find*()
* and findPk*() calls.
*
* @return array Associative array (name => parameters) of behaviors
* @param \Thelia\Model\CurrencyI18n $obj A \Thelia\Model\CurrencyI18n object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public function getBehaviors()
public static function addInstanceToPool($obj, $key = null)
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
if (Propel::isInstancePoolingEnabled()) {
if (null === $key) {
$key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Method to invalidate the instance pool of all tables related to combination * by a foreign key with ON DELETE CASCADE
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A \Thelia\Model\CurrencyI18n object or a primary key value.
*/
public static function clearRelatedInstancePool()
public static function removeInstanceFromPool($value)
{
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
AttributeCombinationTableMap::clearInstancePool();
StockTableMap::clearInstancePool();
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\CurrencyI18n) {
$key = serialize(array((string) $value->getId(), (string) $value->getLocale()));
} elseif (is_array($value) && count($value) === 2) {
// assume we've been passed a primary key";
$key = serialize(array((string) $value[0], (string) $value[1]));
} elseif ($value instanceof Criteria) {
self::$instances = [];
return;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \Thelia\Model\CurrencyI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
throw $e;
}
unset(self::$instances[$key]);
}
}
/**
* 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.
*
@@ -193,11 +215,11 @@ class CombinationTableMap extends TableMap
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) {
if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
return (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -215,11 +237,7 @@ class CombinationTableMap extends TableMap
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)
];
return $pks;
}
/**
@@ -235,7 +253,7 @@ class CombinationTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? CombinationTableMap::CLASS_DEFAULT : CombinationTableMap::OM_CLASS;
return $withPrefix ? CurrencyI18nTableMap::CLASS_DEFAULT : CurrencyI18nTableMap::OM_CLASS;
}
/**
@@ -249,21 +267,21 @@ class CombinationTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (Combination object, last column rank)
* @return array (CurrencyI18n object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = CombinationTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = CombinationTableMap::getInstanceFromPool($key))) {
$key = CurrencyI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = CurrencyI18nTableMap::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 + CombinationTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + CurrencyI18nTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = CombinationTableMap::OM_CLASS;
$cls = CurrencyI18nTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
CombinationTableMap::addInstanceToPool($obj, $key);
CurrencyI18nTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -286,8 +304,8 @@ class CombinationTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = CombinationTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = CombinationTableMap::getInstanceFromPool($key))) {
$key = CurrencyI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = CurrencyI18nTableMap::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
@@ -296,7 +314,7 @@ class CombinationTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
CombinationTableMap::addInstanceToPool($obj, $key);
CurrencyI18nTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -317,15 +335,13 @@ class CombinationTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CombinationTableMap::ID);
$criteria->addSelectColumn(CombinationTableMap::REF);
$criteria->addSelectColumn(CombinationTableMap::CREATED_AT);
$criteria->addSelectColumn(CombinationTableMap::UPDATED_AT);
$criteria->addSelectColumn(CurrencyI18nTableMap::ID);
$criteria->addSelectColumn(CurrencyI18nTableMap::LOCALE);
$criteria->addSelectColumn(CurrencyI18nTableMap::NAME);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.REF');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
$criteria->addSelectColumn($alias . '.LOCALE');
$criteria->addSelectColumn($alias . '.NAME');
}
}
@@ -338,7 +354,7 @@ class CombinationTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(CombinationTableMap::DATABASE_NAME)->getTable(CombinationTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(CurrencyI18nTableMap::DATABASE_NAME)->getTable(CurrencyI18nTableMap::TABLE_NAME);
}
/**
@@ -346,16 +362,16 @@ class CombinationTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CombinationTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(CombinationTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new CombinationTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(CurrencyI18nTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(CurrencyI18nTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new CurrencyI18nTableMap());
}
}
/**
* Performs a DELETE on the database, given a Combination or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a CurrencyI18n or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Combination object or primary key or array of primary keys
* @param mixed $values Criteria or CurrencyI18n 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
@@ -366,25 +382,35 @@ class CombinationTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\Combination) { // it's a model object
} elseif ($values instanceof \Thelia\Model\CurrencyI18n) { // 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(CombinationTableMap::DATABASE_NAME);
$criteria->add(CombinationTableMap::ID, (array) $values, Criteria::IN);
$criteria = new Criteria(CurrencyI18nTableMap::DATABASE_NAME);
// primary key is composite; we therefore, expect
// the primary key passed to be an array of pkey values
if (count($values) == count($values, COUNT_RECURSIVE)) {
// array is not multi-dimensional
$values = array($values);
}
foreach ($values as $value) {
$criterion = $criteria->getNewCriterion(CurrencyI18nTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(CurrencyI18nTableMap::LOCALE, $value[1]));
$criteria->addOr($criterion);
}
}
$query = CombinationQuery::create()->mergeWith($criteria);
$query = CurrencyI18nQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { CombinationTableMap::clearInstancePool();
if ($values instanceof Criteria) { CurrencyI18nTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { CombinationTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { CurrencyI18nTableMap::removeInstanceFromPool($singleval);
}
}
@@ -392,20 +418,20 @@ class CombinationTableMap extends TableMap
}
/**
* Deletes all rows from the combination table.
* Deletes all rows from the currency_i18n 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 CombinationQuery::create()->doDeleteAll($con);
return CurrencyI18nQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a Combination or Criteria object.
* Performs an INSERT on the database, given a CurrencyI18n or Criteria object.
*
* @param mixed $criteria Criteria or Combination object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or CurrencyI18n 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
@@ -414,22 +440,18 @@ class CombinationTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(CombinationTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(CurrencyI18nTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from Combination object
}
if ($criteria->containsKey(CombinationTableMap::ID) && $criteria->keyContainsValue(CombinationTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CombinationTableMap::ID.')');
$criteria = $criteria->buildCriteria(); // build Criteria from CurrencyI18n object
}
// Set the correct dbName
$query = CombinationQuery::create()->mergeWith($criteria);
$query = CurrencyI18nQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -445,7 +467,7 @@ class CombinationTableMap extends TableMap
return $pk;
}
} // CombinationTableMap
} // CurrencyI18nTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
CombinationTableMap::buildTableMap();
CurrencyI18nTableMap::buildTableMap();

48
core/lib/Thelia/Model/Map/CurrencyTableMap.php Executable file → Normal file
View File

@@ -57,7 +57,7 @@ class CurrencyTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 8;
const NUM_COLUMNS = 7;
/**
* The number of lazy-loaded columns
@@ -67,18 +67,13 @@ class CurrencyTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 8;
const NUM_HYDRATE_COLUMNS = 7;
/**
* the column name for the ID field
*/
const ID = 'currency.ID';
/**
* the column name for the NAME field
*/
const NAME = 'currency.NAME';
/**
* the column name for the CODE field
*/
@@ -114,6 +109,15 @@ class CurrencyTableMap extends TableMap
*/
const DEFAULT_STRING_FORMAT = 'YAML';
// i18n behavior
/**
* The default locale to use for translations.
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
/**
* holds an array of fieldnames
*
@@ -121,12 +125,12 @@ class CurrencyTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'Name', 'Code', 'Symbol', 'Rate', 'ByDefault', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'name', 'code', 'symbol', 'rate', 'byDefault', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(CurrencyTableMap::ID, CurrencyTableMap::NAME, CurrencyTableMap::CODE, CurrencyTableMap::SYMBOL, CurrencyTableMap::RATE, CurrencyTableMap::BY_DEFAULT, CurrencyTableMap::CREATED_AT, CurrencyTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'NAME', 'CODE', 'SYMBOL', 'RATE', 'BY_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'name', 'code', 'symbol', 'rate', 'by_default', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
self::TYPE_PHPNAME => array('Id', 'Code', 'Symbol', 'Rate', 'ByDefault', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'code', 'symbol', 'rate', 'byDefault', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(CurrencyTableMap::ID, CurrencyTableMap::CODE, CurrencyTableMap::SYMBOL, CurrencyTableMap::RATE, CurrencyTableMap::BY_DEFAULT, CurrencyTableMap::CREATED_AT, CurrencyTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CODE', 'SYMBOL', 'RATE', 'BY_DEFAULT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'code', 'symbol', 'rate', 'by_default', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
/**
@@ -136,12 +140,12 @@ class CurrencyTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Code' => 2, 'Symbol' => 3, 'Rate' => 4, 'ByDefault' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'name' => 1, 'code' => 2, 'symbol' => 3, 'rate' => 4, 'byDefault' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
self::TYPE_COLNAME => array(CurrencyTableMap::ID => 0, CurrencyTableMap::NAME => 1, CurrencyTableMap::CODE => 2, CurrencyTableMap::SYMBOL => 3, CurrencyTableMap::RATE => 4, CurrencyTableMap::BY_DEFAULT => 5, CurrencyTableMap::CREATED_AT => 6, CurrencyTableMap::UPDATED_AT => 7, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'NAME' => 1, 'CODE' => 2, 'SYMBOL' => 3, 'RATE' => 4, 'BY_DEFAULT' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'code' => 2, 'symbol' => 3, 'rate' => 4, 'by_default' => 5, 'created_at' => 6, 'updated_at' => 7, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
self::TYPE_PHPNAME => array('Id' => 0, 'Code' => 1, 'Symbol' => 2, 'Rate' => 3, 'ByDefault' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'byDefault' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(CurrencyTableMap::ID => 0, CurrencyTableMap::CODE => 1, CurrencyTableMap::SYMBOL => 2, CurrencyTableMap::RATE => 3, CurrencyTableMap::BY_DEFAULT => 4, CurrencyTableMap::CREATED_AT => 5, CurrencyTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'CODE' => 1, 'SYMBOL' => 2, 'RATE' => 3, 'BY_DEFAULT' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'code' => 1, 'symbol' => 2, 'rate' => 3, 'by_default' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
/**
@@ -161,7 +165,6 @@ class CurrencyTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addColumn('NAME', 'Name', 'VARCHAR', false, 45, null);
$this->addColumn('CODE', 'Code', 'VARCHAR', false, 45, null);
$this->addColumn('SYMBOL', 'Symbol', 'VARCHAR', false, 45, null);
$this->addColumn('RATE', 'Rate', 'FLOAT', false, null, null);
@@ -178,6 +181,7 @@ class CurrencyTableMap extends TableMap
$this->addRelation('Order', '\\Thelia\\Model\\Order', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), 'SET NULL', 'RESTRICT', 'Orders');
$this->addRelation('Cart', '\\Thelia\\Model\\Cart', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), null, null, 'Carts');
$this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'currency_id', ), null, null, 'ProductPrices');
$this->addRelation('CurrencyI18n', '\\Thelia\\Model\\CurrencyI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'CurrencyI18ns');
} // buildRelations()
/**
@@ -190,6 +194,7 @@ class CurrencyTableMap extends TableMap
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'name', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
);
} // getBehaviors()
/**
@@ -200,6 +205,7 @@ class CurrencyTableMap extends TableMap
// Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
OrderTableMap::clearInstancePool();
CurrencyI18nTableMap::clearInstancePool();
}
/**
@@ -341,7 +347,6 @@ class CurrencyTableMap extends TableMap
{
if (null === $alias) {
$criteria->addSelectColumn(CurrencyTableMap::ID);
$criteria->addSelectColumn(CurrencyTableMap::NAME);
$criteria->addSelectColumn(CurrencyTableMap::CODE);
$criteria->addSelectColumn(CurrencyTableMap::SYMBOL);
$criteria->addSelectColumn(CurrencyTableMap::RATE);
@@ -350,7 +355,6 @@ class CurrencyTableMap extends TableMap
$criteria->addSelectColumn(CurrencyTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.CODE');
$criteria->addSelectColumn($alias . '.SYMBOL');
$criteria->addSelectColumn($alias . '.RATE');

0
core/lib/Thelia/Model/Map/CustomerTableMap.php Executable file → Normal file
View File

View File

0
core/lib/Thelia/Model/Map/CustomerTitleTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/DelivzoneTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/DocumentI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/DocumentTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FeatureAvI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FeatureAvTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FeatureCategoryTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FeatureI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FeatureTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FolderI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FolderTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/FolderVersionTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/GroupI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/GroupModuleTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/GroupResourceTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/GroupTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ImageI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ImageTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/LangTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/MessageI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/MessageTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/MessageVersionTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ModuleI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ModuleTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/OrderAddressTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/OrderFeatureTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/OrderProductTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/OrderStatusI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/OrderStatusTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/OrderTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ProductCategoryTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ProductI18nTableMap.php Executable file → Normal file
View File

View File

@@ -75,9 +75,9 @@ class ProductPriceTableMap extends TableMap
const ID = 'product_price.ID';
/**
* the column name for the STOCK_ID field
* the column name for the PRODUCT_SALE_ELEMENTS_ID field
*/
const STOCK_ID = 'product_price.STOCK_ID';
const PRODUCT_SALE_ELEMENTS_ID = 'product_price.PRODUCT_SALE_ELEMENTS_ID';
/**
* the column name for the CURRENCY_ID field
@@ -116,11 +116,11 @@ class ProductPriceTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'StockId', 'CurrencyId', 'Price', 'PromoPrice', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'stockId', 'currencyId', 'price', 'promoPrice', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductPriceTableMap::ID, ProductPriceTableMap::STOCK_ID, ProductPriceTableMap::CURRENCY_ID, ProductPriceTableMap::PRICE, ProductPriceTableMap::PROMO_PRICE, ProductPriceTableMap::CREATED_AT, ProductPriceTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'STOCK_ID', 'CURRENCY_ID', 'PRICE', 'PROMO_PRICE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'stock_id', 'currency_id', 'price', 'promo_price', 'created_at', 'updated_at', ),
self::TYPE_PHPNAME => array('Id', 'ProductSaleElementsId', 'CurrencyId', 'Price', 'PromoPrice', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'productSaleElementsId', 'currencyId', 'price', 'promoPrice', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductPriceTableMap::ID, ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID, ProductPriceTableMap::CURRENCY_ID, ProductPriceTableMap::PRICE, ProductPriceTableMap::PROMO_PRICE, ProductPriceTableMap::CREATED_AT, ProductPriceTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_SALE_ELEMENTS_ID', 'CURRENCY_ID', 'PRICE', 'PROMO_PRICE', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'product_sale_elements_id', 'currency_id', 'price', 'promo_price', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -131,11 +131,11 @@ class ProductPriceTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'StockId' => 1, 'CurrencyId' => 2, 'Price' => 3, 'PromoPrice' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'stockId' => 1, 'currencyId' => 2, 'price' => 3, 'promoPrice' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(ProductPriceTableMap::ID => 0, ProductPriceTableMap::STOCK_ID => 1, ProductPriceTableMap::CURRENCY_ID => 2, ProductPriceTableMap::PRICE => 3, ProductPriceTableMap::PROMO_PRICE => 4, ProductPriceTableMap::CREATED_AT => 5, ProductPriceTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'STOCK_ID' => 1, 'CURRENCY_ID' => 2, 'PRICE' => 3, 'PROMO_PRICE' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'stock_id' => 1, 'currency_id' => 2, 'price' => 3, 'promo_price' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_PHPNAME => array('Id' => 0, 'ProductSaleElementsId' => 1, 'CurrencyId' => 2, 'Price' => 3, 'PromoPrice' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productSaleElementsId' => 1, 'currencyId' => 2, 'price' => 3, 'promoPrice' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(ProductPriceTableMap::ID => 0, ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID => 1, ProductPriceTableMap::CURRENCY_ID => 2, ProductPriceTableMap::PRICE => 3, ProductPriceTableMap::PROMO_PRICE => 4, ProductPriceTableMap::CREATED_AT => 5, ProductPriceTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_SALE_ELEMENTS_ID' => 1, 'CURRENCY_ID' => 2, 'PRICE' => 3, 'PROMO_PRICE' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'product_sale_elements_id' => 1, 'currency_id' => 2, 'price' => 3, 'promo_price' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
);
@@ -156,7 +156,7 @@ class ProductPriceTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('STOCK_ID', 'StockId', 'INTEGER', 'stock', 'ID', true, null, null);
$this->addForeignKey('PRODUCT_SALE_ELEMENTS_ID', 'ProductSaleElementsId', 'INTEGER', 'product_sale_elements', 'ID', true, null, null);
$this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', true, null, null);
$this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
$this->addColumn('PROMO_PRICE', 'PromoPrice', 'FLOAT', false, null, null);
@@ -169,7 +169,7 @@ class ProductPriceTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::MANY_TO_ONE, array('stock_id' => 'id', ), null, null);
$this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null);
$this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), null, null);
} // buildRelations()
@@ -325,7 +325,7 @@ class ProductPriceTableMap extends TableMap
{
if (null === $alias) {
$criteria->addSelectColumn(ProductPriceTableMap::ID);
$criteria->addSelectColumn(ProductPriceTableMap::STOCK_ID);
$criteria->addSelectColumn(ProductPriceTableMap::PRODUCT_SALE_ELEMENTS_ID);
$criteria->addSelectColumn(ProductPriceTableMap::CURRENCY_ID);
$criteria->addSelectColumn(ProductPriceTableMap::PRICE);
$criteria->addSelectColumn(ProductPriceTableMap::PROMO_PRICE);
@@ -333,7 +333,7 @@ class ProductPriceTableMap extends TableMap
$criteria->addSelectColumn(ProductPriceTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STOCK_ID');
$criteria->addSelectColumn($alias . '.PRODUCT_SALE_ELEMENTS_ID');
$criteria->addSelectColumn($alias . '.CURRENCY_ID');
$criteria->addSelectColumn($alias . '.PRICE');
$criteria->addSelectColumn($alias . '.PROMO_PRICE');

View File

@@ -10,12 +10,12 @@ use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\Stock;
use Thelia\Model\StockQuery;
use Thelia\Model\ProductSaleElements;
use Thelia\Model\ProductSaleElementsQuery;
/**
* This class defines the structure of the 'stock' table.
* This class defines the structure of the 'product_sale_elements' table.
*
*
*
@@ -25,14 +25,14 @@ use Thelia\Model\StockQuery;
* (i.e. if it's a text column type).
*
*/
class StockTableMap extends TableMap
class ProductSaleElementsTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.StockTableMap';
const CLASS_NAME = 'Thelia.Model.Map.ProductSaleElementsTableMap';
/**
* The default database name for this class
@@ -42,22 +42,22 @@ class StockTableMap extends TableMap
/**
* The table name for this class
*/
const TABLE_NAME = 'stock';
const TABLE_NAME = 'product_sale_elements';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\Stock';
const OM_CLASS = '\\Thelia\\Model\\ProductSaleElements';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.Stock';
const CLASS_DEFAULT = 'Thelia.Model.ProductSaleElements';
/**
* The total number of columns
*/
const NUM_COLUMNS = 9;
const NUM_COLUMNS = 8;
/**
* The number of lazy-loaded columns
@@ -67,52 +67,47 @@ class StockTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 9;
const NUM_HYDRATE_COLUMNS = 8;
/**
* the column name for the ID field
*/
const ID = 'stock.ID';
const ID = 'product_sale_elements.ID';
/**
* the column name for the PRODUCT_ID field
*/
const PRODUCT_ID = 'stock.PRODUCT_ID';
/**
* the column name for the INCREASE field
*/
const INCREASE = 'stock.INCREASE';
const PRODUCT_ID = 'product_sale_elements.PRODUCT_ID';
/**
* the column name for the QUANTITY field
*/
const QUANTITY = 'stock.QUANTITY';
const QUANTITY = 'product_sale_elements.QUANTITY';
/**
* the column name for the PROMO field
*/
const PROMO = 'stock.PROMO';
const PROMO = 'product_sale_elements.PROMO';
/**
* the column name for the NEWNESS field
*/
const NEWNESS = 'stock.NEWNESS';
const NEWNESS = 'product_sale_elements.NEWNESS';
/**
* the column name for the WEIGHT field
*/
const WEIGHT = 'stock.WEIGHT';
const WEIGHT = 'product_sale_elements.WEIGHT';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'stock.CREATED_AT';
const CREATED_AT = 'product_sale_elements.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'stock.UPDATED_AT';
const UPDATED_AT = 'product_sale_elements.UPDATED_AT';
/**
* The default string format for model objects of the related table
@@ -126,12 +121,12 @@ class StockTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'ProductId', 'Increase', 'Quantity', 'Promo', 'Newness', 'Weight', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'increase', 'quantity', 'promo', 'newness', 'weight', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(StockTableMap::ID, StockTableMap::PRODUCT_ID, StockTableMap::INCREASE, StockTableMap::QUANTITY, StockTableMap::PROMO, StockTableMap::NEWNESS, StockTableMap::WEIGHT, StockTableMap::CREATED_AT, StockTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'INCREASE', 'QUANTITY', 'PROMO', 'NEWNESS', 'WEIGHT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'product_id', 'increase', 'quantity', 'promo', 'newness', 'weight', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
self::TYPE_PHPNAME => array('Id', 'ProductId', 'Quantity', 'Promo', 'Newness', 'Weight', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'productId', 'quantity', 'promo', 'newness', 'weight', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID, ProductSaleElementsTableMap::PRODUCT_ID, ProductSaleElementsTableMap::QUANTITY, ProductSaleElementsTableMap::PROMO, ProductSaleElementsTableMap::NEWNESS, ProductSaleElementsTableMap::WEIGHT, ProductSaleElementsTableMap::CREATED_AT, ProductSaleElementsTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'PRODUCT_ID', 'QUANTITY', 'PROMO', 'NEWNESS', 'WEIGHT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'product_id', 'quantity', 'promo', 'newness', 'weight', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@@ -141,12 +136,12 @@ class StockTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'Increase' => 2, 'Quantity' => 3, 'Promo' => 4, 'Newness' => 5, 'Weight' => 6, 'CreatedAt' => 7, 'UpdatedAt' => 8, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'increase' => 2, 'quantity' => 3, 'promo' => 4, 'newness' => 5, 'weight' => 6, 'createdAt' => 7, 'updatedAt' => 8, ),
self::TYPE_COLNAME => array(StockTableMap::ID => 0, StockTableMap::PRODUCT_ID => 1, StockTableMap::INCREASE => 2, StockTableMap::QUANTITY => 3, StockTableMap::PROMO => 4, StockTableMap::NEWNESS => 5, StockTableMap::WEIGHT => 6, StockTableMap::CREATED_AT => 7, StockTableMap::UPDATED_AT => 8, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'INCREASE' => 2, 'QUANTITY' => 3, 'PROMO' => 4, 'NEWNESS' => 5, 'WEIGHT' => 6, 'CREATED_AT' => 7, 'UPDATED_AT' => 8, ),
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'increase' => 2, 'quantity' => 3, 'promo' => 4, 'newness' => 5, 'weight' => 6, 'created_at' => 7, 'updated_at' => 8, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, )
self::TYPE_PHPNAME => array('Id' => 0, 'ProductId' => 1, 'Quantity' => 2, 'Promo' => 3, 'Newness' => 4, 'Weight' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'productId' => 1, 'quantity' => 2, 'promo' => 3, 'newness' => 4, 'weight' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
self::TYPE_COLNAME => array(ProductSaleElementsTableMap::ID => 0, ProductSaleElementsTableMap::PRODUCT_ID => 1, ProductSaleElementsTableMap::QUANTITY => 2, ProductSaleElementsTableMap::PROMO => 3, ProductSaleElementsTableMap::NEWNESS => 4, ProductSaleElementsTableMap::WEIGHT => 5, ProductSaleElementsTableMap::CREATED_AT => 6, ProductSaleElementsTableMap::UPDATED_AT => 7, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'PRODUCT_ID' => 1, 'QUANTITY' => 2, 'PROMO' => 3, 'NEWNESS' => 4, 'WEIGHT' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
self::TYPE_FIELDNAME => array('id' => 0, 'product_id' => 1, 'quantity' => 2, 'promo' => 3, 'newness' => 4, 'weight' => 5, 'created_at' => 6, 'updated_at' => 7, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
);
/**
@@ -159,15 +154,14 @@ class StockTableMap extends TableMap
public function initialize()
{
// attributes
$this->setName('stock');
$this->setPhpName('Stock');
$this->setClassName('\\Thelia\\Model\\Stock');
$this->setName('product_sale_elements');
$this->setPhpName('ProductSaleElements');
$this->setClassName('\\Thelia\\Model\\ProductSaleElements');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('PRODUCT_ID', 'ProductId', 'INTEGER', 'product', 'ID', true, null, null);
$this->addColumn('INCREASE', 'Increase', 'FLOAT', false, null, null);
$this->addColumn('QUANTITY', 'Quantity', 'FLOAT', true, null, null);
$this->addColumn('PROMO', 'Promo', 'TINYINT', false, null, 0);
$this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
@@ -182,9 +176,9 @@ class StockTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'stock_id', ), null, null, 'AttributeCombinations');
$this->addRelation('CartItem', '\\Thelia\\Model\\CartItem', RelationMap::ONE_TO_MANY, array('id' => 'stock_id', ), null, null, 'CartItems');
$this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'stock_id', ), null, null, 'ProductPrices');
$this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'AttributeCombinations');
$this->addRelation('CartItem', '\\Thelia\\Model\\CartItem', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'CartItems');
$this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'ProductPrices');
} // buildRelations()
/**
@@ -256,7 +250,7 @@ class StockTableMap extends TableMap
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? StockTableMap::CLASS_DEFAULT : StockTableMap::OM_CLASS;
return $withPrefix ? ProductSaleElementsTableMap::CLASS_DEFAULT : ProductSaleElementsTableMap::OM_CLASS;
}
/**
@@ -270,21 +264,21 @@ class StockTableMap extends TableMap
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (Stock object, last column rank)
* @return array (ProductSaleElements object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = StockTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = StockTableMap::getInstanceFromPool($key))) {
$key = ProductSaleElementsTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = ProductSaleElementsTableMap::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 + StockTableMap::NUM_HYDRATE_COLUMNS;
$col = $offset + ProductSaleElementsTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = StockTableMap::OM_CLASS;
$cls = ProductSaleElementsTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
StockTableMap::addInstanceToPool($obj, $key);
ProductSaleElementsTableMap::addInstanceToPool($obj, $key);
}
return array($obj, $col);
@@ -307,8 +301,8 @@ class StockTableMap extends TableMap
$cls = static::getOMClass(false);
// populate the object(s)
while ($row = $dataFetcher->fetch()) {
$key = StockTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = StockTableMap::getInstanceFromPool($key))) {
$key = ProductSaleElementsTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = ProductSaleElementsTableMap::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
@@ -317,7 +311,7 @@ class StockTableMap extends TableMap
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
StockTableMap::addInstanceToPool($obj, $key);
ProductSaleElementsTableMap::addInstanceToPool($obj, $key);
} // if key exists
}
@@ -338,19 +332,17 @@ class StockTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(StockTableMap::ID);
$criteria->addSelectColumn(StockTableMap::PRODUCT_ID);
$criteria->addSelectColumn(StockTableMap::INCREASE);
$criteria->addSelectColumn(StockTableMap::QUANTITY);
$criteria->addSelectColumn(StockTableMap::PROMO);
$criteria->addSelectColumn(StockTableMap::NEWNESS);
$criteria->addSelectColumn(StockTableMap::WEIGHT);
$criteria->addSelectColumn(StockTableMap::CREATED_AT);
$criteria->addSelectColumn(StockTableMap::UPDATED_AT);
$criteria->addSelectColumn(ProductSaleElementsTableMap::ID);
$criteria->addSelectColumn(ProductSaleElementsTableMap::PRODUCT_ID);
$criteria->addSelectColumn(ProductSaleElementsTableMap::QUANTITY);
$criteria->addSelectColumn(ProductSaleElementsTableMap::PROMO);
$criteria->addSelectColumn(ProductSaleElementsTableMap::NEWNESS);
$criteria->addSelectColumn(ProductSaleElementsTableMap::WEIGHT);
$criteria->addSelectColumn(ProductSaleElementsTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductSaleElementsTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
$criteria->addSelectColumn($alias . '.INCREASE');
$criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.PROMO');
$criteria->addSelectColumn($alias . '.NEWNESS');
@@ -369,7 +361,7 @@ class StockTableMap extends TableMap
*/
public static function getTableMap()
{
return Propel::getServiceContainer()->getDatabaseMap(StockTableMap::DATABASE_NAME)->getTable(StockTableMap::TABLE_NAME);
return Propel::getServiceContainer()->getDatabaseMap(ProductSaleElementsTableMap::DATABASE_NAME)->getTable(ProductSaleElementsTableMap::TABLE_NAME);
}
/**
@@ -377,16 +369,16 @@ class StockTableMap extends TableMap
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(StockTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(StockTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new StockTableMap());
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProductSaleElementsTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(ProductSaleElementsTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new ProductSaleElementsTableMap());
}
}
/**
* Performs a DELETE on the database, given a Stock or Criteria object OR a primary key value.
* Performs a DELETE on the database, given a ProductSaleElements or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or Stock object or primary key or array of primary keys
* @param mixed $values Criteria or ProductSaleElements 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
@@ -397,25 +389,25 @@ class StockTableMap extends TableMap
public static function doDelete($values, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\Stock) { // it's a model object
} elseif ($values instanceof \Thelia\Model\ProductSaleElements) { // 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(StockTableMap::DATABASE_NAME);
$criteria->add(StockTableMap::ID, (array) $values, Criteria::IN);
$criteria = new Criteria(ProductSaleElementsTableMap::DATABASE_NAME);
$criteria->add(ProductSaleElementsTableMap::ID, (array) $values, Criteria::IN);
}
$query = StockQuery::create()->mergeWith($criteria);
$query = ProductSaleElementsQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { StockTableMap::clearInstancePool();
if ($values instanceof Criteria) { ProductSaleElementsTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { StockTableMap::removeInstanceFromPool($singleval);
foreach ((array) $values as $singleval) { ProductSaleElementsTableMap::removeInstanceFromPool($singleval);
}
}
@@ -423,20 +415,20 @@ class StockTableMap extends TableMap
}
/**
* Deletes all rows from the stock table.
* Deletes all rows from the product_sale_elements 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 StockQuery::create()->doDeleteAll($con);
return ProductSaleElementsQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a Stock or Criteria object.
* Performs an INSERT on the database, given a ProductSaleElements or Criteria object.
*
* @param mixed $criteria Criteria or Stock object containing data that is used to create the INSERT statement.
* @param mixed $criteria Criteria or ProductSaleElements 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
@@ -445,22 +437,22 @@ class StockTableMap extends TableMap
public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(StockTableMap::DATABASE_NAME);
$con = Propel::getServiceContainer()->getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from Stock object
$criteria = $criteria->buildCriteria(); // build Criteria from ProductSaleElements object
}
if ($criteria->containsKey(StockTableMap::ID) && $criteria->keyContainsValue(StockTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.StockTableMap::ID.')');
if ($criteria->containsKey(ProductSaleElementsTableMap::ID) && $criteria->keyContainsValue(ProductSaleElementsTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProductSaleElementsTableMap::ID.')');
}
// Set the correct dbName
$query = StockQuery::create()->mergeWith($criteria);
$query = ProductSaleElementsQuery::create()->mergeWith($criteria);
try {
// use transaction because $criteria could contain info
@@ -476,7 +468,7 @@ class StockTableMap extends TableMap
return $pk;
}
} // StockTableMap
} // ProductSaleElementsTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
StockTableMap::buildTableMap();
ProductSaleElementsTableMap::buildTableMap();

4
core/lib/Thelia/Model/Map/ProductTableMap.php Executable file → Normal file
View File

@@ -199,7 +199,7 @@ class ProductTableMap extends TableMap
$this->addRelation('TaxRule', '\\Thelia\\Model\\TaxRule', RelationMap::MANY_TO_ONE, array('tax_rule_id' => 'id', ), 'SET NULL', 'RESTRICT');
$this->addRelation('ProductCategory', '\\Thelia\\Model\\ProductCategory', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductCategories');
$this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Stocks');
$this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductSaleElementss');
$this->addRelation('ContentAssoc', '\\Thelia\\Model\\ContentAssoc', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ContentAssocs');
$this->addRelation('Image', '\\Thelia\\Model\\Image', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Images');
$this->addRelation('Document', '\\Thelia\\Model\\Document', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'Documents');
@@ -237,7 +237,7 @@ class ProductTableMap extends TableMap
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
ProductCategoryTableMap::clearInstancePool();
FeatureProductTableMap::clearInstancePool();
StockTableMap::clearInstancePool();
ProductSaleElementsTableMap::clearInstancePool();
ContentAssocTableMap::clearInstancePool();
ImageTableMap::clearInstancePool();
DocumentTableMap::clearInstancePool();

0
core/lib/Thelia/Model/Map/ProductVersionTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ResourceI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/ResourceTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/RewritingTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/TaxI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/TaxRuleCountryTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/TaxRuleI18nTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/TaxRuleTableMap.php Executable file → Normal file
View File

0
core/lib/Thelia/Model/Map/TaxTableMap.php Executable file → Normal file
View File