|
|
|
@ -1,35 +1,34 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Factory;
|
|
|
|
|
|
|
|
|
|
use App\Entity\Tournament;
|
|
|
|
|
use App\Repository\TournamentRepository;
|
|
|
|
|
use Zenstruck\Foundry\ModelFactory;
|
|
|
|
|
use Zenstruck\Foundry\Proxy;
|
|
|
|
|
use Zenstruck\Foundry\RepositoryProxy;
|
|
|
|
|
use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @extends ModelFactory<Tournament>
|
|
|
|
|
*
|
|
|
|
|
* @method Tournament|Proxy create(array|callable $attributes = [])
|
|
|
|
|
* @method static Tournament|Proxy createOne(array $attributes = [])
|
|
|
|
|
* @method static Tournament|Proxy find(object|array|mixed $criteria)
|
|
|
|
|
* @method static Tournament|Proxy findOrCreate(array $attributes)
|
|
|
|
|
* @method static Tournament|Proxy first(string $sortedField = 'id')
|
|
|
|
|
* @method static Tournament|Proxy last(string $sortedField = 'id')
|
|
|
|
|
* @method static Tournament|Proxy random(array $attributes = [])
|
|
|
|
|
* @method static Tournament|Proxy randomOrCreate(array $attributes = [])
|
|
|
|
|
* @method Tournament|Proxy create(array|callable $attributes = [])
|
|
|
|
|
* @method static Tournament|Proxy createOne(array $attributes = [])
|
|
|
|
|
* @method static Tournament|Proxy find(object|array|mixed $criteria)
|
|
|
|
|
* @method static Tournament|Proxy findOrCreate(array $attributes)
|
|
|
|
|
* @method static Tournament|Proxy first(string $sortedField = 'id')
|
|
|
|
|
* @method static Tournament|Proxy last(string $sortedField = 'id')
|
|
|
|
|
* @method static Tournament|Proxy random(array $attributes = [])
|
|
|
|
|
* @method static Tournament|Proxy randomOrCreate(array $attributes = [])
|
|
|
|
|
* @method static TournamentRepository|RepositoryProxy repository()
|
|
|
|
|
* @method static Tournament[]|Proxy[] all()
|
|
|
|
|
* @method static Tournament[]|Proxy[] createMany(int $number, array|callable $attributes = [])
|
|
|
|
|
* @method static Tournament[]|Proxy[] createSequence(iterable|callable $sequence)
|
|
|
|
|
* @method static Tournament[]|Proxy[] findBy(array $attributes)
|
|
|
|
|
* @method static Tournament[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
|
|
|
|
|
* @method static Tournament[]|Proxy[] randomSet(int $number, array $attributes = [])
|
|
|
|
|
* @method static Tournament[]|Proxy[] all()
|
|
|
|
|
* @method static Tournament[]|Proxy[] createMany(int $number, array|callable $attributes = [])
|
|
|
|
|
* @method static Tournament[]|Proxy[] createSequence(iterable|callable $sequence)
|
|
|
|
|
* @method static Tournament[]|Proxy[] findBy(array $attributes)
|
|
|
|
|
* @method static Tournament[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
|
|
|
|
|
* @method static Tournament[]|Proxy[] randomSet(int $number, array $attributes = [])
|
|
|
|
|
*/
|
|
|
|
|
final class TournamentFactory extends ModelFactory
|
|
|
|
|
final class TournamentFactory extends PersistentProxyObjectFactory
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
|
|
|
|
|
*
|
|
|
|
|
* @todo inject services if required
|
|
|
|
@ -40,29 +39,30 @@ final class TournamentFactory extends ModelFactory
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
|
|
|
|
|
*
|
|
|
|
|
* @todo add your default values here
|
|
|
|
|
*/
|
|
|
|
|
protected function getDefaults(): array
|
|
|
|
|
protected function defaults(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'name' => self::faker()->text(255),
|
|
|
|
|
'startDate' => self::faker()->dateTime(),
|
|
|
|
|
'startDate' => self::faker()->dateTime()
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
|
|
|
|
|
*/
|
|
|
|
|
protected function initialize(): self
|
|
|
|
|
{
|
|
|
|
|
return $this
|
|
|
|
|
// ->afterInstantiate(function(Tournament $tournament): void {})
|
|
|
|
|
;
|
|
|
|
|
return $this;
|
|
|
|
|
// ->afterInstantiate(function(Tournament $tournament): void {})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected static function getClass(): string
|
|
|
|
|
public static function class(): string
|
|
|
|
|
{
|
|
|
|
|
return Tournament::class;
|
|
|
|
|
}
|
|
|
|
|