|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\UX\Autocomplete\Tests\Fixtures\Factory; |
| 13 | + |
| 14 | +use Doctrine\ORM\EntityRepository; |
| 15 | +use Symfony\UX\Autocomplete\Tests\Fixtures\Entity\CategoryTag; |
| 16 | +use Zenstruck\Foundry\ModelFactory; |
| 17 | +use Zenstruck\Foundry\Proxy; |
| 18 | +use Zenstruck\Foundry\RepositoryProxy; |
| 19 | + |
| 20 | +/** |
| 21 | + * @extends ModelFactory<CategoryTag> |
| 22 | + * |
| 23 | + * @method static CategoryTag|Proxy createOne(array $attributes = []) |
| 24 | + * @method static CategoryTag[]|Proxy[] createMany(int $number, array|callable $attributes = []) |
| 25 | + * @method static CategoryTag|Proxy find(object|array|mixed $criteria) |
| 26 | + * @method static CategoryTag|Proxy findOrCreate(array $attributes) |
| 27 | + * @method static CategoryTag|Proxy first(string $sortedField = 'id') |
| 28 | + * @method static CategoryTag|Proxy last(string $sortedField = 'id') |
| 29 | + * @method static CategoryTag|Proxy random(array $attributes = []) |
| 30 | + * @method static CategoryTag|Proxy randomOrCreate(array $attributes = []) |
| 31 | + * @method static CategoryTag[]|Proxy[] all() |
| 32 | + * @method static CategoryTag[]|Proxy[] findBy(array $attributes) |
| 33 | + * @method static CategoryTag[]|Proxy[] randomSet(int $number, array $attributes = []) |
| 34 | + * @method static CategoryTag[]|Proxy[] randomRange(int $min, int $max, array $attributes = []) |
| 35 | + * @method static EntityRepository|RepositoryProxy repository() |
| 36 | + * @method CategoryTag|Proxy create(array|callable $attributes = []) |
| 37 | + */ |
| 38 | +final class CategoryTagFactory extends ModelFactory |
| 39 | +{ |
| 40 | + protected function getDefaults(): array |
| 41 | + { |
| 42 | + return [ |
| 43 | + 'name' => self::faker()->word(), |
| 44 | + ]; |
| 45 | + } |
| 46 | + |
| 47 | + protected function initialize(): self |
| 48 | + { |
| 49 | + return $this; |
| 50 | + } |
| 51 | + |
| 52 | + protected static function getClass(): string |
| 53 | + { |
| 54 | + return CategoryTag::class; |
| 55 | + } |
| 56 | +} |
0 commit comments