Working : Content : add faker default folder
This commit is contained in:
@@ -314,6 +314,12 @@ try {
|
|||||||
for($k=0; $k<rand(0, 5); $k++) {
|
for($k=0; $k<rand(0, 5); $k++) {
|
||||||
$content = new Thelia\Model\Content();
|
$content = new Thelia\Model\Content();
|
||||||
$content->addFolder($subfolder);
|
$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->setVisible(rand(1, 10)>7 ? 0 : 1);
|
||||||
$content->setPosition($k);
|
$content->setPosition($k);
|
||||||
setI18n($faker, $content);
|
setI18n($faker, $content);
|
||||||
@@ -460,7 +466,6 @@ function createProduct($faker, Thelia\Model\Category $category, $position, $temp
|
|||||||
$product->addCategory($category);
|
$product->addCategory($category);
|
||||||
$product->setVisible(1);
|
$product->setVisible(1);
|
||||||
$productCategories = $product->getProductCategories();
|
$productCategories = $product->getProductCategories();
|
||||||
$productCategories[0]->setDefaultCategory(true);
|
|
||||||
$collection = new \Propel\Runtime\Collection\Collection();
|
$collection = new \Propel\Runtime\Collection\Collection();
|
||||||
$collection->prepend($productCategories[0]->setDefaultCategory(1));
|
$collection->prepend($productCategories[0]->setDefaultCategory(1));
|
||||||
$product->setProductCategories($collection);
|
$product->setProductCategories($collection);
|
||||||
|
|||||||
Reference in New Issue
Block a user