Авто заполнение данными DataFixture (Курс Doctrine ORM Ур 7)

Пример простого кода.
<?php
namespace App\DataFixtures;
use App\Entity\Product;
use App\Entity\Shipment;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
class ProductFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
for ($i = 0; $i < 50; $i++) {
$product = new Product();
$product->setName('product '.$i);
$product->setPrice(mt_rand(10, 100));
$product->setQty(mt_rand(1, 10));
$manager->persist($product);
}
$manager->flush();
}
}