EducationStudentFactory.php 2.2 KB

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