<?php

namespace Hura8\Components\Product\AdminController;

use Hura8\Components\Product\Model\ProductAttributeModel;
use Hura8\Components\Product\Model\ProductSpecGroupModel;
use Hura8\System\Controller\aAdminEntityBaseController;

class AProductSpecGroupController extends aAdminEntityBaseController
{
    /* @var ProductSpecGroupModel $objProductSpecGroupModel */
    protected  $objProductSpecGroupModel;

    public function __construct()
    {
        $this->objProductSpecGroupModel = new ProductSpecGroupModel();
        parent::__construct($this->objProductSpecGroupModel);
    }

    public function getSpecGroupAttributeWithValues($group_id)
    {
        $objProductAttributeModel = new ProductAttributeModel();
        return $objProductAttributeModel->getSpecGroupAttributeWithValues($group_id);
    }

    public function getSpecGroupAttribute($group_id)
    {
        $objProductAttributeModel = new ProductAttributeModel();
        return $objProductAttributeModel->getSpecGroupAttribute($group_id);
    }


    public function clearProductSpecGroup($product_id)
    {
        return $this->objProductSpecGroupModel->clearProductSpecGroup($product_id);
    }


    public function setProductSpecGroup($product_id, $group_id)
    {
        return $this->objProductSpecGroupModel->setProductSpecGroup($product_id, $group_id);
    }


    public function getProductSpec($product_id)
    {
        return $this->objProductSpecGroupModel->getProductSpec($product_id);
    }


    public function getProductSpecGroupInfo($product_id)
    {
        return $this->objProductSpecGroupModel->getProductSpecGroupInfo($product_id);
    }


    public function getProductSpecGroupId($product_id)
    {
        return $this->objProductSpecGroupModel->getProductSpecGroupId($product_id);
    }


    public function getSpecGroupInfo($group_id)
    {
        return $this->objProductSpecGroupModel->getSpecGroupInfo($group_id);
    }


    protected function deleteFileBeforeDeleteItem($item_id): bool
    {
        return true;
    }

}
