60 lines
1.6 KiB
PHP
60 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Factory;
|
|
|
|
use App\Entity\HardwareProfile;
|
|
use App\Model\OrganizationalUnitTypes;
|
|
use Zenstruck\Foundry\ModelFactory;
|
|
use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory;
|
|
|
|
/**
|
|
* @extends ModelFactory<HardwareProfile>
|
|
*/
|
|
final class HardwareProfileFactory extends ModelFactory
|
|
{
|
|
/**
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
|
|
*
|
|
* @todo inject services if required
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public static function class(): string
|
|
{
|
|
return HardwareProfile::class;
|
|
}
|
|
|
|
/**
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
|
|
*
|
|
* @todo add your default values here
|
|
*/
|
|
protected function getDefaults(): array
|
|
{
|
|
return [
|
|
'createdAt' => self::faker()->dateTime(),
|
|
'updatedAt' => self::faker()->dateTime(),
|
|
'description' => self::faker()->text(255),
|
|
'organizationalUnit' => OrganizationalUnitFactory::createOne(['type' => OrganizationalUnitTypes::ORGANIZATIONAL_UNIT])->_save(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
|
|
*/
|
|
protected function initialize(): self
|
|
{
|
|
return $this
|
|
// ->afterInstantiate(function(HardwareProfile $hardwareProfile): void {})
|
|
;
|
|
}
|
|
|
|
protected static function getClass(): string
|
|
{
|
|
return HardwareProfile::class;
|
|
}
|
|
}
|