from main app code base
This commit is contained in:
@@ -3,12 +3,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeProducts\Controller;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Datasource\Exception\RecordNotFoundException;
|
||||
use Cake\Http\Response;
|
||||
use Cake\Log\Log;
|
||||
use CakeProducts\Controller\AppController;
|
||||
use CakeProducts\Model\Table\ProductCatalogsTable;
|
||||
use CakeProducts\Service\InternalCatalogManagerService;
|
||||
use CakeProducts\Service\CatalogManagerService;
|
||||
|
||||
/**
|
||||
* ProductCatalogs Controller
|
||||
@@ -37,9 +38,13 @@ class ProductCatalogsController extends AppController
|
||||
* @return Response|null|void Renders view
|
||||
* @throws RecordNotFoundException When record not found.
|
||||
*/
|
||||
public function view(InternalCatalogManagerService $catalogManagerService, $id = null)
|
||||
public function view($id = null)
|
||||
{
|
||||
$productCatalog = $catalogManagerService->getCatalog($id);
|
||||
$contain = ['ProductCategories'];
|
||||
if (Configure::read('CakeProducts.internal.syncExternally', false)) {
|
||||
$contain[] = 'ExternalProductCatalogs';
|
||||
}
|
||||
$productCatalog = $this->ProductCatalogs->get($id, contain: $contain);
|
||||
$this->set(compact('productCatalog'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user