belongs to many external catalogs & catalogs
This commit is contained in:
@@ -54,9 +54,8 @@ class ExternalProductCatalogsTable extends Table
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->belongsTo('ProductCatalogs', [
|
||||
'foreignKey' => 'product_catalog_id',
|
||||
'joinType' => 'INNER',
|
||||
$this->belongsToMany('ProductCatalogs', [
|
||||
'through' => 'CakeProducts.ExternalProductCatalogsProductCatalogs',
|
||||
'className' => 'CakeProducts.ProductCatalogs',
|
||||
]);
|
||||
}
|
||||
@@ -91,11 +90,6 @@ class ExternalProductCatalogsTable extends Table
|
||||
->dateTime('deleted')
|
||||
->allowEmptyDateTime('deleted');
|
||||
|
||||
$validator
|
||||
->boolean('enabled')
|
||||
->requirePresence('enabled', 'create')
|
||||
->notEmptyString('enabled');
|
||||
|
||||
return $validator;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ class ProductCatalogsTable extends Table
|
||||
$this->hasMany('ProductCategories', [
|
||||
'className' => 'CakeProducts.ProductCategories',
|
||||
]);
|
||||
$this->hasMany('ExternalProductCatalogs', [
|
||||
$this->belongsToMany('ExternalProductCatalogs', [
|
||||
'through' => 'CakeProducts.ExternalProductCatalogsProductCatalogs',
|
||||
'className' => 'CakeProducts.ExternalProductCatalogs',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user