<?php


namespace ModulesGarden\HostingQuotaNotifications\App\Helper\Migration\Groups;

use ModulesGarden\HostingQuotaNotifications\App\Libs\ProductGroups\Manage;


/**
 * Class ProductGroup
 *
 * @author Artur Pilch <artur.pi@modulesgarden.com>
 */
class ProductGroup
{
    public static function migrateProductToGroup($groupId, $products)
    {
        $productsOut = [];
        foreach ($products as $product)
        {
            array_push($productsOut, $product->pid);
        }
        Manage::saveRelations($groupId, $productsOut, false);
    }
}