59 lines
1.5 KiB
PHP
59 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Factory;
|
|
|
|
use App\Entity\OperativeSystem;
|
|
use App\Repository\OperativeSystemRepository;
|
|
use Zenstruck\Foundry\ModelFactory;
|
|
use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory;
|
|
use Zenstruck\Foundry\Persistence\Proxy;
|
|
use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator;
|
|
|
|
/**
|
|
* @extends PersistentProxyObjectFactory<OperativeSystem>
|
|
*/
|
|
final class OperativeSystemFactory extends ModelFactory
|
|
{
|
|
/**
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public static function class(): string
|
|
{
|
|
return OperativeSystem::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(),
|
|
'name' => self::faker()->text(255),
|
|
'updatedAt' => self::faker()->dateTime(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
|
|
*/
|
|
protected function initialize(): self
|
|
{
|
|
return $this
|
|
// ->afterInstantiate(function(OperativeSystem $operativeSystem): void {})
|
|
;
|
|
}
|
|
|
|
protected static function getClass(): string
|
|
{
|
|
return OperativeSystem::class;
|
|
}
|
|
}
|