Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* @file
* first fixture experience...
namespace Mirtrik\HelloBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Mirtrik\ProductBundle\Entity\Product;
use Mirtrik\ProductBundle\Entity\Attribute;
use Mirtrik\ProductBundle\Entity\AttributeValue;
use Mirtrik\ProductBundle\Entity\Category;
* Loading Product Data into db
class LoadProductData implements FixtureInterface
* @method inherited
public function load(ObjectManager $manager)
// создаем атрибуты
$testAttr = new Attribute();
// создаем категории
$testCategory = new Category();
// создаем продукт
$testProduct = new Product();
// создаем значения
$testValue = new AttributeValue();
// сохраняем в базу
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.