<?php

namespace domain\Product\Product;

use domain\_\AbstractManager;
use domain\Product\Accessory\Accessory;
use domain\Product\ProductAccessory\ProductAccessoryManager;

class ProductManager extends AbstractManager
{
    protected ProductAccessoryManager $productAccessoryManager;

    public function loadDependencies(): void
    {
        $this->productAccessoryManager = $this->loadService(ProductAccessoryManager::class);
    }

    public function needAccessory(Product $product, Accessory $accessory, int $quantity): void
    {
        $this->productAccessoryManager->createProductAccessoryIfNotExist($product, $accessory, $quantity);
    }
}