Working : Content : add faker default folder

This commit is contained in:
gmorel
2013-09-17 15:01:58 +02:00
parent fd1aaaef63
commit 654caf4c6e

View File

@@ -314,6 +314,12 @@ try {
for($k=0; $k<rand(0, 5); $k++) {
$content = new Thelia\Model\Content();
$content->addFolder($subfolder);
$contentFolders = $content->getContentFolders();
$collection = new \Propel\Runtime\Collection\Collection();
$collection->prepend($contentFolders[0]->setDefaultFolder(1));
$content->setContentFolders($collection);
$content->setVisible(rand(1, 10)>7 ? 0 : 1);
$content->setPosition($k);
setI18n($faker, $content);
@@ -460,7 +466,6 @@ function createProduct($faker, Thelia\Model\Category $category, $position, $temp
$product->addCategory($category);
$product->setVisible(1);
$productCategories = $product->getProductCategories();
$productCategories[0]->setDefaultCategory(true);
$collection = new \Propel\Runtime\Collection\Collection();
$collection->prepend($productCategories[0]->setDefaultCategory(1));
$product->setProductCategories($collection);