CycleFactory.php 2.2 KB

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