new faker entries

new category view
This commit is contained in:
Etienne Roudeix
2013-08-13 11:40:24 +02:00
parent b9bc56a748
commit c9485075d4
7 changed files with 256 additions and 199 deletions

View File

@@ -891,6 +891,10 @@ abstract class Accessory implements ActiveRecordInterface
$modifiedColumns = array(); $modifiedColumns = array();
$index = 0; $index = 0;
$this->modifiedColumns[] = AccessoryTableMap::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . AccessoryTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries // check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AccessoryTableMap::ID)) { if ($this->isColumnModified(AccessoryTableMap::ID)) {
@@ -948,6 +952,13 @@ abstract class Accessory implements ActiveRecordInterface
throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e); throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
} }
try {
$pk = $con->lastInsertId();
} catch (Exception $e) {
throw new PropelException('Unable to get autoincrement id.', 0, $e);
}
$this->setId($pk);
$this->setNew(false); $this->setNew(false);
} }
@@ -1224,7 +1235,6 @@ abstract class Accessory implements ActiveRecordInterface
*/ */
public function copyInto($copyObj, $deepCopy = false, $makeNew = true) public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{ {
$copyObj->setId($this->getId());
$copyObj->setProductId($this->getProductId()); $copyObj->setProductId($this->getProductId());
$copyObj->setAccessory($this->getAccessory()); $copyObj->setAccessory($this->getAccessory());
$copyObj->setPosition($this->getPosition()); $copyObj->setPosition($this->getPosition());
@@ -1232,6 +1242,7 @@ abstract class Accessory implements ActiveRecordInterface
$copyObj->setUpdatedAt($this->getUpdatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) { if ($makeNew) {
$copyObj->setNew(true); $copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
} }
} }

View File

@@ -148,7 +148,7 @@ class AccessoryTableMap extends TableMap
$this->setPhpName('Accessory'); $this->setPhpName('Accessory');
$this->setClassName('\\Thelia\\Model\\Accessory'); $this->setClassName('\\Thelia\\Model\\Accessory');
$this->setPackage('Thelia.Model'); $this->setPackage('Thelia.Model');
$this->setUseIdGenerator(false); $this->setUseIdGenerator(true);
$this->setIsCrossRef(true); $this->setIsCrossRef(true);
// columns // columns
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
@@ -429,6 +429,10 @@ class AccessoryTableMap extends TableMap
$criteria = $criteria->buildCriteria(); // build Criteria from Accessory object $criteria = $criteria->buildCriteria(); // build Criteria from Accessory object
} }
if ($criteria->containsKey(AccessoryTableMap::ID) && $criteria->keyContainsValue(AccessoryTableMap::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.AccessoryTableMap::ID.')');
}
// Set the correct dbName // Set the correct dbName
$query = AccessoryQuery::create()->mergeWith($criteria); $query = AccessoryQuery::create()->mergeWith($criteria);

View File

@@ -50,86 +50,108 @@ try {
->find(); ->find();
$content->delete(); $content->delete();
//first category $accessory = Thelia\Model\AccessoryQuery::create()
$sweet = new Thelia\Model\Category(); ->find();
$sweet->setParent(0); $accessory->delete();
$sweet->setVisible(1);
$sweet->setPosition(1);
$sweet->setDescription($faker->text(255));
$sweet->setTitle($faker->text(20));
$sweet->save(); //features and features_av
$featureList = array();
for($i=0; $i<4; $i++) {
$feature = new Thelia\Model\Feature();
$feature->setVisible(rand(1, 10)>7 ? 0 : 1);
$feature->setPosition($i);
$feature->setTitle($faker->text(20));
$feature->setDescription($faker->text(50));
//second category $feature->save();
$jeans = new Thelia\Model\Category(); $featureId = $feature->getId();
$jeans->setParent(0); $featureList[$featureId] = array();
$jeans->setVisible(1);
$jeans->setPosition(2);
$jeans->setDescription($faker->text(255));
$jeans->setTitle($faker->text(20));
$jeans->save(); for($j=0; $j<rand(1, 5); $j++) {
$featureAv = new Thelia\Model\FeatureAv();
//third category $featureAv->setFeature($feature);
$other = new Thelia\Model\Category(); $featureAv->setPosition($j);
$other->setParent($jeans->getId()); $featureAv->setTitle($faker->text(20));
$other->setVisible(1); $featureAv->setDescription($faker->text(255));
$other->setPosition(3);
$other->setDescription($faker->text(255));
$other->setTitle($faker->text(20));
$other->save();
for ($i=1; $i <= 5; $i++) {
$product = new \Thelia\Model\Product();
$product->addCategory($sweet);
$product->setTitle($faker->text(20));
$product->setDescription($faker->text(250));
/* $product->setQuantity($faker->randomNumber(1,50));
$product->setPrice($faker->randomFloat(2, 20, 2500));*/
$product->setVisible(1);
$product->setPosition($i);
$product->setRef($faker->text(255));
$product->save();
$stock = new \Thelia\Model\ProductSaleElements();
$stock->setProduct($product);
$stock->setQuantity($faker->randomNumber(1,50));
$stock->setPromo($faker->randomNumber(0,1));
$stock->save();
$productPrice = new \Thelia\Model\ProductPrice();
$productPrice->setProductSaleElements($stock);
$productPrice->setCurrency($currency);
$productPrice->setPrice($faker->randomFloat(2, 20, 2500));
$productPrice->save();
$featureAv->save();
$featureList[$featureId][] = $featureAv->getId();
}
} }
for ($i=1; $i <= 5; $i++) { //categories and products
$product = new \Thelia\Model\Product(); $productIdList = array();
$product->addCategory($jeans); $categoryIdList = array();
$product->setTitle($faker->text(20)); for($i=0; $i<4; $i++) {
$product->setDescription($faker->text(250)); $category = new Thelia\Model\Category();
/* $product->setQuantity($faker->randomNumber(1,50)); $category->setParent(0);
$product->setPrice($faker->randomFloat(2, 20, 2500));*/ $category->setVisible(rand(1, 10)>7 ? 0 : 1);
$product->setVisible(1); $category->setPosition($i);
$product->setPosition($i); $category->setTitle($faker->text(20));
$product->setRef($faker->text(255)); $category->setDescription($faker->text(255));
$product->save();
$stock = new \Thelia\Model\ProductSaleElements(); $category->save();
$stock->setProduct($product); $categoryIdList[] = $category->getId();
$stock->setQuantity($faker->randomNumber(1,50));
$stock->setPromo($faker->randomNumber(0,1));
$stock->save();
$productPrice = new \Thelia\Model\ProductPrice(); for($j=0; $j<rand(0, 4); $j++) {
$productPrice->setProductSaleElements($stock); $subcategory = new Thelia\Model\Category();
$productPrice->setCurrency($currency); $subcategory->setParent($category->getId());
$productPrice->setPrice($faker->randomFloat(2, 20, 2500)); $subcategory->setVisible(rand(1, 10)>7 ? 0 : 1);
$productPrice->save(); $subcategory->setPosition($j);
$subcategory->setTitle($faker->text(20));
$subcategory->setDescription($faker->text(255));
$subcategory->save();
$categoryIdList[] = $subcategory->getId();
for($k=0; $k<rand(1, 5); $k++) {
$product = new Thelia\Model\Product();
$product->setRef($subcategory->getId() . '_' . $k . '_' . $faker->randomNumber(8));
$product->addCategory($subcategory);
$product->setVisible(rand(1, 10)>7 ? 0 : 1);
$product->setPosition($k);
$product->setTitle($faker->text(20));
$product->setDescription($faker->text(255));
$product->save();
$productId = $product->getId();
$productIdList[] = $productId;
//add random accessories - or not
for($l=0; $l<rand(0, 3); $l++) {
$accessory = new Thelia\Model\Accessory();
$accessory->setAccessory($productIdList[array_rand($productIdList, 1)]);
$accessory->setProductId($productId);
$accessory->setPosition($l);
$accessory->save();
}
}
}
for($k=0; $k<rand(1, 5); $k++) {
$product = new Thelia\Model\Product();
$product->setRef($category->getId() . '_' . $k . '_' . $faker->randomNumber(8));
$product->addCategory($category);
$product->setVisible(rand(1, 10)>7 ? 0 : 1);
$product->setPosition($k);
$product->setTitle($faker->text(20));
$product->setDescription($faker->text(255));
$product->save();
$productId = $product->getId();
$productIdList[] = $productId;
//add random accessories
for($l=0; $l<rand(0, 3); $l++) {
$accessory = new Thelia\Model\Accessory();
$accessory->setAccessory($productIdList[array_rand($productIdList, 1)]);
$accessory->setProductId($productId);
$accessory->setPosition($l);
$accessory->save();
}
}
} }
//folders and contents //folders and contents
@@ -166,27 +188,6 @@ try {
} }
} }
//features and features_av
for($i=0; $i<4; $i++) {
$feature = new Thelia\Model\Feature();
$feature->setVisible(rand(1, 10)>7 ? 0 : 1);
$feature->setPosition($i);
$feature->setTitle($faker->text(20));
$feature->setDescription($faker->text(50));
$feature->save();
for($j=0; $j<rand(1, 5); $j++) {
$featureAv = new Thelia\Model\FeatureAv();
$featureAv->setFeature($feature);
$featureAv->setPosition($j);
$featureAv->setTitle($faker->text(20));
$featureAv->setDescription($faker->text(255));
$featureAv->save();
}
}
$con->commit(); $con->commit();
} catch (Exception $e) { } catch (Exception $e) {
echo "error : ".$e->getMessage()."\n"; echo "error : ".$e->getMessage()."\n";

View File

@@ -1,8 +1,8 @@
INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`by_default`,`position`,`created_at`,`updated_at`)VALUES INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`by_default`,`created_at`,`updated_at`)VALUES
(1, 'Français', 'fr', 'fr_FR', '','1', '1', NOW(), NOW()), (1, 'Français', 'fr', 'fr_FR', '','1', NOW(), NOW()),
(2, 'English', 'en', 'en_EN', '', '0', '2', NOW(), NOW()), (2, 'English', 'en', 'en_EN', '', '0', NOW(), NOW()),
(3, 'Espanol', 'es', 'es_ES', '', '0', '3', NOW(), NOW()), (3, 'Espanol', 'es', 'es_ES', '', '0', NOW(), NOW()),
(4, 'Italiano', 'it', 'it_IT', '','0', '4', NOW(), NOW()); (4, 'Italiano', 'it', 'it_IT', '','0', NOW(), NOW());
INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES
('session_config.default', '1', 1, 1, NOW(), NOW()), ('session_config.default', '1', 1, 1, NOW(), NOW()),
@@ -23,11 +23,11 @@ INSERT INTO `customer_title_i18n` (`id`, `locale`, `short`, `long`) VALUES
(3, 'en_US', 'Miss', 'Miss'), (3, 'en_US', 'Miss', 'Miss'),
(3, 'fr_FR', 'Mlle', 'Madamemoiselle'); (3, 'fr_FR', 'Mlle', 'Madamemoiselle');
INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate` ,`by_default`, `position` ,`created_at` ,`updated_at`) INSERT INTO `currency` (`id` ,`code` ,`symbol` ,`rate` ,`by_default` ,`created_at` ,`updated_at`)
VALUES VALUES
(1, 'EUR', '', '1', '1', '1', NOW() , NOW()), (1, 'EUR', '', '1', '1', NOW() , NOW()),
(2, 'USD', '$', '1.26', '0', '2', NOW(), NOW()), (2, 'USD', '$', '1.26', '0', NOW(), NOW()),
(3, 'GBP', '£', '0.89', '0', '3',NOW(), NOW()); (3, 'GBP', '£', '0.89', '0', NOW(), NOW());
INSERT INTO `currency_i18n` (`id` ,`locale` ,`name`) INSERT INTO `currency_i18n` (`id` ,`locale` ,`name`)
VALUES VALUES

View File

@@ -617,8 +617,8 @@ CREATE TABLE `produt_image`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_product_id` (`product_id`), INDEX `idx_product_image_product_id` (`product_id`),
CONSTRAINT `fk_product_id` CONSTRAINT `fk_product_image_product_id`
FOREIGN KEY (`product_id`) FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`) REFERENCES `product` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -640,8 +640,8 @@ CREATE TABLE `product_document`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_product_id` (`product_id`), INDEX `idx_product_document_product_id` (`product_id`),
CONSTRAINT `fk_product_id` CONSTRAINT `fk_product_document_product_id`
FOREIGN KEY (`product_id`) FOREIGN KEY (`product_id`)
REFERENCES `product` (`id`) REFERENCES `product` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -844,7 +844,7 @@ DROP TABLE IF EXISTS `accessory`;
CREATE TABLE `accessory` CREATE TABLE `accessory`
( (
`id` INTEGER NOT NULL, `id` INTEGER NOT NULL AUTO_INCREMENT,
`product_id` INTEGER NOT NULL, `product_id` INTEGER NOT NULL,
`accessory` INTEGER NOT NULL, `accessory` INTEGER NOT NULL,
`position` INTEGER NOT NULL, `position` INTEGER NOT NULL,
@@ -1332,8 +1332,8 @@ CREATE TABLE `category_image`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_category_id` (`category_id`), INDEX `idx_category_image_category_id` (`category_id`),
CONSTRAINT `fk_category_id` CONSTRAINT `fk_category_image_category_id`
FOREIGN KEY (`category_id`) FOREIGN KEY (`category_id`)
REFERENCES `category` (`id`) REFERENCES `category` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -1355,8 +1355,8 @@ CREATE TABLE `folder_image`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_folder_id` (`folder_id`), INDEX `idx_folder_image_folder_id` (`folder_id`),
CONSTRAINT `fk_folder_id` CONSTRAINT `fk_folder_image_folder_id`
FOREIGN KEY (`folder_id`) FOREIGN KEY (`folder_id`)
REFERENCES `folder` (`id`) REFERENCES `folder` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -1378,8 +1378,8 @@ CREATE TABLE `content_image`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_content_id` (`content_id`), INDEX `idx_content_image_content_id` (`content_id`),
CONSTRAINT `fk_content_id` CONSTRAINT `fk_content_image_content_id`
FOREIGN KEY (`content_id`) FOREIGN KEY (`content_id`)
REFERENCES `content` (`id`) REFERENCES `content` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -1401,8 +1401,8 @@ CREATE TABLE `category_document`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_category_id` (`category_id`), INDEX `idx_category_document_category_id` (`category_id`),
CONSTRAINT `fk_category_id` CONSTRAINT `fk_catgory_document_category_id`
FOREIGN KEY (`category_id`) FOREIGN KEY (`category_id`)
REFERENCES `category` (`id`) REFERENCES `category` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -1424,8 +1424,8 @@ CREATE TABLE `content_document`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_content_id` (`content_id`), INDEX `idx_content_document_content_id` (`content_id`),
CONSTRAINT `fk_content_id` CONSTRAINT `fk_content_document_content_id`
FOREIGN KEY (`content_id`) FOREIGN KEY (`content_id`)
REFERENCES `content` (`id`) REFERENCES `content` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT
@@ -1447,8 +1447,8 @@ CREATE TABLE `folder_document`
`created_at` DATETIME, `created_at` DATETIME,
`updated_at` DATETIME, `updated_at` DATETIME,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `idx_folder_id` (`folder_id`), INDEX `idx_folder_document_folder_id` (`folder_id`),
CONSTRAINT `fk_folder_id` CONSTRAINT `fk_folder_document_folder_id`
FOREIGN KEY (`folder_id`) FOREIGN KEY (`folder_id`)
REFERENCES `folder` (`id`) REFERENCES `folder` (`id`)
ON UPDATE RESTRICT ON UPDATE RESTRICT

View File

@@ -459,10 +459,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="product" name="fk_product_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="product" name="fk_product_image_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" /> <reference foreign="id" local="product_id" />
</foreign-key> </foreign-key>
<index name="idx_product_id"> <index name="idx_product_image_product_id">
<index-column name="product_id" /> <index-column name="product_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -479,10 +479,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="product" name="fk_product_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="product" name="fk_product_document_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" /> <reference foreign="id" local="product_id" />
</foreign-key> </foreign-key>
<index name="idx_product_id"> <index name="idx_product_document_product_id">
<index-column name="product_id" /> <index-column name="product_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -629,7 +629,7 @@
</behavior> </behavior>
</table> </table>
<table isCrossRef="true" name="accessory" namespace="Thelia\Model"> <table isCrossRef="true" name="accessory" namespace="Thelia\Model">
<column name="id" primaryKey="true" required="true" type="INTEGER" /> <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="product_id" required="true" type="INTEGER" /> <column name="product_id" required="true" type="INTEGER" />
<column name="accessory" required="true" type="INTEGER" /> <column name="accessory" required="true" type="INTEGER" />
<column name="position" required="true" type="INTEGER" /> <column name="position" required="true" type="INTEGER" />
@@ -973,10 +973,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="category" name="fk_category_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="category" name="fk_category_image_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="category_id" /> <reference foreign="id" local="category_id" />
</foreign-key> </foreign-key>
<index name="idx_category_id"> <index name="idx_category_image_category_id">
<index-column name="category_id" /> <index-column name="category_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -993,10 +993,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="folder" name="fk_folder_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="folder" name="fk_folder_image_folder_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="folder_id" /> <reference foreign="id" local="folder_id" />
</foreign-key> </foreign-key>
<index name="idx_folder_id"> <index name="idx_folder_image_folder_id">
<index-column name="folder_id" /> <index-column name="folder_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -1013,10 +1013,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="content" name="fk_content_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="content" name="fk_content_image_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="content_id" /> <reference foreign="id" local="content_id" />
</foreign-key> </foreign-key>
<index name="idx_content_id"> <index name="idx_content_image_content_id">
<index-column name="content_id" /> <index-column name="content_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -1033,10 +1033,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="category" name="fk_category_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="category" name="fk_catgory_document_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="category_id" /> <reference foreign="id" local="category_id" />
</foreign-key> </foreign-key>
<index name="idx_category_id"> <index name="idx_category_document_category_id">
<index-column name="category_id" /> <index-column name="category_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -1053,10 +1053,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="content" name="fk_content_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="content" name="fk_content_document_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="content_id" /> <reference foreign="id" local="content_id" />
</foreign-key> </foreign-key>
<index name="idx_content_id"> <index name="idx_content_document_content_id">
<index-column name="content_id" /> <index-column name="content_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />
@@ -1073,10 +1073,10 @@
<column name="description" type="CLOB" /> <column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" /> <column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" /> <column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="folder" name="fk_folder_id" onDelete="CASCADE" onUpdate="RESTRICT"> <foreign-key foreignTable="folder" name="fk_folder_document_folder_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="folder_id" /> <reference foreign="id" local="folder_id" />
</foreign-key> </foreign-key>
<index name="idx_folder_id"> <index name="idx_folder_document_folder_id">
<index-column name="folder_id" /> <index-column name="folder_id" />
</index> </index>
<behavior name="timestampable" /> <behavior name="timestampable" />

View File

@@ -1,70 +1,80 @@
{*loop name="category0" type="category" parent="0"} <div style="border: solid 8px; margin: 0px; padding: 0px; width: 30%; float: left">
<h2>CATEGORY : #TITLE</h2>
{loop name="category1" type="category" parent="#ID"} <h2>CATALOG</h2>
<hr />
{loop name="category0" type="category" parent="0" order="manual"}
<div style="border: solid 4px blue; padding: 20px; margin: 10px;">
<h2>CATEGORY : #TITLE (#LOOP_COUNT / #LOOP_TOTAL)</h2>
{loop name="product" type="product" category="#ID"}
<div style="border: dashed 2px red; padding: 20px; margin: 10px;">
<h3><a name="#REF">PRODUCT : #REF (#LOOP_COUNT / #LOOP_TOTAL)</a></h3>
<h4>#TITLE</h4>
<p>#DESCRIPTION</p>
{ifloop rel="acc"}
<h5>Accessories</h5>
<ul>
{loop name="acc" type="accessory" product="#ID" order="accessory"}
<li><a href="##REF">#REF</a></li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="acc"}
<h5>No accessory</h5>
{/elseloop}
{ifloop rel="ft"}
<h5>Features</h5>
<ul>
{loop name="ft" type="feature" order="manual" product="#ID"}
<li>#TITLE</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="ft"}
<h5>No feature</h5>
{/elseloop}
</div>
{/loop}
{loop name="catgory1" type="category" parent="#ID"}
<div style="border: double 4px lightseagreen; padding: 20px; margin: 10px;">
<h3>SUBCATEGORY : #TITLE (#LOOP_COUNT / #LOOP_TOTAL)</h3> <h3>SUBCATEGORY : #TITLE (#LOOP_COUNT / #LOOP_TOTAL)</h3>
{loop name="product" type="product" category="#ID"} {loop name="product" type="product" category="#ID"}
<h3>PRODUCT : #REF / #TITLE</h3> <div style="border: solid 1px green; padding: 20px; margin: 10px;">
#PRICE € <h3><a name="#REF">PRODUCT : #REF (#LOOP_COUNT / #LOOP_TOTAL)</a></h3>
<h4>#TITLE</h4>
<p>#DESCRIPTION</p>
{ifloop rel="acc"}
<h5>Accessories</h5>
<ul>
{loop name="acc" type="accessory" product="#ID" order="accessory"}
<li><a href="##REF">#REF</a></li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="acc"}
<h5>No accessory</h5>
{/elseloop}
{ifloop rel="ft"}
<h5>Features</h5>
<ul>
{loop name="ft" type="feature" order="manual" product="#ID"}
<li>#TITLE</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="ft"}
<h5>No feature</h5>
{/elseloop}
</div>
{/loop} {/loop}
<hr /> </div>
<hr />
{/loop} {/loop}
</div>
{loop name="product" type="product" category="#ID"}
<h3>PRODUCT : #REF / #TITLE</h3>
#PRICE €
{/loop}
<hr />
<hr />
{/loop*}
<h2>PRODUCTS</h2>
{*loop name="product" type="product" order="promo,min_price" exclude_category="3"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
{*loop name="product" type="product" order="ref" feature_available="1: (1 | 2) , 2: 4, 3: 433"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
{*loop name="product" type="product" order="ref" feature_values="1: foo"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
{loop name="product" type="product" order="ref"}
<h3>PRODUCT #ID : #REF / #TITLE</h3>
<h4>Accessories</h4>
<ul>
{loop name="acc" type="accessory" product="#ID" order="accessory"}
<li>#REF</li>
{/loop}
</ul>
<h4>Features</h4>
<ul>
{loop name="ft" type="feature" order="manual" product="#ID"}
<li>#TITLE</li>
{/loop}
</ul>
{/loop} {/loop}
</div>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 30%; float: left">
<h2>ALL FEATURES AND THEIR AVAILABILITY</h2> <h2>ALL FEATURES AND THEIR AVAILABILITY</h2>
<ul> <ul>
@@ -78,4 +88,35 @@
</ul> </ul>
</li> </li>
{/loop} {/loop}
</ul> </ul>
</div>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 30%; float: left">
{*loop name="product" type="product" order="promo,min_price" exclude_category="3"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
{*loop name="product" type="product" order="ref" feature_available="1: (1 | 2) , 2: 4, 3: 433"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
{*loop name="product" type="product" order="ref" feature_values="1: foo"}
<h3>PRODUCT : #REF / #TITLE</h3>
price : #PRICE €<br />
promo price : #PROMO_PRICE €<br />
is promo : #PROMO<br />
is new : #NEW<br />
weight : #WEIGHT<br />
{/loop*}
</div>