<commit_before><?php

namespace CodeEmailMkt\Infrastructure\Persistence\Doctrine\DataFixture;

use CodeEmailMkt\Domain\Entity\Campaign;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Faker\Factory as Faker;

/**
 * Extende de AbstractFixture para ter o addReference
 */
class CampaignFixture extends AbstractFixture implements FixtureInterface, OrderedFixtureInterface
{
	/**
	 * Load data fixtures with the passed EntityManager
	 * @param  ObjectManager $manager
	 */
	public function load(ObjectManager $manager)
	{
		$faker = Faker::create();
		$template = "<p>{$faker->paragraph(2)}</p><p><a href='http://sites.code.education/curso-php7'>Comprar Produto</a></p>";

		foreach (range(1,20) as $key) {
			$campaign = new Campaign();
			$campaign
				->setName($faker->country)
				->setTemplate($template)
				->setSubject($faker->sentence(3))
				;
			$manager->persist($campaign);
			$this->addReference("campaign-$key", $campaign);
		}

		$manager->flush();
	}

	/**
     * Get the order of this fixture
     * 
     * @return integer
     */
	public function getOrder()
	{
		return 100;
	}
}<commit_msg>pegando name do usuario<commit_after><?php

namespace CodeEmailMkt\Infrastructure\Persistence\Doctrine\DataFixture;

use CodeEmailMkt\Domain\Entity\Campaign;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Faker\Factory as Faker;

/**
 * Extende de AbstractFixture para ter o addReference
 */
class CampaignFixture extends AbstractFixture implements FixtureInterface, OrderedFixtureInterface
{
	/**
	 * Load data fixtures with the passed EntityManager
	 * @param  ObjectManager $manager
	 */
	public function load(ObjectManager $manager)
	{
		$faker = Faker::create();
		$template = "<p>Olá %recipient.full_name%,</p><p>{$faker->paragraph(2)}</p>" .
		"<p><a href='http://sites.code.education/curso-php7'>Comprar Produto</a></p>";

		foreach (range(1,20) as $key) {
			$campaign = new Campaign();
			$campaign
				->setName($faker->country)
				->setTemplate($template)
				->setSubject("%recipient.full_name%" . $faker->sentence(3))
				;
			$manager->persist($campaign);
			$this->addReference("campaign-$key", $campaign);
		}

		$manager->flush();
	}

	/**
     * Get the order of this fixture
     * 
     * @return integer
     */
	public function getOrder()
	{
		return 100;
	}
}
{'fraction_non_alphanumeric': 0.13980137509549273, 'fraction_numerical': 0.006875477463712758, 'mean_word_length': 4.47907949790795, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5632410', 'n_tokens_mistral': 924, 'n_tokens_neox': 828, 'n_words': 164}