diff --git a/src/Model/Table/ProductCatalogsTable.php b/src/Model/Table/ProductCatalogsTable.php index f7c4919..37be575 100644 --- a/src/Model/Table/ProductCatalogsTable.php +++ b/src/Model/Table/ProductCatalogsTable.php @@ -47,6 +47,9 @@ class ProductCatalogsTable extends Table $this->setDisplayField('name'); $this->setPrimaryKey('id'); + $this->setEntityClass( + Configure::read('CakeProducts.ProductCatalogs.entity', 'CakeProducts\Model\Entity\ProductCatalog') + ); $this->hasMany('ProductCategories', [ 'className' => 'CakeProducts.ProductCategories', ]); diff --git a/src/Model/Table/ProductCategoriesTable.php b/src/Model/Table/ProductCategoriesTable.php index f2af56f..782b30a 100644 --- a/src/Model/Table/ProductCategoriesTable.php +++ b/src/Model/Table/ProductCategoriesTable.php @@ -3,6 +3,7 @@ declare(strict_types=1); namespace CakeProducts\Model\Table; +use Cake\Core\Configure; use Cake\Datasource\EntityInterface; use Cake\Datasource\ResultSetInterface; use Cake\ORM\Association\BelongsTo; @@ -61,7 +62,9 @@ class ProductCategoriesTable extends Table $this->setTable('product_categories'); $this->setDisplayField('name'); $this->setPrimaryKey('id'); - + $this->setEntityClass( + Configure::read('CakeProducts.ProductCategories.entity', 'CakeProducts\Model\Entity\ProductCategory') + ); $this->addBehavior('Tree'); $this->belongsTo('ProductCatalogs', [