rater/src/Factory/RatingFactory.php

50 lines
1.1 KiB
PHP
Raw Normal View History

2026-06-04 21:29:10 +02:00
<?php
namespace App\Factory;
use App\Entity\Rating;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
/**
* @extends PersistentObjectFactory<Rating>
*/
final class RatingFactory extends PersistentObjectFactory
{
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
*
* @todo inject services if required
*/
public function __construct() {}
#[\Override]
public static function class(): string
{
return Rating::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
* @todo add your default values here
*/
#[\Override]
protected function defaults(): array|callable
{
return [
2026-06-05 15:24:19 +02:00
'subject' => RestaurantFactory::new(),
2026-06-04 21:29:10 +02:00
];
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
#[\Override]
protected function initialize(): static
{
return $this
// ->afterInstantiate(function(Rating $rating): void {})
;
}
}