<?php

namespace App\Factory;

use App\Entity\PartnerProduct;
use App\Repository\PartnerProductRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;

/**
 * @extends ModelFactory<PartnerProduct>
 *
 * @method        PartnerProduct|Proxy                     create(array|callable $attributes = [])
 * @method static PartnerProduct|Proxy                     createOne(array $attributes = [])
 * @method static PartnerProduct|Proxy                     find(object|array|mixed $criteria)
 * @method static PartnerProduct|Proxy                     findOrCreate(array $attributes)
 * @method static PartnerProduct|Proxy                     first(string $sortedField = 'id')
 * @method static PartnerProduct|Proxy                     last(string $sortedField = 'id')
 * @method static PartnerProduct|Proxy                     random(array $attributes = [])
 * @method static PartnerProduct|Proxy                     randomOrCreate(array $attributes = [])
 * @method static PartnerProductRepository|RepositoryProxy repository()
 * @method static PartnerProduct[]|Proxy[]                 all()
 * @method static PartnerProduct[]|Proxy[]                 createMany(int $number, array|callable $attributes = [])
 * @method static PartnerProduct[]|Proxy[]                 createSequence(iterable|callable $sequence)
 * @method static PartnerProduct[]|Proxy[]                 findBy(array $attributes)
 * @method static PartnerProduct[]|Proxy[]                 randomRange(int $min, int $max, array $attributes = [])
 * @method static PartnerProduct[]|Proxy[]                 randomSet(int $number, array $attributes = [])
 */
final class PartnerProductFactory extends ModelFactory
{
    /**
     * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
     *
     * @todo inject services if required
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
     *
     * @todo add your default values here
     */
    protected function getDefaults(): array
    {
        return [
            'createdAt' => \DateTimeImmutable::createFromMutable(self::faker()->dateTime()),
            'partner' => PartnerFactory::new(),
            'product' => ProductFactory::new(),
        ];
    }

    /**
     * @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
     */
    protected function initialize(): self
    {
        return $this
            // ->afterInstantiate(function(PartnerProduct $partnerProduct): void {})
        ;
    }

    protected static function getClass(): string
    {
        return PartnerProduct::class;
    }
}
