for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Loevgaard\SyliusBrandPlugin\Factory;
use Loevgaard\SyliusBrandPlugin\Model\BrandImageInterface;
use Loevgaard\SyliusBrandPlugin\Model\BrandInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
class BrandImageFactory implements BrandImageFactoryInterface
{
/**
* @var FactoryInterface
*/
private $factory;
public function __construct(FactoryInterface $factory)
$this->factory = $factory;
}
* {@inheritdoc}
public function createNew(): BrandImageInterface
/** @var BrandImageInterface $brandImage */
$brandImage = $this->factory->createNew();
return $brandImage;
public function createForBrand(BrandInterface $brand): BrandImageInterface
$brandImage = $this->createNew();
$brandImage->setBrand($brand);