diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index d6de1f7a7..93ae038b6 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -38,27 +38,9 @@ use Thelia\Type\TypeCollection; use Thelia\Type; /** - * - * Folder loop, all params available : - * - * - id : can be an id (eq : 3) or a "string list" (eg: 3, 4, 5) - * - parent : categories having this parent id - * - current : current id is used if you are on a folder page - * - not_empty : if value is 1, folder and subcategories must have at least 1 product - * - visible : default 1, if you want folder not visible put 0 - * - order : all value available : 'alpha', 'alpha_reverse', 'manual' (default), 'manual-reverse', 'random' - * - exclude : all folder id you want to exclude (as for id, an integer or a "string list" can be used) - * - * example : - * - * - * #TITLE : #ID - * - * - * * Class Folder + * * @package Thelia\Core\Template\Loop - * @author Manuel Raynaud * @author Etienne Roudeix */ class Folder extends BaseLoop diff --git a/install/faker.php b/install/faker.php index 85a338ebe..2ade870e2 100755 --- a/install/faker.php +++ b/install/faker.php @@ -20,13 +20,21 @@ try { ->find(); $product->delete(); + $folder = Thelia\Model\FolderQuery::create() + ->find(); + $folder->delete(); + + $content = Thelia\Model\ContentQuery::create() + ->find(); + $content->delete(); + //first category $sweet = new Thelia\Model\Category(); $sweet->setParent(0); $sweet->setVisible(1); $sweet->setPosition(1); $sweet->setDescription($faker->text(255)); - $sweet->setTitle($faker->bs); + $sweet->setTitle($faker->text(20)); $sweet->save(); @@ -36,7 +44,7 @@ try { $jeans->setVisible(1); $jeans->setPosition(2); $jeans->setDescription($faker->text(255)); - $jeans->setTitle($faker->bs); + $jeans->setTitle($faker->text(20)); $jeans->save(); @@ -46,14 +54,14 @@ try { $other->setVisible(1); $other->setPosition(3); $other->setDescription($faker->text(255)); - $other->setTitle($faker->bs); + $other->setTitle($faker->text(20)); $other->save(); for ($i=1; $i <= 5; $i++) { $product = new \Thelia\Model\Product(); $product->addCategory($sweet); - $product->setTitle($faker->bs); + $product->setTitle($faker->text(20)); $product->setDescription($faker->text(250)); /* $product->setQuantity($faker->randomNumber(1,50)); $product->setPrice($faker->randomFloat(2, 20, 2500));*/ @@ -79,7 +87,7 @@ try { for ($i=1; $i <= 5; $i++) { $product = new \Thelia\Model\Product(); $product->addCategory($jeans); - $product->setTitle($faker->bs); + $product->setTitle($faker->text(20)); $product->setDescription($faker->text(250)); /* $product->setQuantity($faker->randomNumber(1,50)); $product->setPrice($faker->randomFloat(2, 20, 2500));*/ @@ -102,6 +110,28 @@ try { } + //folders + for($i=0; $i<4; $i++) { + $folder = new Thelia\Model\Folder(); + $folder->setParent(0); + $folder->setVisible(rand(1, 10)>7 ? 0 : 1); + $folder->setPosition($i); + $folder->setTitle($faker->text(20)); + $folder->setDescription($faker->text(255)); + + $folder->save(); + + for($i=0; $isetParent($folder->getId()); + $subfolder->setVisible(rand(1, 10)>7 ? 0 : 1); + $subfolder->setPosition($i); + $subfolder->setTitle($faker->text(20)); + $subfolder->setDescription($faker->text(255)); + + $subfolder->save(); + } + } $con->commit(); } catch (Exception $e) {