<commit_before><?php

/*
 * This file is part of the Sonata package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\Bundle\DemoBundle\DataFixtures\ORM;

use Application\Sonata\MediaBundle\Entity\GalleryHasMedia;
use Application\Sonata\ProductBundle\Entity\Delivery;
use Application\Sonata\ProductBundle\Entity\Goodie;
use Application\Sonata\ProductBundle\Entity\Travel;
use Application\Sonata\ProductBundle\Entity\Package;
use Application\Sonata\ProductBundle\Entity\ProductCategory;
use Application\Sonata\ProductBundle\Entity\ProductCollection;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Sonata\ClassificationBundle\Model\CategoryInterface;
use Sonata\ClassificationBundle\Model\CollectionInterface;
use Sonata\Component\Product\ProductInterface;
use Sonata\MediaBundle\Model\GalleryInterface;
use Sonata\MediaBundle\Model\MediaInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Finder\Finder;

/**
 * Product fixtures loader.
 *
 * @author <NAME> <<EMAIL>>
 */
class LoadProductData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
{
    /**
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
     */
    protected $container;

    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $productPool = $this->getProductPool();

        // default media
        $defaultMedia = $this->getMediaManager()->create();
        $defaultMedia->setBinaryContent(new \SplFileInfo(__DIR__.'/../data/files/sonata_logo.png'));
        $defaultMedia->setEnabled(true);
        $defaultMedia->setName('sonata_product_default_media');
        $defaultMedia->setDescription('Default Product media');
        $this->getMediaManager()->save($defaultMedia, 'sonata_product_default', 'sonata.media.provider.image');

        /*
         * @todo
         *  - check licences for used images
         */
        $dummyCategory     = $this->getDummyCategory();
        $goodiesCategory   = $this->getGoodiesCategory();
        $travelsCategory   = $this->getTravelsCategory();
        $plushesCategory   = $this->getPlushesCategory();
        $mugCategory       = $this->getMugCategory();
        $clothesCategory   = $this->getClothesCategory();
        $shoesCategory     = $this->getShoesCategory();

        $phpCollection = $this->getPhpCollection();
        $travelCollection = $this->getTravelCollection();
        $dummyCollection = $this->getDummyCollection();

        $dummyMedia = $this->createMedia(__DIR__.'/../data/files/sonata_logo.png', 'Dummy', 'Dummy product');

        $dummyProductsCount = 501;

        for ($i = 1; $i < $dummyProductsCount; $i++) {
            // Goodies products
            $dummy = new Goodie();
            $dummy->setSku('dummy_'.$i);
            $dummy->setName(sprintf('Dummy %d', $i));
            $dummy->setSlug('dummy');
            $dummy->setDescription('Dummy product. We use it to test our catalog capabilities.');
            $dummy->setRawDescription('<p>Dummy product. We use it to test our catalog capabilities.</p>'.$this->getLorem());
            $dummy->setPriceIncludingVat(true);
            $dummy->setShortDescription('Dummy product. We use it to test our catalog capabilities.');
            $dummy->setRawShortDescription('<p>Dummy product. We use it to test our catalog capabilities.</p>');
            $dummy->setDescriptionFormatter('richhtml');
            $dummy->setShortDescriptionFormatter('richhtml');
            $dummy->setPrice(rand(0, 2*$i));
            $dummy->setStock(rand(1, 100*$i));
            $dummy->setVatRate(20);
            $dummy->setEnabled(true);
            $manager->persist($dummy);
            $this->setReference('dummy_product_'.$i, $dummy);

            $dummy->setImage($dummyMedia);
            $this->addProductToCategory($dummy, $dummyCategory, $manager);
            $this->addProductToCollection($dummy, $dummyCollection, $manager);
            $this->addProductDeliveries($dummy, $manager);
            $this->addPackageToProduct($dummy, $manager);

            if (0 === ($i % 20)) {
                $manager->flush();
            }
        }

        // Blue PHP plush products
        $bluePhpPlush = new Goodie();
        $bluePhpPlush->setSku('php-plush-blue');
        $bluePhpPlush->setName('Blue PHP plush');
        $bluePhpPlush->setSlug('php-plush-blue');
        $bluePhpPlush->setDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $bluePhpPlush->setRawDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $bluePhpPlush->setPriceIncludingVat(false);
        $bluePhpPlush->setShortDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME>.');
        $bluePhpPlush->setRawShortDescription('<p>The PHP plush toy is based on the PHP world-famous elephant from <NAME>.</p>');
        $bluePhpPlush->setDescriptionFormatter('richhtml');
        $bluePhpPlush->setShortDescriptionFormatter('richhtml');
        $bluePhpPlush->setPrice(29.99);
        $bluePhpPlush->setStock(2000);
        $bluePhpPlush->setVatRate(20);
        $bluePhpPlush->setEnabled(true);
        $manager->persist($bluePhpPlush);
        $this->setReference('php_plush_blue_goodie_product', $bluePhpPlush);

        $this->addMediaToProduct(__DIR__.'/../data/files/elephpant_blue.jpg', 'Blue PHP elePHPant',
            <<<EOF
Original PHP plush based on Vincent Pontier PHP logo.
Reference - http://www.flickr.com/photos/fullo/4703273699/in/pool-35237093722@N01/
EOF
, $bluePhpPlush, '<NAME>', 'CC BY-NC-SA 2.0');
        $this->addProductToCategory($bluePhpPlush, $plushesCategory, $manager);
        $this->addProductToCategory($bluePhpPlush, $goodiesCategory, $manager);
        $this->addProductDeliveries($bluePhpPlush, $manager);
        $this->addProductToCollection($bluePhpPlush, $phpCollection, $manager);
        $this->addPackageToProduct($bluePhpPlush, $manager);

        // Green PHP plush products
        $greenPhpPlush = new Goodie();
        $greenPhpPlush->setSku('php-plush-green');
        $greenPhpPlush->setName('Green PHP plush');
        $greenPhpPlush->setSlug('php-plush-green');
        $greenPhpPlush->setDescription('The PHP plush toy is based on the PHP world-famous elephant from Vincent Pontier (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $greenPhpPlush->setRawDescription('The PHP plush toy is based on the PHP world-famous elephant from Vincent Pontier (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $greenPhpPlush->setPriceIncludingVat(false);
        $greenPhpPlush->setShortDescription('The PHP plush toy is based on the PHP world-famous elephant from Vincent Pontier.');
        $greenPhpPlush->setRawShortDescription('<p>The PHP plush toy is based on the PHP world-famous elephant from <NAME>.</p>');
        $greenPhpPlush->setDescriptionFormatter('richhtml');
        $greenPhpPlush->setShortDescriptionFormatter('richhtml');
        $greenPhpPlush->setPrice(29.99);
        $greenPhpPlush->setStock(50);
        $greenPhpPlush->setVatRate(20);
        $greenPhpPlush->setEnabled(true);
        $manager->persist($greenPhpPlush);
        $this->setReference('php_plush_green_goodie_product', $greenPhpPlush);

        $this->addMediaToProduct(__DIR__.'/../data/files/elephpant_green.jpg', 'Green PHP elePHPant',
            <<<EOF
Green PHP plush based on Vincent Pontier PHP logo.
Reference - http://www.flickr.com/photos/ztec/9204770134/in/photostream/
EOF
            , $greenPhpPlush, '<NAME>', 'CC BY-NC-SA 2.0');
        $this->addProductToCategory($greenPhpPlush, $plushesCategory, $manager);
        $this->addProductToCategory($greenPhpPlush, $goodiesCategory, $manager);
        $this->addProductDeliveries($greenPhpPlush, $manager);
        $this->addProductToCollection($greenPhpPlush, $phpCollection, $manager);
        $this->addPackageToProduct($greenPhpPlush, $manager);

        // Orange PHP plush products
        $orangePhpPlush = new Goodie();
        $orangePhpPlush->setSku('php-plush-orange');
        $orangePhpPlush->setName('Orange PHP plush');
        $orangePhpPlush->setSlug('php-plush-orange');
        $orangePhpPlush->setDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $orangePhpPlush->setRawDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $orangePhpPlush->setPriceIncludingVat(false);
        $orangePhpPlush->setShortDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME>.');
        $orangePhpPlush->setRawShortDescription('<p>The PHP plush toy is based on the PHP world-famous elephant from <NAME>.</p>');
        $orangePhpPlush->setDescriptionFormatter('richhtml');
        $orangePhpPlush->setShortDescriptionFormatter('richhtml');
        $orangePhpPlush->setPrice(29.99);
        $orangePhpPlush->setStock(50);
        $orangePhpPlush->setVatRate(20);
        $orangePhpPlush->setEnabled(true);
        $manager->persist($orangePhpPlush);
        $this->setReference('php_plush_orange_goodie_product', $orangePhpPlush);

        $this->addMediaToProduct(__DIR__.'/../data/files/elephpant_orange.jpg', 'Orange PHP elePHPant',
            <<<EOF
Orange PHP Plush based on Vincent Pontier PHP logo.
Reference - http://www.kickstarter.com/projects/eliw/php-architect-orange-elephpant
EOF
            , $orangePhpPlush, 'http://www.phparch.com/', '/');
        $this->addProductToCategory($orangePhpPlush, $plushesCategory, $manager);
        $this->addProductToCategory($orangePhpPlush, $goodiesCategory, $manager);
        $this->addProductDeliveries($orangePhpPlush, $manager);
        $this->addProductToCollection($orangePhpPlush, $phpCollection, $manager);
        $this->addPackageToProduct($orangePhpPlush, $manager);

        // PHP Mug
        $phpMug = new Goodie();
        $phpMug->setSku('PHP_MUG');
        $phpMug->setName('PHP mug');
        $phpMug->setSlug('php-mug');
        $phpMug->setDescription('You love coffee and PHP ? This mug is for you.');
        $phpMug->setRawDescription('You love coffee and PHP ? This mug is for you.'.$this->getLorem());
        $phpMug->setPriceIncludingVat(true);
        $phpMug->setShortDescription('You love coffee and PHP ? This mug is for you.');
        $phpMug->setRawShortDescription('<p>You love coffee and PHP ? This mug is for you.</p>');
        $phpMug->setDescriptionFormatter('richhtml');
        $phpMug->setShortDescriptionFormatter('richhtml');

        $phpMug->setPrice(9.99);
        $phpMug->setStock(10000);
        $phpMug->setVatRate(20);
        $phpMug->setEnabled(true);
        $manager->persist($phpMug);
        $this->setReference('php_mug_goodie_product', $phpMug);

        $this->addMediaToProduct(__DIR__.'/../data/files/php_mug.jpg', 'PHP mug', 'PHP mug', $phpMug);
        $this->addProductToCategory($phpMug, $mugCategory, $manager);
        $this->addProductToCategory($phpMug, $goodiesCategory, $manager);
        $this->addProductDeliveries($phpMug, $manager);
        $this->addProductToCollection($phpMug, $phpCollection, $manager);
        $this->addPackageToProduct($phpMug, $manager);

        $phpTeeShirt = new Goodie();
        $phpTeeShirt->setSku('PHP_TSHIRT');
        $phpTeeShirt->setName('PHP tee-shirt');
        $phpTeeShirt->setSlug('php-t-shirt');
        $phpTeeShirt->setDescription('A nice PHP tee-shirt, best clothe ever to pick up girls.');
        $phpTeeShirt->setRawDescription('A nice PHP tee-shirt, best clothe ever to pick up girls.'.$this->getLorem());

        $phpTeeShirt->setPriceIncludingVat(true);
        $phpTeeShirt->setShortDescription('A nice PHP tee-shirt, best clothe ever to pick up girls.');
        $phpTeeShirt->setRawShortDescription('<p>A nice PHP tee-shirt, best clothe ever to pick up girls.</p>');
        $phpTeeShirt->setDescriptionFormatter('richhtml');
        $phpTeeShirt->setShortDescriptionFormatter('richhtml');
        $phpTeeShirt->setPrice(25);
        $phpTeeShirt->setStock(0);
        $phpTeeShirt->setVatRate(20);
        $phpTeeShirt->setEnabled(true);
        $manager->persist($phpTeeShirt);
        $this->setReference('php_teeshirt_goodie_product', $phpTeeShirt);

        $this->addMediaToProduct(__DIR__.'/../data/files/php_tee_shirt.png', 'PHP tee-shirt', 'PHP tee-shirt', $phpTeeShirt);
        $this->addProductToCategory($phpTeeShirt, $clothesCategory, $manager);
        $this->addProductToCategory($phpTeeShirt, $goodiesCategory, $manager);
        $this->addProductDeliveries($phpTeeShirt, $manager);
        $this->addProductToCollection($phpTeeShirt, $phpCollection, $manager);
        $this->addPackageToProduct($phpTeeShirt, $manager);

        $maximumAir = new Goodie();
        $maximumAir->setSku('MAXIMUM_AIR_SONATA');
        $maximumAir->setName('Maximum Air Sonata Limited Edition');
        $maximumAir->setSlug('maximum-air-sonata-limited-edition');
        $maximumAir->setDescription('Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.');
        $maximumAir->setRawDescription('Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.'.$this->getLorem());
        $maximumAir->setPriceIncludingVat(true);
        $maximumAir->setShortDescription('Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.');
        $maximumAir->setRawShortDescription('<p>Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.</p>');
        $maximumAir->setDescriptionFormatter('richhtml');
        $maximumAir->setShortDescriptionFormatter('richhtml');
        $maximumAir->setPrice(130);
        $maximumAir->setStock(500);
        $maximumAir->setVatRate(20);
        $maximumAir->setEnabled(false);
        $manager->persist($maximumAir);
        $this->setReference('maximum_air_sonata_product', $maximumAir);

        $this->addMediaToProduct(__DIR__.'/../data/files/maximum-air-sonata.jpg', 'Maximum Air Sonata Limited edition', 'Maximum Air Sonata Limited edition', $maximumAir);
        $this->addProductToCategory($maximumAir, $this->getReference('sonata_shoes_category'), $manager);
        $this->addProductToCategory($maximumAir, $goodiesCategory, $manager);
        $this->addProductToCategory($maximumAir, $shoesCategory, $manager);
        $this->addProductDeliveries($maximumAir, $manager);
        $this->addProductToCollection($maximumAir, $phpCollection, $manager);
        $this->addPackageToProduct($maximumAir, $manager);

        $maximumAirUlt = new Goodie();
        $maximumAirUlt->setSku('MAXIMUM_AIR_SONATA_ULTIMATE');
        $maximumAirUlt->setName('Maximum Air Sonata ULTIMATE Edition');
        $maximumAirUlt->setSlug('maximum-air-sonata-ultimate-edition');
        $maximumAirUlt->setDescription('Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.');
        $maximumAirUlt->setRawDescription('Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.'.$this->getLorem());
        $maximumAirUlt->setPriceIncludingVat(true);
        $maximumAirUlt->setShortDescription('Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.');
        $maximumAirUlt->setRawShortDescription('<p>Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.</p>');
        $maximumAirUlt->setDescriptionFormatter('richhtml');
        $maximumAirUlt->setShortDescriptionFormatter('richhtml');
        $maximumAirUlt->setPrice(250);<commit_msg>SONATA-357 - Remove cateogry added twice to a product<commit_after><?php

/*
 * This file is part of the Sonata package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sonata\Bundle\DemoBundle\DataFixtures\ORM;

use Application\Sonata\MediaBundle\Entity\GalleryHasMedia;
use Application\Sonata\ProductBundle\Entity\Delivery;
use Application\Sonata\ProductBundle\Entity\Goodie;
use Application\Sonata\ProductBundle\Entity\Travel;
use Application\Sonata\ProductBundle\Entity\Package;
use Application\Sonata\ProductBundle\Entity\ProductCategory;
use Application\Sonata\ProductBundle\Entity\ProductCollection;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Sonata\ClassificationBundle\Model\CategoryInterface;
use Sonata\ClassificationBundle\Model\CollectionInterface;
use Sonata\Component\Product\ProductInterface;
use Sonata\MediaBundle\Model\GalleryInterface;
use Sonata\MediaBundle\Model\MediaInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Finder\Finder;

/**
 * Product fixtures loader.
 *
 * @author <NAME> <<EMAIL>>
 */
class LoadProductData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
{
    /**
     * @var \Symfony\Component\DependencyInjection\ContainerInterface
     */
    protected $container;

    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $productPool = $this->getProductPool();

        // default media
        $defaultMedia = $this->getMediaManager()->create();
        $defaultMedia->setBinaryContent(new \SplFileInfo(__DIR__.'/../data/files/sonata_logo.png'));
        $defaultMedia->setEnabled(true);
        $defaultMedia->setName('sonata_product_default_media');
        $defaultMedia->setDescription('Default Product media');
        $this->getMediaManager()->save($defaultMedia, 'sonata_product_default', 'sonata.media.provider.image');

        /*
         * @todo
         *  - check licences for used images
         */
        $dummyCategory     = $this->getDummyCategory();
        $goodiesCategory   = $this->getGoodiesCategory();
        $travelsCategory   = $this->getTravelsCategory();
        $plushesCategory   = $this->getPlushesCategory();
        $mugCategory       = $this->getMugCategory();
        $clothesCategory   = $this->getClothesCategory();
        $shoesCategory     = $this->getShoesCategory();

        $phpCollection = $this->getPhpCollection();
        $travelCollection = $this->getTravelCollection();
        $dummyCollection = $this->getDummyCollection();

        $dummyMedia = $this->createMedia(__DIR__.'/../data/files/sonata_logo.png', 'Dummy', 'Dummy product');

        $dummyProductsCount = 501;

        for ($i = 1; $i < $dummyProductsCount; $i++) {
            // Goodies products
            $dummy = new Goodie();
            $dummy->setSku('dummy_'.$i);
            $dummy->setName(sprintf('Dummy %d', $i));
            $dummy->setSlug('dummy');
            $dummy->setDescription('Dummy product. We use it to test our catalog capabilities.');
            $dummy->setRawDescription('<p>Dummy product. We use it to test our catalog capabilities.</p>'.$this->getLorem());
            $dummy->setPriceIncludingVat(true);
            $dummy->setShortDescription('Dummy product. We use it to test our catalog capabilities.');
            $dummy->setRawShortDescription('<p>Dummy product. We use it to test our catalog capabilities.</p>');
            $dummy->setDescriptionFormatter('richhtml');
            $dummy->setShortDescriptionFormatter('richhtml');
            $dummy->setPrice(rand(0, 2*$i));
            $dummy->setStock(rand(1, 100*$i));
            $dummy->setVatRate(20);
            $dummy->setEnabled(true);
            $manager->persist($dummy);
            $this->setReference('dummy_product_'.$i, $dummy);

            $dummy->setImage($dummyMedia);
            $this->addProductToCategory($dummy, $dummyCategory, $manager);
            $this->addProductToCollection($dummy, $dummyCollection, $manager);
            $this->addProductDeliveries($dummy, $manager);
            $this->addPackageToProduct($dummy, $manager);

            if (0 === ($i % 20)) {
                $manager->flush();
            }
        }

        // Blue PHP plush products
        $bluePhpPlush = new Goodie();
        $bluePhpPlush->setSku('php-plush-blue');
        $bluePhpPlush->setName('Blue PHP plush');
        $bluePhpPlush->setSlug('php-plush-blue');
        $bluePhpPlush->setDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $bluePhpPlush->setRawDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $bluePhpPlush->setPriceIncludingVat(false);
        $bluePhpPlush->setShortDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME>.');
        $bluePhpPlush->setRawShortDescription('<p>The PHP plush toy is based on the PHP world-famous elephant from <NAME>.</p>');
        $bluePhpPlush->setDescriptionFormatter('richhtml');
        $bluePhpPlush->setShortDescriptionFormatter('richhtml');
        $bluePhpPlush->setPrice(29.99);
        $bluePhpPlush->setStock(2000);
        $bluePhpPlush->setVatRate(20);
        $bluePhpPlush->setEnabled(true);
        $manager->persist($bluePhpPlush);
        $this->setReference('php_plush_blue_goodie_product', $bluePhpPlush);

        $this->addMediaToProduct(__DIR__.'/../data/files/elephpant_blue.jpg', 'Blue PHP elePHPant',
            <<<EOF
Original PHP plush based on Vincent Pontier PHP logo.
Reference - http://www.flickr.com/photos/fullo/4703273699/in/pool-35237093722@N01/
EOF
, $bluePhpPlush, '<NAME>', 'CC BY-NC-SA 2.0');
        $this->addProductToCategory($bluePhpPlush, $plushesCategory, $manager);
        $this->addProductToCategory($bluePhpPlush, $goodiesCategory, $manager);
        $this->addProductDeliveries($bluePhpPlush, $manager);
        $this->addProductToCollection($bluePhpPlush, $phpCollection, $manager);
        $this->addPackageToProduct($bluePhpPlush, $manager);

        // Green PHP plush products
        $greenPhpPlush = new Goodie();
        $greenPhpPlush->setSku('php-plush-green');
        $greenPhpPlush->setName('Green PHP plush');
        $greenPhpPlush->setSlug('php-plush-green');
        $greenPhpPlush->setDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $greenPhpPlush->setRawDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $greenPhpPlush->setPriceIncludingVat(false);
        $greenPhpPlush->setShortDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME>.');
        $greenPhpPlush->setRawShortDescription('<p>The PHP plush toy is based on the PHP world-famous elephant from V<NAME>ier.</p>');
        $greenPhpPlush->setDescriptionFormatter('richhtml');
        $greenPhpPlush->setShortDescriptionFormatter('richhtml');
        $greenPhpPlush->setPrice(29.99);
        $greenPhpPlush->setStock(50);
        $greenPhpPlush->setVatRate(20);
        $greenPhpPlush->setEnabled(true);
        $manager->persist($greenPhpPlush);
        $this->setReference('php_plush_green_goodie_product', $greenPhpPlush);

        $this->addMediaToProduct(__DIR__.'/../data/files/elephpant_green.jpg', 'Green PHP elePHPant',
            <<<EOF
Green PHP plush based on Vincent Pontier PHP logo.
Reference - http://www.flickr.com/photos/ztec/9204770134/in/photostream/
EOF
            , $greenPhpPlush, '<NAME>', 'CC BY-NC-SA 2.0');
        $this->addProductToCategory($greenPhpPlush, $plushesCategory, $manager);
        $this->addProductToCategory($greenPhpPlush, $goodiesCategory, $manager);
        $this->addProductDeliveries($greenPhpPlush, $manager);
        $this->addProductToCollection($greenPhpPlush, $phpCollection, $manager);
        $this->addPackageToProduct($greenPhpPlush, $manager);

        // Orange PHP plush products
        $orangePhpPlush = new Goodie();
        $orangePhpPlush->setSku('php-plush-orange');
        $orangePhpPlush->setName('Orange PHP plush');
        $orangePhpPlush->setSlug('php-plush-orange');
        $orangePhpPlush->setDescription('The PHP plush toy is based on the PHP world-famous elephant from <NAME> (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $orangePhpPlush->setRawDescription('The PHP plush toy is based on the PHP world-famous elephant from V<NAME>ier (aka el roubio): Vincent evolved the logo from the three letters into an animal. More informations about Vincent http://www.elroubio.net/.');
        $orangePhpPlush->setPriceIncludingVat(false);
        $orangePhpPlush->setShortDescription('The PHP plush toy is based on the PHP world-famous elephant from Vincent Pontier.');
        $orangePhpPlush->setRawShortDescription('<p>The PHP plush toy is based on the PHP world-famous elephant from <NAME>.</p>');
        $orangePhpPlush->setDescriptionFormatter('richhtml');
        $orangePhpPlush->setShortDescriptionFormatter('richhtml');
        $orangePhpPlush->setPrice(29.99);
        $orangePhpPlush->setStock(50);
        $orangePhpPlush->setVatRate(20);
        $orangePhpPlush->setEnabled(true);
        $manager->persist($orangePhpPlush);
        $this->setReference('php_plush_orange_goodie_product', $orangePhpPlush);

        $this->addMediaToProduct(__DIR__.'/../data/files/elephpant_orange.jpg', 'Orange PHP elePHPant',
            <<<EOF
Orange PHP Plush based on Vincent Pontier PHP logo.
Reference - http://www.kickstarter.com/projects/eliw/php-architect-orange-elephpant
EOF
            , $orangePhpPlush, 'http://www.phparch.com/', '/');
        $this->addProductToCategory($orangePhpPlush, $plushesCategory, $manager);
        $this->addProductToCategory($orangePhpPlush, $goodiesCategory, $manager);
        $this->addProductDeliveries($orangePhpPlush, $manager);
        $this->addProductToCollection($orangePhpPlush, $phpCollection, $manager);
        $this->addPackageToProduct($orangePhpPlush, $manager);

        // PHP Mug
        $phpMug = new Goodie();
        $phpMug->setSku('PHP_MUG');
        $phpMug->setName('PHP mug');
        $phpMug->setSlug('php-mug');
        $phpMug->setDescription('You love coffee and PHP ? This mug is for you.');
        $phpMug->setRawDescription('You love coffee and PHP ? This mug is for you.'.$this->getLorem());
        $phpMug->setPriceIncludingVat(true);
        $phpMug->setShortDescription('You love coffee and PHP ? This mug is for you.');
        $phpMug->setRawShortDescription('<p>You love coffee and PHP ? This mug is for you.</p>');
        $phpMug->setDescriptionFormatter('richhtml');
        $phpMug->setShortDescriptionFormatter('richhtml');

        $phpMug->setPrice(9.99);
        $phpMug->setStock(10000);
        $phpMug->setVatRate(20);
        $phpMug->setEnabled(true);
        $manager->persist($phpMug);
        $this->setReference('php_mug_goodie_product', $phpMug);

        $this->addMediaToProduct(__DIR__.'/../data/files/php_mug.jpg', 'PHP mug', 'PHP mug', $phpMug);
        $this->addProductToCategory($phpMug, $mugCategory, $manager);
        $this->addProductToCategory($phpMug, $goodiesCategory, $manager);
        $this->addProductDeliveries($phpMug, $manager);
        $this->addProductToCollection($phpMug, $phpCollection, $manager);
        $this->addPackageToProduct($phpMug, $manager);

        $phpTeeShirt = new Goodie();
        $phpTeeShirt->setSku('PHP_TSHIRT');
        $phpTeeShirt->setName('PHP tee-shirt');
        $phpTeeShirt->setSlug('php-t-shirt');
        $phpTeeShirt->setDescription('A nice PHP tee-shirt, best clothe ever to pick up girls.');
        $phpTeeShirt->setRawDescription('A nice PHP tee-shirt, best clothe ever to pick up girls.'.$this->getLorem());

        $phpTeeShirt->setPriceIncludingVat(true);
        $phpTeeShirt->setShortDescription('A nice PHP tee-shirt, best clothe ever to pick up girls.');
        $phpTeeShirt->setRawShortDescription('<p>A nice PHP tee-shirt, best clothe ever to pick up girls.</p>');
        $phpTeeShirt->setDescriptionFormatter('richhtml');
        $phpTeeShirt->setShortDescriptionFormatter('richhtml');
        $phpTeeShirt->setPrice(25);
        $phpTeeShirt->setStock(0);
        $phpTeeShirt->setVatRate(20);
        $phpTeeShirt->setEnabled(true);
        $manager->persist($phpTeeShirt);
        $this->setReference('php_teeshirt_goodie_product', $phpTeeShirt);

        $this->addMediaToProduct(__DIR__.'/../data/files/php_tee_shirt.png', 'PHP tee-shirt', 'PHP tee-shirt', $phpTeeShirt);
        $this->addProductToCategory($phpTeeShirt, $clothesCategory, $manager);
        $this->addProductToCategory($phpTeeShirt, $goodiesCategory, $manager);
        $this->addProductDeliveries($phpTeeShirt, $manager);
        $this->addProductToCollection($phpTeeShirt, $phpCollection, $manager);
        $this->addPackageToProduct($phpTeeShirt, $manager);

        $maximumAir = new Goodie();
        $maximumAir->setSku('MAXIMUM_AIR_SONATA');
        $maximumAir->setName('Maximum Air Sonata Limited Edition');
        $maximumAir->setSlug('maximum-air-sonata-limited-edition');
        $maximumAir->setDescription('Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.');
        $maximumAir->setRawDescription('Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.'.$this->getLorem());
        $maximumAir->setPriceIncludingVat(true);
        $maximumAir->setShortDescription('Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.');
        $maximumAir->setRawShortDescription('<p>Get this limited edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story.</p>');
        $maximumAir->setDescriptionFormatter('richhtml');
        $maximumAir->setShortDescriptionFormatter('richhtml');
        $maximumAir->setPrice(130);
        $maximumAir->setStock(500);
        $maximumAir->setVatRate(20);
        $maximumAir->setEnabled(false);
        $manager->persist($maximumAir);
        $this->setReference('maximum_air_sonata_product', $maximumAir);

        $this->addMediaToProduct(__DIR__.'/../data/files/maximum-air-sonata.jpg', 'Maximum Air Sonata Limited edition', 'Maximum Air Sonata Limited edition', $maximumAir);
        $this->addProductToCategory($maximumAir, $goodiesCategory, $manager);
        $this->addProductToCategory($maximumAir, $shoesCategory, $manager);
        $this->addProductDeliveries($maximumAir, $manager);
        $this->addProductToCollection($maximumAir, $phpCollection, $manager);
        $this->addPackageToProduct($maximumAir, $manager);

        $maximumAirUlt = new Goodie();
        $maximumAirUlt->setSku('MAXIMUM_AIR_SONATA_ULTIMATE');
        $maximumAirUlt->setName('Maximum Air Sonata ULTIMATE Edition');
        $maximumAirUlt->setSlug('maximum-air-sonata-ultimate-edition');
        $maximumAirUlt->setDescription('Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.');
        $maximumAirUlt->setRawDescription('Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.'.$this->getLorem());
        $maximumAirUlt->setPriceIncludingVat(true);
        $maximumAirUlt->setShortDescription('Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.');
        $maximumAirUlt->setRawShortDescription('<p>Get this ULTIMATE edition of the MAXIMUM AIR SONATA and fly over PHP bugs. True story. Even more powerful than the limited edition. Note that this product does not contain any media for behat testing purpose.</p>');
        $maximumAirUlt->setDescriptionFormatter('richhtml');
        $maximumAirUlt->setShortDescriptionFormatter('richhtml');
        $maximumAirUlt->setPrice(250);
{'fraction_non_alphanumeric': 0.1292927526091773, 'fraction_numerical': 0.006151244825374613, 'mean_word_length': 3.7016173245614037, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 457, 'https://': 0, 'lorem ipsum': 0, 'www.': 20, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3402550', 'n_tokens_mistral': 10462, 'n_tokens_neox': 10027, 'n_words': 2187}