ResidenceAreaFactory.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Tests\Fixture\Factory\Billing;
  3. use Zenstruck\Foundry\ModelFactory;
  4. use App\Entity\Billing\ResidenceArea;
  5. /**
  6. * @extends ModelFactory<ResidenceArea>
  7. *
  8. * @phpstan-method ResidenceArea|Proxy create(array|callable $attributes = [])
  9. * @phpstan-method static ResidenceArea|Proxy createOne(array $attributes = [])
  10. * @phpstan-method static ResidenceArea|Proxy find(object|array|mixed $criteria)
  11. * @phpstan-method static ResidenceArea|Proxy findOrCreate(array $attributes)
  12. * @phpstan-method static ResidenceArea|Proxy first(string $sortedField = 'id')
  13. * @phpstan-method static ResidenceArea|Proxy last(string $sortedField = 'id')
  14. * @phpstan-method static ResidenceArea|Proxy random(array $attributes = [])
  15. * @phpstan-method static ResidenceArea|Proxy randomOrCreate(array $attributes = []))
  16. * @phpstan-method static ResidenceAreaRepository|RepositoryProxy repository()
  17. * @phpstan-method static ResidenceArea[]|Proxy[] all()
  18. * @phpstan-method static ResidenceArea[]|Proxy[] createMany(int $number, array|callable $attributes = [])
  19. * @phpstan-method static ResidenceArea[]&Proxy[] createSequence(iterable|callable $sequence)
  20. * @phpstan-method static ResidenceArea[]|Proxy[] findBy(array $attributes)
  21. * @phpstan-method static ResidenceArea[]|Proxy[] randomRange(int $min, int $max, array $attributes = []))
  22. * @phpstan-method static ResidenceArea[]|Proxy[] randomSet(int $number, array $attributes = []))
  23. */
  24. class ResidenceAreaFactory extends ModelFactory
  25. {
  26. /**
  27. * @see https://github.com/zenstruck/foundry#factories-as-services
  28. */
  29. public function __construct()
  30. {
  31. parent::__construct();
  32. }
  33. /**
  34. * @see https://github.com/zenstruck/foundry#model-factories
  35. *
  36. * @todo add your default values here
  37. */
  38. protected function getDefaults(): array
  39. {
  40. return [];
  41. }
  42. /**
  43. * @see https://github.com/zenstruck/foundry#initialization
  44. */
  45. protected function initialize(): self
  46. {
  47. return $this
  48. // ->afterInstantiate(function(Post $post) {})
  49. ;
  50. }
  51. protected static function getClass(): string
  52. {
  53. return ResidenceArea::class;
  54. }
  55. }