64 lines
1.7 KiB
PHP
64 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Factory;
|
|
|
|
use App\Entity\Partition;
|
|
use App\Repository\PartitionRepository;
|
|
use Zenstruck\Foundry\ModelFactory;
|
|
use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory;
|
|
use Zenstruck\Foundry\Persistence\Proxy;
|
|
use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator;
|
|
|
|
/**
|
|
* @extends PersistentProxyObjectFactory<Partition>
|
|
*/
|
|
final class PartitionFactory 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 Partition::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(),
|
|
'memoryUsage' => self::faker()->randomNumber(),
|
|
'size' => self::faker()->randomNumber(),
|
|
'updatedAt' => self::faker()->dateTime(),
|
|
'operativeSystem' => OperativeSystemFactory::new(),
|
|
'client' => ClientFactory::new(),
|
|
'image' => ImageFactory::new(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
|
|
*/
|
|
protected function initialize(): self
|
|
{
|
|
return $this// ->afterInstantiate(function(Partition $partition): void {})
|
|
;
|
|
}
|
|
|
|
protected static function getClass(): string
|
|
{
|
|
return Partition::class;
|
|
}
|
|
}
|