update thelia model

This commit is contained in:
Manuel Raynaud
2013-07-29 14:08:09 +02:00
parent dc73e34f0f
commit b0622c1fae
30 changed files with 5477 additions and 2508 deletions

View File

@@ -57,7 +57,7 @@ class AttributeCombinationTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 6;
const NUM_COLUMNS = 5;
/**
* The number of lazy-loaded columns
@@ -67,28 +67,23 @@ class AttributeCombinationTableMap extends TableMap
/**
* 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 = 'attribute_combination.ID';
const NUM_HYDRATE_COLUMNS = 5;
/**
* the column name for the ATTRIBUTE_ID field
*/
const ATTRIBUTE_ID = 'attribute_combination.ATTRIBUTE_ID';
/**
* the column name for the COMBINATION_ID field
*/
const COMBINATION_ID = 'attribute_combination.COMBINATION_ID';
/**
* the column name for the ATTRIBUTE_AV_ID field
*/
const ATTRIBUTE_AV_ID = 'attribute_combination.ATTRIBUTE_AV_ID';
/**
* the column name for the STOCK_ID field
*/
const STOCK_ID = 'attribute_combination.STOCK_ID';
/**
* the column name for the CREATED_AT field
*/
@@ -111,12 +106,12 @@ class AttributeCombinationTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'AttributeId', 'CombinationId', 'AttributeAvId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'attributeId', 'combinationId', 'attributeAvId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(AttributeCombinationTableMap::ID, AttributeCombinationTableMap::ATTRIBUTE_ID, AttributeCombinationTableMap::COMBINATION_ID, AttributeCombinationTableMap::ATTRIBUTE_AV_ID, AttributeCombinationTableMap::CREATED_AT, AttributeCombinationTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'ATTRIBUTE_ID', 'COMBINATION_ID', 'ATTRIBUTE_AV_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'attribute_id', 'combination_id', 'attribute_av_id', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
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_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -126,12 +121,12 @@ class AttributeCombinationTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'AttributeId' => 1, 'CombinationId' => 2, 'AttributeAvId' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'attributeId' => 1, 'combinationId' => 2, 'attributeAvId' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
self::TYPE_COLNAME => array(AttributeCombinationTableMap::ID => 0, AttributeCombinationTableMap::ATTRIBUTE_ID => 1, AttributeCombinationTableMap::COMBINATION_ID => 2, AttributeCombinationTableMap::ATTRIBUTE_AV_ID => 3, AttributeCombinationTableMap::CREATED_AT => 4, AttributeCombinationTableMap::UPDATED_AT => 5, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'ATTRIBUTE_ID' => 1, 'COMBINATION_ID' => 2, 'ATTRIBUTE_AV_ID' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
self::TYPE_FIELDNAME => array('id' => 0, 'attribute_id' => 1, 'combination_id' => 2, 'attribute_av_id' => 3, 'created_at' => 4, 'updated_at' => 5, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, )
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_NUM => array(0, 1, 2, 3, 4, )
);
/**
@@ -148,12 +143,11 @@ class AttributeCombinationTableMap extends TableMap
$this->setPhpName('AttributeCombination');
$this->setClassName('\\Thelia\\Model\\AttributeCombination');
$this->setPackage('Thelia.Model');
$this->setUseIdGenerator(true);
$this->setUseIdGenerator(false);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignPrimaryKey('ATTRIBUTE_ID', 'AttributeId', 'INTEGER' , 'attribute', 'ID', true, null, null);
$this->addForeignPrimaryKey('COMBINATION_ID', 'CombinationId', 'INTEGER' , 'combination', '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->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -165,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('Combination', '\\Thelia\\Model\\Combination', RelationMap::MANY_TO_ONE, array('combination_id' => 'id', ), 'CASCADE', 'RESTRICT');
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::MANY_TO_ONE, array('stock_id' => 'id', ), null, null);
} // buildRelations()
/**
@@ -196,7 +190,7 @@ class AttributeCombinationTableMap extends TableMap
{
if (Propel::isInstancePoolingEnabled()) {
if (null === $key) {
$key = serialize(array((string) $obj->getId(), (string) $obj->getAttributeId(), (string) $obj->getCombinationId(), (string) $obj->getAttributeAvId()));
$key = serialize(array((string) $obj->getAttributeId(), (string) $obj->getAttributeAvId(), (string) $obj->getStockId()));
} // if key === null
self::$instances[$key] = $obj;
}
@@ -216,11 +210,11 @@ class AttributeCombinationTableMap extends TableMap
{
if (Propel::isInstancePoolingEnabled() && null !== $value) {
if (is_object($value) && $value instanceof \Thelia\Model\AttributeCombination) {
$key = serialize(array((string) $value->getId(), (string) $value->getAttributeId(), (string) $value->getCombinationId(), (string) $value->getAttributeAvId()));
$key = serialize(array((string) $value->getAttributeId(), (string) $value->getAttributeAvId(), (string) $value->getStockId()));
} elseif (is_array($value) && count($value) === 4) {
} elseif (is_array($value) && count($value) === 3) {
// assume we've been passed a primary key";
$key = serialize(array((string) $value[0], (string) $value[1], (string) $value[2], (string) $value[3]));
$key = serialize(array((string) $value[0], (string) $value[1], (string) $value[2]));
} elseif ($value instanceof Criteria) {
self::$instances = [];
@@ -248,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('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('AttributeId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 3 + $offset : static::translateFieldName('AttributeAvId', 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('StockId', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
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('AttributeId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 2 + $offset : static::translateFieldName('CombinationId', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 3 + $offset : static::translateFieldName('AttributeAvId', 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('StockId', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -368,17 +362,15 @@ class AttributeCombinationTableMap extends TableMap
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(AttributeCombinationTableMap::ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::ATTRIBUTE_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::COMBINATION_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::ATTRIBUTE_AV_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::STOCK_ID);
$criteria->addSelectColumn(AttributeCombinationTableMap::CREATED_AT);
$criteria->addSelectColumn(AttributeCombinationTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.ATTRIBUTE_ID');
$criteria->addSelectColumn($alias . '.COMBINATION_ID');
$criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_ID');
$criteria->addSelectColumn($alias . '.STOCK_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
@@ -439,10 +431,9 @@ class AttributeCombinationTableMap extends TableMap
$values = array($values);
}
foreach ($values as $value) {
$criterion = $criteria->getNewCriterion(AttributeCombinationTableMap::ID, $value[0]);
$criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_ID, $value[1]));
$criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::COMBINATION_ID, $value[2]));
$criterion->addAnd($criteria->getNewCriterion(AttributeCombinationTableMap::ATTRIBUTE_AV_ID, $value[3]));
$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]));
$criteria->addOr($criterion);
}
}
@@ -490,10 +481,6 @@ class AttributeCombinationTableMap extends TableMap
$criteria = $criteria->buildCriteria(); // build Criteria from AttributeCombination object
}
if ($criteria->containsKey(AttributeCombinationTableMap::ID) && $criteria->keyContainsValue(AttributeCombinationTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.AttributeCombinationTableMap::ID.')');
}
// Set the correct dbName
$query = AttributeCombinationQuery::create()->mergeWith($criteria);

View File

@@ -90,9 +90,9 @@ class CartItemTableMap extends TableMap
const QUANTITY = 'cart_item.QUANTITY';
/**
* the column name for the COMBINATION_ID field
* the column name for the STOCK_ID field
*/
const COMBINATION_ID = 'cart_item.COMBINATION_ID';
const STOCK_ID = 'cart_item.STOCK_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', 'CombinationId', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'cartId', 'productId', 'quantity', 'combinationId', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(CartItemTableMap::ID, CartItemTableMap::CART_ID, CartItemTableMap::PRODUCT_ID, CartItemTableMap::QUANTITY, CartItemTableMap::COMBINATION_ID, CartItemTableMap::CREATED_AT, CartItemTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'CART_ID', 'PRODUCT_ID', 'QUANTITY', 'COMBINATION_ID', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'cart_id', 'product_id', 'quantity', 'combination_id', 'created_at', 'updated_at', ),
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_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, 'CombinationId' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'cartId' => 1, 'productId' => 2, 'quantity' => 3, 'combinationId' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(CartItemTableMap::ID => 0, CartItemTableMap::CART_ID => 1, CartItemTableMap::PRODUCT_ID => 2, CartItemTableMap::QUANTITY => 3, CartItemTableMap::COMBINATION_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, 'COMBINATION_ID' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'cart_id' => 1, 'product_id' => 2, 'quantity' => 3, 'combination_id' => 4, 'created_at' => 5, 'updated_at' => 6, ),
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_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('COMBINATION_ID', 'CombinationId', 'INTEGER', 'combination', 'ID', false, null, null);
$this->addForeignKey('STOCK_ID', 'StockId', 'INTEGER', 'stock', '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('Combination', '\\Thelia\\Model\\Combination', RelationMap::MANY_TO_ONE, array('combination_id' => 'id', ), null, null);
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::MANY_TO_ONE, array('stock_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::COMBINATION_ID);
$criteria->addSelectColumn(CartItemTableMap::STOCK_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 . '.COMBINATION_ID');
$criteria->addSelectColumn($alias . '.STOCK_ID');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}

View File

@@ -213,9 +213,9 @@ class CategoryTableMap extends TableMap
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description, chapo, postscriptum', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ),
'versionable' => array('version_column' => 'version', 'version_table' => '', 'log_created_at' => 'true', 'log_created_by' => 'true', 'log_comment' => 'false', 'version_created_at_column' => 'version_created_at', 'version_created_by_column' => 'version_created_by', 'version_comment_column' => 'version_comment', ),
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**

View File

@@ -177,6 +177,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');
} // buildRelations()
/**

View File

@@ -0,0 +1,464 @@
<?php
namespace Thelia\Model\Map;
use Propel\Runtime\Propel;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Exception\PropelException;
use Propel\Runtime\Map\RelationMap;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Map\TableMapTrait;
use Thelia\Model\ProductPrice;
use Thelia\Model\ProductPriceQuery;
/**
* This class defines the structure of the 'product_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 ProductPriceTableMap extends TableMap
{
use InstancePoolTrait;
use TableMapTrait;
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'Thelia.Model.Map.ProductPriceTableMap';
/**
* The default database name for this class
*/
const DATABASE_NAME = 'thelia';
/**
* The table name for this class
*/
const TABLE_NAME = 'product_price';
/**
* The related Propel class for this table
*/
const OM_CLASS = '\\Thelia\\Model\\ProductPrice';
/**
* A class that can be returned by this tableMap
*/
const CLASS_DEFAULT = 'Thelia.Model.ProductPrice';
/**
* 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 = 'product_price.ID';
/**
* the column name for the STOCK_ID field
*/
const STOCK_ID = 'product_price.STOCK_ID';
/**
* the column name for the CURRENCY_ID field
*/
const CURRENCY_ID = 'product_price.CURRENCY_ID';
/**
* the column name for the PRICE field
*/
const PRICE = 'product_price.PRICE';
/**
* the column name for the PROMO_PRICE field
*/
const PROMO_PRICE = 'product_price.PROMO_PRICE';
/**
* the column name for the CREATED_AT field
*/
const CREATED_AT = 'product_price.CREATED_AT';
/**
* the column name for the UPDATED_AT field
*/
const UPDATED_AT = 'product_price.UPDATED_AT';
/**
* 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', '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_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, '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_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('product_price');
$this->setPhpName('ProductPrice');
$this->setClassName('\\Thelia\\Model\\ProductPrice');
$this->setPackage('Thelia.Model');
$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('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);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('Stock', '\\Thelia\\Model\\Stock', RelationMap::MANY_TO_ONE, array('stock_id' => 'id', ), null, null);
$this->addRelation('Currency', '\\Thelia\\Model\\Currency', RelationMap::MANY_TO_ONE, array('currency_id' => 'id', ), null, null);
} // buildRelations()
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),
);
} // getBehaviors()
/**
* 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 ? ProductPriceTableMap::CLASS_DEFAULT : ProductPriceTableMap::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 (ProductPrice object, last column rank)
*/
public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
{
$key = ProductPriceTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
if (null !== ($obj = ProductPriceTableMap::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 + ProductPriceTableMap::NUM_HYDRATE_COLUMNS;
} else {
$cls = ProductPriceTableMap::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $offset, false, $indexType);
ProductPriceTableMap::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 = ProductPriceTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
if (null !== ($obj = ProductPriceTableMap::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;
ProductPriceTableMap::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(ProductPriceTableMap::ID);
$criteria->addSelectColumn(ProductPriceTableMap::STOCK_ID);
$criteria->addSelectColumn(ProductPriceTableMap::CURRENCY_ID);
$criteria->addSelectColumn(ProductPriceTableMap::PRICE);
$criteria->addSelectColumn(ProductPriceTableMap::PROMO_PRICE);
$criteria->addSelectColumn(ProductPriceTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductPriceTableMap::UPDATED_AT);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STOCK_ID');
$criteria->addSelectColumn($alias . '.CURRENCY_ID');
$criteria->addSelectColumn($alias . '.PRICE');
$criteria->addSelectColumn($alias . '.PROMO_PRICE');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}
}
/**
* 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(ProductPriceTableMap::DATABASE_NAME)->getTable(ProductPriceTableMap::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this tableMap class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getServiceContainer()->getDatabaseMap(ProductPriceTableMap::DATABASE_NAME);
if (!$dbMap->hasTable(ProductPriceTableMap::TABLE_NAME)) {
$dbMap->addTableObject(new ProductPriceTableMap());
}
}
/**
* Performs a DELETE on the database, given a ProductPrice or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or ProductPrice 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(ProductPriceTableMap::DATABASE_NAME);
}
if ($values instanceof Criteria) {
// rename for clarity
$criteria = $values;
} elseif ($values instanceof \Thelia\Model\ProductPrice) { // 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(ProductPriceTableMap::DATABASE_NAME);
$criteria->add(ProductPriceTableMap::ID, (array) $values, Criteria::IN);
}
$query = ProductPriceQuery::create()->mergeWith($criteria);
if ($values instanceof Criteria) { ProductPriceTableMap::clearInstancePool();
} elseif (!is_object($values)) { // it's a primary key, or an array of pks
foreach ((array) $values as $singleval) { ProductPriceTableMap::removeInstanceFromPool($singleval);
}
}
return $query->delete($con);
}
/**
* Deletes all rows from the product_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 ProductPriceQuery::create()->doDeleteAll($con);
}
/**
* Performs an INSERT on the database, given a ProductPrice or Criteria object.
*
* @param mixed $criteria Criteria or ProductPrice 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(ProductPriceTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // rename for clarity
} else {
$criteria = $criteria->buildCriteria(); // build Criteria from ProductPrice object
}
if ($criteria->containsKey(ProductPriceTableMap::ID) && $criteria->keyContainsValue(ProductPriceTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ProductPriceTableMap::ID.')');
}
// Set the correct dbName
$query = ProductPriceQuery::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;
}
} // ProductPriceTableMap
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
ProductPriceTableMap::buildTableMap();

View File

@@ -57,7 +57,7 @@ class ProductTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 17;
const NUM_COLUMNS = 10;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ProductTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 17;
const NUM_HYDRATE_COLUMNS = 10;
/**
* the column name for the ID field
@@ -84,46 +84,11 @@ class ProductTableMap extends TableMap
*/
const REF = 'product.REF';
/**
* the column name for the PRICE field
*/
const PRICE = 'product.PRICE';
/**
* the column name for the PRICE2 field
*/
const PRICE2 = 'product.PRICE2';
/**
* the column name for the ECOTAX field
*/
const ECOTAX = 'product.ECOTAX';
/**
* the column name for the NEWNESS field
*/
const NEWNESS = 'product.NEWNESS';
/**
* the column name for the PROMO field
*/
const PROMO = 'product.PROMO';
/**
* the column name for the QUANTITY field
*/
const QUANTITY = 'product.QUANTITY';
/**
* the column name for the VISIBLE field
*/
const VISIBLE = 'product.VISIBLE';
/**
* the column name for the WEIGHT field
*/
const WEIGHT = 'product.WEIGHT';
/**
* the column name for the POSITION field
*/
@@ -175,12 +140,12 @@ class ProductTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Price', 'Price2', 'Ecotax', 'Newness', 'Promo', 'Quantity', 'Visible', 'Weight', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
self::TYPE_COLNAME => array(ProductTableMap::ID, ProductTableMap::TAX_RULE_ID, ProductTableMap::REF, ProductTableMap::PRICE, ProductTableMap::PRICE2, ProductTableMap::ECOTAX, ProductTableMap::NEWNESS, ProductTableMap::PROMO, ProductTableMap::QUANTITY, ProductTableMap::VISIBLE, ProductTableMap::WEIGHT, ProductTableMap::POSITION, ProductTableMap::CREATED_AT, ProductTableMap::UPDATED_AT, ProductTableMap::VERSION, ProductTableMap::VERSION_CREATED_AT, ProductTableMap::VERSION_CREATED_BY, ),
self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'PRICE', 'PRICE2', 'ECOTAX', 'NEWNESS', 'PROMO', 'QUANTITY', 'VISIBLE', 'WEIGHT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Visible', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'visible', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
self::TYPE_COLNAME => array(ProductTableMap::ID, ProductTableMap::TAX_RULE_ID, ProductTableMap::REF, ProductTableMap::VISIBLE, ProductTableMap::POSITION, ProductTableMap::CREATED_AT, ProductTableMap::UPDATED_AT, ProductTableMap::VERSION, ProductTableMap::VERSION_CREATED_AT, ProductTableMap::VERSION_CREATED_BY, ),
self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'VISIBLE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'visible', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -190,12 +155,12 @@ class ProductTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Price' => 3, 'Price2' => 4, 'Ecotax' => 5, 'Newness' => 6, 'Promo' => 7, 'Quantity' => 8, 'Visible' => 9, 'Weight' => 10, 'Position' => 11, 'CreatedAt' => 12, 'UpdatedAt' => 13, 'Version' => 14, 'VersionCreatedAt' => 15, 'VersionCreatedBy' => 16, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'createdAt' => 12, 'updatedAt' => 13, 'version' => 14, 'versionCreatedAt' => 15, 'versionCreatedBy' => 16, ),
self::TYPE_COLNAME => array(ProductTableMap::ID => 0, ProductTableMap::TAX_RULE_ID => 1, ProductTableMap::REF => 2, ProductTableMap::PRICE => 3, ProductTableMap::PRICE2 => 4, ProductTableMap::ECOTAX => 5, ProductTableMap::NEWNESS => 6, ProductTableMap::PROMO => 7, ProductTableMap::QUANTITY => 8, ProductTableMap::VISIBLE => 9, ProductTableMap::WEIGHT => 10, ProductTableMap::POSITION => 11, ProductTableMap::CREATED_AT => 12, ProductTableMap::UPDATED_AT => 13, ProductTableMap::VERSION => 14, ProductTableMap::VERSION_CREATED_AT => 15, ProductTableMap::VERSION_CREATED_BY => 16, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'PRICE' => 3, 'PRICE2' => 4, 'ECOTAX' => 5, 'NEWNESS' => 6, 'PROMO' => 7, 'QUANTITY' => 8, 'VISIBLE' => 9, 'WEIGHT' => 10, 'POSITION' => 11, 'CREATED_AT' => 12, 'UPDATED_AT' => 13, 'VERSION' => 14, 'VERSION_CREATED_AT' => 15, 'VERSION_CREATED_BY' => 16, ),
self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'created_at' => 12, 'updated_at' => 13, 'version' => 14, 'version_created_at' => 15, 'version_created_by' => 16, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Visible' => 3, 'Position' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, 'Version' => 7, 'VersionCreatedAt' => 8, 'VersionCreatedBy' => 9, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'createdAt' => 5, 'updatedAt' => 6, 'version' => 7, 'versionCreatedAt' => 8, 'versionCreatedBy' => 9, ),
self::TYPE_COLNAME => array(ProductTableMap::ID => 0, ProductTableMap::TAX_RULE_ID => 1, ProductTableMap::REF => 2, ProductTableMap::VISIBLE => 3, ProductTableMap::POSITION => 4, ProductTableMap::CREATED_AT => 5, ProductTableMap::UPDATED_AT => 6, ProductTableMap::VERSION => 7, ProductTableMap::VERSION_CREATED_AT => 8, ProductTableMap::VERSION_CREATED_BY => 9, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'VISIBLE' => 3, 'POSITION' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, 'VERSION' => 7, 'VERSION_CREATED_AT' => 8, 'VERSION_CREATED_BY' => 9, ),
self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'created_at' => 5, 'updated_at' => 6, 'version' => 7, 'version_created_at' => 8, 'version_created_by' => 9, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -217,14 +182,7 @@ class ProductTableMap extends TableMap
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('TAX_RULE_ID', 'TaxRuleId', 'INTEGER', 'tax_rule', 'ID', false, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null);
$this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
$this->addColumn('PRICE2', 'Price2', 'FLOAT', false, null, null);
$this->addColumn('ECOTAX', 'Ecotax', 'FLOAT', false, null, null);
$this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
$this->addColumn('PROMO', 'Promo', 'TINYINT', false, null, 0);
$this->addColumn('QUANTITY', 'Quantity', 'INTEGER', false, null, 0);
$this->addColumn('VISIBLE', 'Visible', 'TINYINT', true, null, 0);
$this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, null);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
@@ -430,14 +388,7 @@ class ProductTableMap extends TableMap
$criteria->addSelectColumn(ProductTableMap::ID);
$criteria->addSelectColumn(ProductTableMap::TAX_RULE_ID);
$criteria->addSelectColumn(ProductTableMap::REF);
$criteria->addSelectColumn(ProductTableMap::PRICE);
$criteria->addSelectColumn(ProductTableMap::PRICE2);
$criteria->addSelectColumn(ProductTableMap::ECOTAX);
$criteria->addSelectColumn(ProductTableMap::NEWNESS);
$criteria->addSelectColumn(ProductTableMap::PROMO);
$criteria->addSelectColumn(ProductTableMap::QUANTITY);
$criteria->addSelectColumn(ProductTableMap::VISIBLE);
$criteria->addSelectColumn(ProductTableMap::WEIGHT);
$criteria->addSelectColumn(ProductTableMap::POSITION);
$criteria->addSelectColumn(ProductTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductTableMap::UPDATED_AT);
@@ -448,14 +399,7 @@ class ProductTableMap extends TableMap
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.TAX_RULE_ID');
$criteria->addSelectColumn($alias . '.REF');
$criteria->addSelectColumn($alias . '.PRICE');
$criteria->addSelectColumn($alias . '.PRICE2');
$criteria->addSelectColumn($alias . '.ECOTAX');
$criteria->addSelectColumn($alias . '.NEWNESS');
$criteria->addSelectColumn($alias . '.PROMO');
$criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.VISIBLE');
$criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');

View File

@@ -57,7 +57,7 @@ class ProductVersionTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 17;
const NUM_COLUMNS = 10;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class ProductVersionTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 17;
const NUM_HYDRATE_COLUMNS = 10;
/**
* the column name for the ID field
@@ -84,46 +84,11 @@ class ProductVersionTableMap extends TableMap
*/
const REF = 'product_version.REF';
/**
* the column name for the PRICE field
*/
const PRICE = 'product_version.PRICE';
/**
* the column name for the PRICE2 field
*/
const PRICE2 = 'product_version.PRICE2';
/**
* the column name for the ECOTAX field
*/
const ECOTAX = 'product_version.ECOTAX';
/**
* the column name for the NEWNESS field
*/
const NEWNESS = 'product_version.NEWNESS';
/**
* the column name for the PROMO field
*/
const PROMO = 'product_version.PROMO';
/**
* the column name for the QUANTITY field
*/
const QUANTITY = 'product_version.QUANTITY';
/**
* the column name for the VISIBLE field
*/
const VISIBLE = 'product_version.VISIBLE';
/**
* the column name for the WEIGHT field
*/
const WEIGHT = 'product_version.WEIGHT';
/**
* the column name for the POSITION field
*/
@@ -166,12 +131,12 @@ class ProductVersionTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Price', 'Price2', 'Ecotax', 'Newness', 'Promo', 'Quantity', 'Visible', 'Weight', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
self::TYPE_COLNAME => array(ProductVersionTableMap::ID, ProductVersionTableMap::TAX_RULE_ID, ProductVersionTableMap::REF, ProductVersionTableMap::PRICE, ProductVersionTableMap::PRICE2, ProductVersionTableMap::ECOTAX, ProductVersionTableMap::NEWNESS, ProductVersionTableMap::PROMO, ProductVersionTableMap::QUANTITY, ProductVersionTableMap::VISIBLE, ProductVersionTableMap::WEIGHT, ProductVersionTableMap::POSITION, ProductVersionTableMap::CREATED_AT, ProductVersionTableMap::UPDATED_AT, ProductVersionTableMap::VERSION, ProductVersionTableMap::VERSION_CREATED_AT, ProductVersionTableMap::VERSION_CREATED_BY, ),
self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'PRICE', 'PRICE2', 'ECOTAX', 'NEWNESS', 'PROMO', 'QUANTITY', 'VISIBLE', 'WEIGHT', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'price', 'price2', 'ecotax', 'newness', 'promo', 'quantity', 'visible', 'weight', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
self::TYPE_PHPNAME => array('Id', 'TaxRuleId', 'Ref', 'Visible', 'Position', 'CreatedAt', 'UpdatedAt', 'Version', 'VersionCreatedAt', 'VersionCreatedBy', ),
self::TYPE_STUDLYPHPNAME => array('id', 'taxRuleId', 'ref', 'visible', 'position', 'createdAt', 'updatedAt', 'version', 'versionCreatedAt', 'versionCreatedBy', ),
self::TYPE_COLNAME => array(ProductVersionTableMap::ID, ProductVersionTableMap::TAX_RULE_ID, ProductVersionTableMap::REF, ProductVersionTableMap::VISIBLE, ProductVersionTableMap::POSITION, ProductVersionTableMap::CREATED_AT, ProductVersionTableMap::UPDATED_AT, ProductVersionTableMap::VERSION, ProductVersionTableMap::VERSION_CREATED_AT, ProductVersionTableMap::VERSION_CREATED_BY, ),
self::TYPE_RAW_COLNAME => array('ID', 'TAX_RULE_ID', 'REF', 'VISIBLE', 'POSITION', 'CREATED_AT', 'UPDATED_AT', 'VERSION', 'VERSION_CREATED_AT', 'VERSION_CREATED_BY', ),
self::TYPE_FIELDNAME => array('id', 'tax_rule_id', 'ref', 'visible', 'position', 'created_at', 'updated_at', 'version', 'version_created_at', 'version_created_by', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -181,12 +146,12 @@ class ProductVersionTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Price' => 3, 'Price2' => 4, 'Ecotax' => 5, 'Newness' => 6, 'Promo' => 7, 'Quantity' => 8, 'Visible' => 9, 'Weight' => 10, 'Position' => 11, 'CreatedAt' => 12, 'UpdatedAt' => 13, 'Version' => 14, 'VersionCreatedAt' => 15, 'VersionCreatedBy' => 16, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'createdAt' => 12, 'updatedAt' => 13, 'version' => 14, 'versionCreatedAt' => 15, 'versionCreatedBy' => 16, ),
self::TYPE_COLNAME => array(ProductVersionTableMap::ID => 0, ProductVersionTableMap::TAX_RULE_ID => 1, ProductVersionTableMap::REF => 2, ProductVersionTableMap::PRICE => 3, ProductVersionTableMap::PRICE2 => 4, ProductVersionTableMap::ECOTAX => 5, ProductVersionTableMap::NEWNESS => 6, ProductVersionTableMap::PROMO => 7, ProductVersionTableMap::QUANTITY => 8, ProductVersionTableMap::VISIBLE => 9, ProductVersionTableMap::WEIGHT => 10, ProductVersionTableMap::POSITION => 11, ProductVersionTableMap::CREATED_AT => 12, ProductVersionTableMap::UPDATED_AT => 13, ProductVersionTableMap::VERSION => 14, ProductVersionTableMap::VERSION_CREATED_AT => 15, ProductVersionTableMap::VERSION_CREATED_BY => 16, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'PRICE' => 3, 'PRICE2' => 4, 'ECOTAX' => 5, 'NEWNESS' => 6, 'PROMO' => 7, 'QUANTITY' => 8, 'VISIBLE' => 9, 'WEIGHT' => 10, 'POSITION' => 11, 'CREATED_AT' => 12, 'UPDATED_AT' => 13, 'VERSION' => 14, 'VERSION_CREATED_AT' => 15, 'VERSION_CREATED_BY' => 16, ),
self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'price' => 3, 'price2' => 4, 'ecotax' => 5, 'newness' => 6, 'promo' => 7, 'quantity' => 8, 'visible' => 9, 'weight' => 10, 'position' => 11, 'created_at' => 12, 'updated_at' => 13, 'version' => 14, 'version_created_at' => 15, 'version_created_by' => 16, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
self::TYPE_PHPNAME => array('Id' => 0, 'TaxRuleId' => 1, 'Ref' => 2, 'Visible' => 3, 'Position' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, 'Version' => 7, 'VersionCreatedAt' => 8, 'VersionCreatedBy' => 9, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'taxRuleId' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'createdAt' => 5, 'updatedAt' => 6, 'version' => 7, 'versionCreatedAt' => 8, 'versionCreatedBy' => 9, ),
self::TYPE_COLNAME => array(ProductVersionTableMap::ID => 0, ProductVersionTableMap::TAX_RULE_ID => 1, ProductVersionTableMap::REF => 2, ProductVersionTableMap::VISIBLE => 3, ProductVersionTableMap::POSITION => 4, ProductVersionTableMap::CREATED_AT => 5, ProductVersionTableMap::UPDATED_AT => 6, ProductVersionTableMap::VERSION => 7, ProductVersionTableMap::VERSION_CREATED_AT => 8, ProductVersionTableMap::VERSION_CREATED_BY => 9, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'TAX_RULE_ID' => 1, 'REF' => 2, 'VISIBLE' => 3, 'POSITION' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, 'VERSION' => 7, 'VERSION_CREATED_AT' => 8, 'VERSION_CREATED_BY' => 9, ),
self::TYPE_FIELDNAME => array('id' => 0, 'tax_rule_id' => 1, 'ref' => 2, 'visible' => 3, 'position' => 4, 'created_at' => 5, 'updated_at' => 6, 'version' => 7, 'version_created_at' => 8, 'version_created_by' => 9, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -208,14 +173,7 @@ class ProductVersionTableMap extends TableMap
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null);
$this->addColumn('TAX_RULE_ID', 'TaxRuleId', 'INTEGER', false, null, null);
$this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null);
$this->addColumn('PRICE', 'Price', 'FLOAT', true, null, null);
$this->addColumn('PRICE2', 'Price2', 'FLOAT', false, null, null);
$this->addColumn('ECOTAX', 'Ecotax', 'FLOAT', false, null, null);
$this->addColumn('NEWNESS', 'Newness', 'TINYINT', false, null, 0);
$this->addColumn('PROMO', 'Promo', 'TINYINT', false, null, 0);
$this->addColumn('QUANTITY', 'Quantity', 'INTEGER', false, null, 0);
$this->addColumn('VISIBLE', 'Visible', 'TINYINT', true, null, 0);
$this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, null);
$this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
@@ -299,11 +257,11 @@ class ProductVersionTableMap 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 && $row[TableMap::TYPE_NUM == $indexType ? 14 + $offset : static::translateFieldName('Version', 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 ? 7 + $offset : static::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)] === null) {
return null;
}
return serialize(array((string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], (string) $row[TableMap::TYPE_NUM == $indexType ? 14 + $offset : static::translateFieldName('Version', 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 ? 7 + $offset : static::translateFieldName('Version', TableMap::TYPE_PHPNAME, $indexType)]));
}
/**
@@ -422,14 +380,7 @@ class ProductVersionTableMap extends TableMap
$criteria->addSelectColumn(ProductVersionTableMap::ID);
$criteria->addSelectColumn(ProductVersionTableMap::TAX_RULE_ID);
$criteria->addSelectColumn(ProductVersionTableMap::REF);
$criteria->addSelectColumn(ProductVersionTableMap::PRICE);
$criteria->addSelectColumn(ProductVersionTableMap::PRICE2);
$criteria->addSelectColumn(ProductVersionTableMap::ECOTAX);
$criteria->addSelectColumn(ProductVersionTableMap::NEWNESS);
$criteria->addSelectColumn(ProductVersionTableMap::PROMO);
$criteria->addSelectColumn(ProductVersionTableMap::QUANTITY);
$criteria->addSelectColumn(ProductVersionTableMap::VISIBLE);
$criteria->addSelectColumn(ProductVersionTableMap::WEIGHT);
$criteria->addSelectColumn(ProductVersionTableMap::POSITION);
$criteria->addSelectColumn(ProductVersionTableMap::CREATED_AT);
$criteria->addSelectColumn(ProductVersionTableMap::UPDATED_AT);
@@ -440,14 +391,7 @@ class ProductVersionTableMap extends TableMap
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.TAX_RULE_ID');
$criteria->addSelectColumn($alias . '.REF');
$criteria->addSelectColumn($alias . '.PRICE');
$criteria->addSelectColumn($alias . '.PRICE2');
$criteria->addSelectColumn($alias . '.ECOTAX');
$criteria->addSelectColumn($alias . '.NEWNESS');
$criteria->addSelectColumn($alias . '.PROMO');
$criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.VISIBLE');
$criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');

View File

@@ -57,7 +57,7 @@ class StockTableMap extends TableMap
/**
* The total number of columns
*/
const NUM_COLUMNS = 7;
const NUM_COLUMNS = 10;
/**
* The number of lazy-loaded columns
@@ -67,7 +67,7 @@ class StockTableMap extends TableMap
/**
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
*/
const NUM_HYDRATE_COLUMNS = 7;
const NUM_HYDRATE_COLUMNS = 10;
/**
* the column name for the ID field
@@ -94,6 +94,21 @@ class StockTableMap extends TableMap
*/
const QUANTITY = 'stock.QUANTITY';
/**
* the column name for the PROMO field
*/
const PROMO = 'stock.PROMO';
/**
* the column name for the NEWNESS field
*/
const NEWNESS = 'stock.NEWNESS';
/**
* the column name for the WEIGHT field
*/
const WEIGHT = 'stock.WEIGHT';
/**
* the column name for the CREATED_AT field
*/
@@ -116,12 +131,12 @@ class StockTableMap extends TableMap
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
self::TYPE_PHPNAME => array('Id', 'CombinationId', 'ProductId', 'Increase', 'Quantity', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'combinationId', 'productId', 'increase', 'quantity', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(StockTableMap::ID, StockTableMap::COMBINATION_ID, StockTableMap::PRODUCT_ID, StockTableMap::INCREASE, StockTableMap::QUANTITY, StockTableMap::CREATED_AT, StockTableMap::UPDATED_AT, ),
self::TYPE_RAW_COLNAME => array('ID', 'COMBINATION_ID', 'PRODUCT_ID', 'INCREASE', 'QUANTITY', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'combination_id', 'product_id', 'increase', 'quantity', 'created_at', 'updated_at', ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
self::TYPE_PHPNAME => array('Id', 'CombinationId', 'ProductId', 'Increase', 'Quantity', 'Promo', 'Newness', 'Weight', 'CreatedAt', 'UpdatedAt', ),
self::TYPE_STUDLYPHPNAME => array('id', 'combinationId', 'productId', 'increase', 'quantity', 'promo', 'newness', 'weight', 'createdAt', 'updatedAt', ),
self::TYPE_COLNAME => array(StockTableMap::ID, StockTableMap::COMBINATION_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', 'COMBINATION_ID', 'PRODUCT_ID', 'INCREASE', 'QUANTITY', 'PROMO', 'NEWNESS', 'WEIGHT', 'CREATED_AT', 'UPDATED_AT', ),
self::TYPE_FIELDNAME => array('id', 'combination_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, 9, )
);
/**
@@ -131,12 +146,12 @@ class StockTableMap extends TableMap
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
self::TYPE_PHPNAME => array('Id' => 0, 'CombinationId' => 1, 'ProductId' => 2, 'Increase' => 3, 'Quantity' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'combinationId' => 1, 'productId' => 2, 'increase' => 3, 'quantity' => 4, 'createdAt' => 5, 'updatedAt' => 6, ),
self::TYPE_COLNAME => array(StockTableMap::ID => 0, StockTableMap::COMBINATION_ID => 1, StockTableMap::PRODUCT_ID => 2, StockTableMap::INCREASE => 3, StockTableMap::QUANTITY => 4, StockTableMap::CREATED_AT => 5, StockTableMap::UPDATED_AT => 6, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'COMBINATION_ID' => 1, 'PRODUCT_ID' => 2, 'INCREASE' => 3, 'QUANTITY' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ),
self::TYPE_FIELDNAME => array('id' => 0, 'combination_id' => 1, 'product_id' => 2, 'increase' => 3, 'quantity' => 4, 'created_at' => 5, 'updated_at' => 6, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, )
self::TYPE_PHPNAME => array('Id' => 0, 'CombinationId' => 1, 'ProductId' => 2, 'Increase' => 3, 'Quantity' => 4, 'Promo' => 5, 'Newness' => 6, 'Weight' => 7, 'CreatedAt' => 8, 'UpdatedAt' => 9, ),
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'combinationId' => 1, 'productId' => 2, 'increase' => 3, 'quantity' => 4, 'promo' => 5, 'newness' => 6, 'weight' => 7, 'createdAt' => 8, 'updatedAt' => 9, ),
self::TYPE_COLNAME => array(StockTableMap::ID => 0, StockTableMap::COMBINATION_ID => 1, StockTableMap::PRODUCT_ID => 2, StockTableMap::INCREASE => 3, StockTableMap::QUANTITY => 4, StockTableMap::PROMO => 5, StockTableMap::NEWNESS => 6, StockTableMap::WEIGHT => 7, StockTableMap::CREATED_AT => 8, StockTableMap::UPDATED_AT => 9, ),
self::TYPE_RAW_COLNAME => array('ID' => 0, 'COMBINATION_ID' => 1, 'PRODUCT_ID' => 2, 'INCREASE' => 3, 'QUANTITY' => 4, 'PROMO' => 5, 'NEWNESS' => 6, 'WEIGHT' => 7, 'CREATED_AT' => 8, 'UPDATED_AT' => 9, ),
self::TYPE_FIELDNAME => array('id' => 0, 'combination_id' => 1, 'product_id' => 2, 'increase' => 3, 'quantity' => 4, 'promo' => 5, 'newness' => 6, 'weight' => 7, 'created_at' => 8, 'updated_at' => 9, ),
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
);
/**
@@ -156,10 +171,13 @@ class StockTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
$this->addForeignKey('COMBINATION_ID', 'CombinationId', 'INTEGER', 'combination', 'ID', false, null, null);
$this->addColumn('COMBINATION_ID', 'CombinationId', 'INTEGER', false, 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);
$this->addColumn('WEIGHT', 'Weight', 'FLOAT', false, null, null);
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
} // initialize()
@@ -169,8 +187,10 @@ class StockTableMap extends TableMap
*/
public function buildRelations()
{
$this->addRelation('Combination', '\\Thelia\\Model\\Combination', RelationMap::MANY_TO_ONE, array('combination_id' => 'id', ), 'SET NULL', 'RESTRICT');
$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');
} // buildRelations()
/**
@@ -329,6 +349,9 @@ class StockTableMap extends TableMap
$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);
} else {
@@ -337,6 +360,9 @@ class StockTableMap extends TableMap
$criteria->addSelectColumn($alias . '.PRODUCT_ID');
$criteria->addSelectColumn($alias . '.INCREASE');
$criteria->addSelectColumn($alias . '.QUANTITY');
$criteria->addSelectColumn($alias . '.PROMO');
$criteria->addSelectColumn($alias . '.NEWNESS');
$criteria->addSelectColumn($alias . '.WEIGHT');
$criteria->addSelectColumn($alias . '.CREATED_AT');
$criteria->addSelectColumn($alias . '.UPDATED_AT');
}