use override table trait to allow for easily customzing table a controller uses
This commit is contained in:
@@ -10,8 +10,8 @@ use Cake\Log\Log;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\ORM\TableRegistry;
|
||||
use CakeProducts\Controller\AppController;
|
||||
use CakeProducts\Controller\Traits\OverrideTableTrait;
|
||||
use CakeProducts\Model\Table\ProductCatalogsTable;
|
||||
use CakeProducts\Service\CatalogManagerService;
|
||||
|
||||
/**
|
||||
* ProductCatalogs Controller
|
||||
@@ -20,7 +20,17 @@ use CakeProducts\Service\CatalogManagerService;
|
||||
*/
|
||||
class ProductCatalogsController extends AppController
|
||||
{
|
||||
protected ?Table $_table = null;
|
||||
use OverrideTableTrait;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(): void
|
||||
{
|
||||
parent::initialize(); // TODO: Change the autogenerated stub
|
||||
$this->_defaultTable = 'CakeProducts.ProductCatalogs';
|
||||
$this->_tableConfigKey = 'CakeProducts.ProductCatalogs.table';
|
||||
}
|
||||
|
||||
/**
|
||||
* Index method
|
||||
|
||||
Reference in New Issue
Block a user