c
This commit is contained in:
@@ -3,52 +3,16 @@
|
||||
namespace Hura8\Components\Product\AdminController;
|
||||
|
||||
use Hura8\Components\Product\Controller\bProductCategoryController;
|
||||
use Hura8\Interfaces\AppResponse;
|
||||
use Hura8\Components\Product\Model\ProductCategoryInfoModel;
|
||||
use Hura8\Interfaces\iEntityAdminCategoryController;
|
||||
use Hura8\Traits\AdminEntityCategoryControllerTraits;
|
||||
|
||||
|
||||
class AProductCategoryController extends bProductCategoryController implements iEntityAdminCategoryController
|
||||
class AProductCategoryController extends bProductCategoryController
|
||||
{
|
||||
|
||||
use AdminEntityCategoryControllerTraits;
|
||||
|
||||
|
||||
public function updateItemCount($id) {
|
||||
$this->objProductCategoryModel->updateItemCount($id);
|
||||
}
|
||||
|
||||
|
||||
public function getAttributeList($catId) {
|
||||
return $this->objProductCategoryModel->getAttributeList($catId);
|
||||
}
|
||||
|
||||
|
||||
public function create(array $info) : AppResponse
|
||||
{
|
||||
$res = parent::create($info);
|
||||
|
||||
if($res->getStatus() == 'ok') {
|
||||
$objProductCategoryInfoModel = new ProductCategoryInfoModel();
|
||||
$objProductCategoryInfoModel->createInfo($res->getData(), $info);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
public function update($id, array $info) : AppResponse
|
||||
{
|
||||
if(!$this->isDefaultLanguage()) {
|
||||
return parent::update($id, $info);
|
||||
}
|
||||
|
||||
// update info
|
||||
$objProductCategoryInfoModel = new ProductCategoryInfoModel();
|
||||
$objProductCategoryInfoModel->updateInfo($id, $info);
|
||||
|
||||
return parent::update($id, $info);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user