<?php

namespace App\Factory;

use App\Entity\Contact;
use App\Entity\ContactPartnerProduct;
use App\Repository\ContactPartnerProductRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;

/**
 * @extends ModelFactory<ContactPartnerProduct>
 *
 * @method        ContactPartnerProduct|Proxy                     create(array|callable $attributes = [])
 * @method static ContactPartnerProduct|Proxy                     createOne(array $attributes = [])
 * @method static ContactPartnerProduct|Proxy                     find(object|array|mixed $criteria)
 * @method static ContactPartnerProduct|Proxy                     findOrCreate(array $attributes)
 * @method static ContactPartnerProduct|Proxy                     first(string $sortedField = 'id')
 * @method static ContactPartnerProduct|Proxy                     last(string $sortedField = 'id')
 * @method static ContactPartnerProduct|Proxy                     random(array $attributes = [])
 * @method static ContactPartnerProduct|Proxy                     randomOrCreate(array $attributes = [])
 * @method static ContactPartnerProductRepository|RepositoryProxy repository()
 * @method static ContactPartnerProduct[]|Proxy[]                 all()
 * @method static ContactPartnerProduct[]|Proxy[]                 createMany(int $number, array|callable $attributes = [])
 * @method static ContactPartnerProduct[]|Proxy[]                 createSequence(iterable|callable $sequence)
 * @method static ContactPartnerProduct[]|Proxy[]                 findBy(array $attributes)
 * @method static ContactPartnerProduct[]|Proxy[]                 randomRange(int $min, int $max, array $attributes = [])
 * @method static ContactPartnerProduct[]|Proxy[]                 randomSet(int $number, array $attributes = [])
 */
final class ContactPartnerProductFactory 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 [
            'contact' => ContactFactory::new(),
            'createdAt' => \DateTimeImmutable::createFromMutable(self::faker()->dateTime()),
            'partnerProduct' => PartnerProductFactory::new(),
        ];
    }

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

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