diff --git a/composer.json b/composer.json index 829e032..7eea7f9 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,7 @@ "require": { "php": ">=8.1", "dereuromark/cakephp-tools": "^3.9", + "hi-powered-dev/cheese-cake": "^0.0.6", "cakephp/migrations": "^4.0.0", "cakephp/cakephp": "^5.0.1" }, diff --git a/src/Controller/ExternalProductCatalogsController.php b/src/Controller/ExternalProductCatalogsController.php index 1729cca..d23d9dc 100644 --- a/src/Controller/ExternalProductCatalogsController.php +++ b/src/Controller/ExternalProductCatalogsController.php @@ -8,7 +8,7 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use CakeProducts\Controller\AppController; -use CakeProducts\Controller\Traits\OverrideTableTrait; +use CheeseCake\Controller\Traits\OverrideTableTrait; /** * ExternalProductCatalogs Controller diff --git a/src/Controller/ProductCatalogsController.php b/src/Controller/ProductCatalogsController.php index 9867c9c..c3af13e 100644 --- a/src/Controller/ProductCatalogsController.php +++ b/src/Controller/ProductCatalogsController.php @@ -10,7 +10,8 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use CakeProducts\Controller\AppController; -use CakeProducts\Controller\Traits\OverrideTableTrait; +use CheeseCake\Controller\Traits\OverrideTableTrait; +; use CakeProducts\Model\Table\ProductCatalogsTable; /** diff --git a/src/Controller/ProductCategoriesController.php b/src/Controller/ProductCategoriesController.php index 0bdb51e..848f7a6 100644 --- a/src/Controller/ProductCategoriesController.php +++ b/src/Controller/ProductCategoriesController.php @@ -8,7 +8,8 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use Cake\Utility\Text; -use CakeProducts\Controller\Traits\OverrideTableTrait; +use CheeseCake\Controller\Traits\OverrideTableTrait; +; /** * ProductCategories Controller diff --git a/src/Controller/ProductCategoryAttributeOptionsController.php b/src/Controller/ProductCategoryAttributeOptionsController.php index b39554b..93c9dfb 100644 --- a/src/Controller/ProductCategoryAttributeOptionsController.php +++ b/src/Controller/ProductCategoryAttributeOptionsController.php @@ -8,7 +8,8 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use CakeProducts\Controller\AppController; -use CakeProducts\Controller\Traits\OverrideTableTrait; +use CheeseCake\Controller\Traits\OverrideTableTrait; +; /** * ProductCategoryAttributeOptions Controller diff --git a/src/Controller/ProductCategoryAttributesController.php b/src/Controller/ProductCategoryAttributesController.php index d46cc5e..58adeac 100644 --- a/src/Controller/ProductCategoryAttributesController.php +++ b/src/Controller/ProductCategoryAttributesController.php @@ -10,7 +10,8 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use CakeProducts\Controller\AppController; -use CakeProducts\Controller\Traits\OverrideTableTrait; +use CheeseCake\Controller\Traits\OverrideTableTrait; +; use CakeProducts\Model\Enum\ProductCategoryAttributeTypeId; use CakeProducts\Model\Table\ProductCategoryAttributesTable; diff --git a/src/Controller/ProductsController.php b/src/Controller/ProductsController.php index 871617d..684ee15 100644 --- a/src/Controller/ProductsController.php +++ b/src/Controller/ProductsController.php @@ -8,7 +8,8 @@ use Cake\Log\Log; use Cake\ORM\Table; use Cake\ORM\TableRegistry; use CakeProducts\Controller\AppController; -use CakeProducts\Controller\Traits\OverrideTableTrait; +use CheeseCake\Controller\Traits\OverrideTableTrait; +; /** * Products Controller diff --git a/src/Controller/Traits/OverrideTableTrait.php b/src/Controller/Traits/OverrideTableTrait.php deleted file mode 100644 index c02ab2a..0000000 --- a/src/Controller/Traits/OverrideTableTrait.php +++ /dev/null @@ -1,70 +0,0 @@ -_table instanceof Table) { - return $this->_table; - } - $this->getTableConfigKey(); - $table = $tableName; - if (!isset($table)) { - $table = $this->defaultTable; - if (Configure::read($this->_tableConfigKey)) { - $table = Configure::read($this->_tableConfigKey); - } - } - $this->_table = TableRegistry::getTableLocator()->get($table); - - return $this->_table; - } - - protected function getTableConfigKey() - { - if (!$this->_tableConfigKey) { - $this->_tableConfigKey = $this->getPlugin() . '.' . $this->defaultTable . '.table'; - } - - return $this->_tableConfigKey; - } - - /** - * Set the users table - * - * @param Table $table table - * @return void - */ - public function setTable(Table $table) - { - $this->_table = $table; - } -} \ No newline at end of file