| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Tests\Fixture\Factory\Organization;
- use App\Entity\Organization\Organization;
- use App\Tests\Fixture\Factory\Person\PersonRepository;
- use Zenstruck\Foundry\RepositoryProxy;
- use Zenstruck\Foundry\ModelFactory;
- use Zenstruck\Foundry\Proxy;
- /**
- * @extends ModelFactory<Organization>
- *
- * @phpstan-method Organization|Proxy create(array|callable $attributes = [])
- * @phpstan-method static Organization|Proxy createOne(array $attributes = [])
- * @phpstan-method static Organization|Proxy find(object|array|mixed $criteria)
- * @phpstan-method static Organization|Proxy findOrCreate(array $attributes)
- * @phpstan-method static Organization|Proxy first(string $sortedField = 'id')
- * @phpstan-method static Organization|Proxy last(string $sortedField = 'id')
- * @phpstan-method static Organization|Proxy random(array $attributes = [])
- * @phpstan-method static Organization|Proxy randomOrCreate(array $attributes = []))
- * @phpstan-method static OrganizationRepository|RepositoryProxy repository()
- * @phpstan-method static Organization[]|Proxy[] all()
- * @phpstan-method static Organization[]|Proxy[] createMany(int $number, array|callable $attributes = [])
- * @phpstan-method static Organization[]&Proxy[] createSequence(iterable|callable $sequence)
- * @phpstan-method static Organization[]|Proxy[] findBy(array $attributes)
- * @phpstan-method static Organization[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
- * @phpstan-method static Organization[]|Proxy[] randomSet(int $number, array $attributes = []))
- */
- class OrganizationFactory extends ModelFactory
- {
- /**
- * @see https://github.com/zenstruck/foundry#factories-as-services
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * @see https://github.com/zenstruck/foundry#model-factories
- *
- * @todo add your default values here
- */
- protected function getDefaults(): array
- {
- return [];
- }
- /**
- * @see https://github.com/zenstruck/foundry#initialization
- */
- protected function initialize(): self
- {
- return $this
- // ->afterInstantiate(function(Post $post) {})
- ;
- }
- protected static function getClass(): string
- {
- return Organization::class;
- }
- }
|