From 134e23bf983bc9e9d4b714709001db803f9fd623 Mon Sep 17 00:00:00 2001 From: Brandon Shipley Date: Sat, 22 Aug 2026 02:47:36 -0700 Subject: [PATCH] stan fixes --- composer.json | 4 +- .../20241114080900_CreateProductCatalogs.php | 4 +- ...20241114081036_CreateProductCategories.php | 4 +- .../20241114090547_CreateProducts.php | 4 +- ...054627_CreateProductCategoryAttributes.php | 4 +- ..._CreateProductCategoryAttributeOptions.php | 4 +- ...22070040_CreateExternalProductCatalogs.php | 4 +- ...29054627_CreateProductCategoryVariants.php | 4 +- phpstan.neon | 10 +++++ .../ExternalProductCatalogsController.php | 26 ++++++------- .../ProductCategoryAttributesController.php | 4 +- .../ProductCategoryVariantsController.php | 2 +- src/Controller/ProductPhotosController.php | 11 +++--- src/Controller/ProductVariantsController.php | 2 +- src/Controller/ProductsController.php | 2 - .../Entity/ProductCategoryVariantOption.php | 2 +- src/Model/Entity/ProductVariant.php | 4 +- .../Enum/ProductCategoryAttributeTypeId.php | 30 ++++++++------- src/Model/Enum/ProductProductTypeId.php | 37 ++++++++++--------- ...nalProductCatalogsProductCatalogsTable.php | 15 +++----- .../Table/ExternalProductCatalogsTable.php | 14 +++---- src/Model/Table/ProductAttributesTable.php | 32 ++++++++-------- src/Model/Table/ProductCatalogsTable.php | 10 ++--- src/Model/Table/ProductCategoriesTable.php | 24 +++++------- .../ProductCategoryAttributeOptionsTable.php | 12 ++---- .../Table/ProductCategoryAttributesTable.php | 18 ++++----- .../ProductCategoryVariantOptionsTable.php | 15 +++----- .../Table/ProductCategoryVariantsTable.php | 23 +++++------- src/Model/Table/ProductPhotosTable.php | 16 +++----- .../Table/ProductSkuVariantValuesTable.php | 16 +++----- src/Model/Table/ProductSkusTable.php | 14 +++---- src/Model/Table/ProductVariantsTable.php | 14 +++---- src/Model/Table/ProductsTable.php | 12 ++---- 33 files changed, 179 insertions(+), 218 deletions(-) create mode 100644 phpstan.neon diff --git a/composer.json b/composer.json index 5a68c45..54d1941 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "bentools/cartesian-product": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^10.1", + "phpunit/phpunit": "^10.3", "cakephp/migrations": "^4.0.0", "cakedc/cakephp-phpstan": "^4.1", "dereuromark/composer-prefer-lowest": "^0.1.10", @@ -47,7 +47,7 @@ }, "config": { "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": false } } } diff --git a/config/Migrations/20241114080900_CreateProductCatalogs.php b/config/Migrations/20241114080900_CreateProductCatalogs.php index 06c23fb..6a61d9b 100644 --- a/config/Migrations/20241114080900_CreateProductCatalogs.php +++ b/config/Migrations/20241114080900_CreateProductCatalogs.php @@ -1,9 +1,9 @@ _defaultTable = 'CakeProducts.ExternalProductCatalogs'; -// $this->_tableConfigKey = 'CakeProducts.ExternalProductCatalogs.table'; } /** @@ -29,7 +27,7 @@ class ExternalProductCatalogsController extends AppController { * @return \Cake\Http\Response|null|void Renders view */ public function index() { - $query = $this->ExternalProductCatalogs->find() + $query = $this->fetchTable()->find() ->contain(['ProductCatalogs']); $externalProductCatalogs = $this->paginate($query); @@ -44,7 +42,7 @@ class ExternalProductCatalogsController extends AppController { * @return \Cake\Http\Response|null|void Renders view */ public function view($id = null) { - $externalProductCatalog = $this->ExternalProductCatalogs->get($id, contain: ['ProductCatalogs']); + $externalProductCatalog = $this->fetchTable()->get($id, contain: ['ProductCatalogs']); $this->set(compact('externalProductCatalog')); } @@ -54,7 +52,7 @@ class ExternalProductCatalogsController extends AppController { * @return \Cake\Http\Response|null|void Redirects on successful add, renders view otherwise. */ public function add() { - $externalProductCatalog = $this->ExternalProductCatalogs->newEmptyEntity(); + $externalProductCatalog = $this->fetchTable()->newEmptyEntity(); if ($this->request->is('post')) { $saveOptions = [ 'associated' => [ @@ -64,8 +62,8 @@ class ExternalProductCatalogsController extends AppController { $postData = $this->request->getData(); Log::debug(print_r('$postData', true)); Log::debug(print_r($postData, true)); - $externalProductCatalog = $this->ExternalProductCatalogs->patchEntity($externalProductCatalog, $postData, $saveOptions); - if ($this->ExternalProductCatalogs->save($externalProductCatalog, $saveOptions)) { + $externalProductCatalog = $this->fetchTable()->patchEntity($externalProductCatalog, $postData, $saveOptions); + if ($this->fetchTable()->save($externalProductCatalog, $saveOptions)) { $this->Flash->success(__('The external product catalog has been saved.')); return $this->redirect(['action' => 'index']); @@ -74,7 +72,7 @@ class ExternalProductCatalogsController extends AppController { Log::debug(print_r($externalProductCatalog->getErrors(), true)); $this->Flash->error(__('The external product catalog could not be saved. Please, try again.')); } - $productCatalogs = $this->ExternalProductCatalogs->ProductCatalogs->find('list', limit: 200)->all(); + $productCatalogs = $this->fetchTable()->ProductCatalogs->find('list', limit: 200)->all(); $this->set(compact('externalProductCatalog', 'productCatalogs')); } @@ -86,10 +84,10 @@ class ExternalProductCatalogsController extends AppController { * @return \Cake\Http\Response|null|void Redirects on successful edit, renders view otherwise. */ public function edit($id = null) { - $externalProductCatalog = $this->ExternalProductCatalogs->get($id, contain: []); + $externalProductCatalog = $this->fetchTable()->get($id, contain: []); if ($this->request->is(['patch', 'post', 'put'])) { - $externalProductCatalog = $this->ExternalProductCatalogs->patchEntity($externalProductCatalog, $this->request->getData()); - if ($this->ExternalProductCatalogs->save($externalProductCatalog)) { + $externalProductCatalog = $this->fetchTable()->patchEntity($externalProductCatalog, $this->request->getData()); + if ($this->fetchTable()->save($externalProductCatalog)) { $this->Flash->success(__('The external product catalog has been saved.')); return $this->redirect(['action' => 'index']); @@ -98,7 +96,7 @@ class ExternalProductCatalogsController extends AppController { Log::debug(print_r($externalProductCatalog->getErrors(), true)); $this->Flash->error(__('The external product catalog could not be saved. Please, try again.')); } - $productCatalogs = $this->ExternalProductCatalogs->ProductCatalogs->find('list', limit: 200)->all(); + $productCatalogs = $this->fetchTable()->ProductCatalogs->find('list', limit: 200)->all(); $this->set(compact('externalProductCatalog', 'productCatalogs')); } @@ -111,8 +109,8 @@ class ExternalProductCatalogsController extends AppController { */ public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); - $externalProductCatalog = $this->ExternalProductCatalogs->get($id); - if ($this->ExternalProductCatalogs->delete($externalProductCatalog)) { + $externalProductCatalog = $this->fetchTable()->get($id); + if ($this->fetchTable()->delete($externalProductCatalog)) { $this->Flash->success(__('The external product catalog has been deleted.')); } else { $this->Flash->error(__('The external product catalog could not be deleted. Please, try again.')); diff --git a/src/Controller/ProductCategoryAttributesController.php b/src/Controller/ProductCategoryAttributesController.php index f0f73c6..b6e588c 100644 --- a/src/Controller/ProductCategoryAttributesController.php +++ b/src/Controller/ProductCategoryAttributesController.php @@ -24,7 +24,7 @@ class ProductCategoryAttributesController extends AppController { /** * Index method * - * @return \Cake\Http\Response|voidRenders|null view + * @return \Cake\Http\Response|null|void Renders view */ public function index() { $query = $this->ProductCategoryAttributes->find() @@ -53,7 +53,7 @@ class ProductCategoryAttributesController extends AppController { /** * Add method * - * @return \Cake\Http\Response|voidRedirects|null on successful add, renders view otherwise. + * @return \Cake\Http\Response|null|void Redirects on successful add, renders view otherwise. */ public function add() { $productCategoryAttributesTable = $this->ProductCategoryAttributes; diff --git a/src/Controller/ProductCategoryVariantsController.php b/src/Controller/ProductCategoryVariantsController.php index 320955d..e74b753 100644 --- a/src/Controller/ProductCategoryVariantsController.php +++ b/src/Controller/ProductCategoryVariantsController.php @@ -8,7 +8,7 @@ use Cake\Log\Log; /** * ProductCategoryVariants Controller * - * @property \App\Model\Table\ProductCategoryVariantsTable $ProductCategoryVariants + * @property CakeProducts\Model\Table\ProductCategoryVariantsTable $ProductCategoryVariants */ class ProductCategoryVariantsController extends AppController { diff --git a/src/Controller/ProductPhotosController.php b/src/Controller/ProductPhotosController.php index c967ea6..1c4b63b 100644 --- a/src/Controller/ProductPhotosController.php +++ b/src/Controller/ProductPhotosController.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace CakeProducts\Controller; use Cake\Core\Configure; -use Cake\Datasource\Exception\RecordNotFoundException; use Cake\Http\Exception\ForbiddenException; use Cake\Utility\Text; @@ -32,7 +31,7 @@ class ProductPhotosController extends AppController { * View method * * @param string|null $id Product Photo id. - * @throws RecordNotFoundException When record not found. + * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. * @return \Cake\Http\Response|null|void Renders view */ public function view($id = null) { @@ -146,7 +145,7 @@ class ProductPhotosController extends AppController { * Edit method * * @param string|null $id Product Photo id. - * @throws RecordNotFoundException When record not found. + * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. * @return Response|null|void Redirects on successful edit, renders view otherwise. */ public function edit($id = null) { @@ -172,7 +171,7 @@ class ProductPhotosController extends AppController { * Delete method * * @param string|null $id Product Photo id. - * @throws RecordNotFoundException When record not found. + * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. * @return Response|null Redirects to index. */ public function delete($id = null) { @@ -190,8 +189,8 @@ class ProductPhotosController extends AppController { } /** - * @param $id - * @return Response + * @param string|null $id + * @return \Cake\Http\Response */ public function image($id = null) { $productPhoto = $this->ProductPhotos->get($id); diff --git a/src/Controller/ProductVariantsController.php b/src/Controller/ProductVariantsController.php index f4e7d80..ed86066 100644 --- a/src/Controller/ProductVariantsController.php +++ b/src/Controller/ProductVariantsController.php @@ -8,7 +8,7 @@ use Cake\Log\Log; /** * ProductVariants Controller * - * @property \App\Model\Table\ProductVariantsTable $ProductVariants + * @property CakeProducts\Model\Table\ProductVariantsTable $ProductVariants */ class ProductVariantsController extends AppController { diff --git a/src/Controller/ProductsController.php b/src/Controller/ProductsController.php index cb63a2d..d076f0f 100644 --- a/src/Controller/ProductsController.php +++ b/src/Controller/ProductsController.php @@ -17,8 +17,6 @@ class ProductsController extends AppController { */ public function initialize(): void { parent::initialize(); // TODO: Change the autogenerated stub -// $this->_defaultTable = 'CakeProducts.Products'; -// $this->_tableConfigKey = 'CakeProducts.Products.table'; } /** diff --git a/src/Model/Entity/ProductCategoryVariantOption.php b/src/Model/Entity/ProductCategoryVariantOption.php index 8221783..f48dcfa 100644 --- a/src/Model/Entity/ProductCategoryVariantOption.php +++ b/src/Model/Entity/ProductCategoryVariantOption.php @@ -15,7 +15,7 @@ use Cake\ORM\Entity; * @property \Cake\I18n\DateTime $modified * @property \Cake\I18n\DateTime|null $deleted * - * @property \App\Model\Entity\ProductCategoryVariant $product_category_variant + * @property CakeProducts\Model\Entity\ProductCategoryVariant $product_category_variant */ class ProductCategoryVariantOption extends Entity { diff --git a/src/Model/Entity/ProductVariant.php b/src/Model/Entity/ProductVariant.php index ffb9cc0..a482c97 100644 --- a/src/Model/Entity/ProductVariant.php +++ b/src/Model/Entity/ProductVariant.php @@ -14,8 +14,8 @@ use Cake\ORM\Entity; * @property string $product_id * @property bool $enabled * - * @property \App\Model\Entity\ProductCategoryVariant $product_category_variant - * @property \App\Model\Entity\Product $product + * @property CakeProducts\Model\Entity\ProductCategoryVariant $product_category_variant + * @property CakeProducts\Model\Entity\Product $product */ class ProductVariant extends Entity { diff --git a/src/Model/Enum/ProductCategoryAttributeTypeId.php b/src/Model/Enum/ProductCategoryAttributeTypeId.php index 2b024c9..7314f2a 100644 --- a/src/Model/Enum/ProductCategoryAttributeTypeId.php +++ b/src/Model/Enum/ProductCategoryAttributeTypeId.php @@ -1,23 +1,25 @@ 'Constrained', - self::Text => 'Text', - self::Integer => 'Integer' - }; - } + /** + * @return string + */ + public function label(): string { + return match ($this) { + ProductCategoryAttributeTypeId::Constrained => 'Constrained', + ProductCategoryAttributeTypeId::Text => 'Text', + ProductCategoryAttributeTypeId::Integer => 'Integer' + }; + } } diff --git a/src/Model/Enum/ProductProductTypeId.php b/src/Model/Enum/ProductProductTypeId.php index 88e1cbc..6edc219 100644 --- a/src/Model/Enum/ProductProductTypeId.php +++ b/src/Model/Enum/ProductProductTypeId.php @@ -1,4 +1,5 @@ 'Service', - self::Product => 'Product', - self::Consumable => 'Consumable', - self::DigitalGood => 'Digital Good', - self::Subscription => 'Subscription', -// self::Event => 'Event', - }; - } + /** + * @return string + */ + public function label(): string { + return match ($this) { + ProductProductTypeId::Service => 'Service', + ProductProductTypeId::Product => 'Product', + ProductProductTypeId::Consumable => 'Consumable', + ProductProductTypeId::DigitalGood => 'Digital Good', + ProductProductTypeId::Subscription => 'Subscription', +// ProductProductTypeId::Event => 'Event', + }; + } } diff --git a/src/Model/Table/ExternalProductCatalogsProductCatalogsTable.php b/src/Model/Table/ExternalProductCatalogsProductCatalogsTable.php index 204a5d4..29837f0 100644 --- a/src/Model/Table/ExternalProductCatalogsProductCatalogsTable.php +++ b/src/Model/Table/ExternalProductCatalogsProductCatalogsTable.php @@ -6,6 +6,7 @@ namespace CakeProducts\Model\Table; use ArrayObject; use Cake\Core\Configure; use Cake\Event\EventInterface; +use Cake\ORM\Behavior\TimestampBehavior; use Cake\ORM\RulesChecker; use Cake\ORM\Table; use Cake\Validation\Validator; @@ -13,22 +14,18 @@ use Cake\Validation\Validator; /** * ExternalProductCatalogsProductCatalogs Model * - * @property ExternalProductCatalogsTable&BelongsTo $ExternalProductCatalogs - * @property ProductCatalogsTable&BelongsTo $ProductCatalogs + * @property ExternalProductCatalogsTable&\Cake\ORM\Association\BelongsTo $ExternalProductCatalogs + * @property ProductCatalogsTable&\Cake\ORM\Association\BelongsTo $ProductCatalogs * * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog newEmptyEntity() * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog get() * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog findOrCreate() * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ExternalProductCatalogsProductCatalog|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog|false save(\CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ExternalProductCatalogsProductCatalog saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) * * @mixin TimestampBehavior */ diff --git a/src/Model/Table/ExternalProductCatalogsTable.php b/src/Model/Table/ExternalProductCatalogsTable.php index 45720a3..d2dc55a 100644 --- a/src/Model/Table/ExternalProductCatalogsTable.php +++ b/src/Model/Table/ExternalProductCatalogsTable.php @@ -11,23 +11,19 @@ use Cake\Validation\Validator; /** * ExternalProductCatalogs Model * - * @property ProductCatalogsTable&BelongsTo $ProductCatalogs + * @property ProductCatalogsTable&\Cake\ORM\Association\BelongsTo $ProductCatalogs * * @method \CakeProducts\Model\Entity\ExternalProductCatalog newEmptyEntity() * @method \CakeProducts\Model\Entity\ExternalProductCatalog newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ExternalProductCatalog> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ExternalProductCatalog get() * @method \CakeProducts\Model\Entity\ExternalProductCatalog findOrCreate() * @method \CakeProducts\Model\Entity\ExternalProductCatalog patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ExternalProductCatalog|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ExternalProductCatalog> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ExternalProductCatalog|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ExternalProductCatalog saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) * - * @mixin TimestampBehavior + * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class ExternalProductCatalogsTable extends Table { diff --git a/src/Model/Table/ProductAttributesTable.php b/src/Model/Table/ProductAttributesTable.php index 9dfcefc..e7ac66b 100644 --- a/src/Model/Table/ProductAttributesTable.php +++ b/src/Model/Table/ProductAttributesTable.php @@ -11,23 +11,23 @@ use Cake\Validation\Validator; /** * ProductAttributes Model * - * @property \App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsTo $Products - * @property \App\Model\Table\ProductCategoryAttributesTable&\Cake\ORM\Association\BelongsTo $ProductCategoryAttributes - * @property \App\Model\Table\ProductCategoryAttributeOptionsTable&\Cake\ORM\Association\BelongsTo $ProductCategoryAttributeOptions + * @property ProductsTable&\Cake\ORM\Association\BelongsTo $Products + * @property ProductCategoryAttributesTable&\Cake\ORM\Association\BelongsTo $ProductCategoryAttributes + * @property ProductCategoryAttributeOptionsTable&\Cake\ORM\Association\BelongsTo $ProductCategoryAttributeOptions * - * @method \App\Model\Entity\ProductAttribute newEmptyEntity() - * @method \App\Model\Entity\ProductAttribute newEntity(array $data, array $options = []) - * @method array<\App\Model\Entity\ProductAttribute> newEntities(array $data, array $options = []) - * @method \App\Model\Entity\ProductAttribute get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args) - * @method \App\Model\Entity\ProductAttribute findOrCreate($search, ?callable $callback = null, array $options = []) - * @method \App\Model\Entity\ProductAttribute patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) - * @method array<\App\Model\Entity\ProductAttribute> patchEntities(iterable $entities, array $data, array $options = []) - * @method \App\Model\Entity\ProductAttribute|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) - * @method \App\Model\Entity\ProductAttribute saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = []) - * @method iterable<\App\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductAttribute>|false saveMany(iterable $entities, array $options = []) - * @method iterable<\App\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductAttribute> saveManyOrFail(iterable $entities, array $options = []) - * @method iterable<\App\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductAttribute>|false deleteMany(iterable $entities, array $options = []) - * @method iterable<\App\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductAttribute> deleteManyOrFail(iterable $entities, array $options = []) + * @method \CakeProducts\Model\Entity\ProductAttribute newEmptyEntity() + * @method \CakeProducts\Model\Entity\ProductAttribute newEntity(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductAttribute> newEntities(array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductAttribute get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args) + * @method \CakeProducts\Model\Entity\ProductAttribute findOrCreate($search, ?callable $callback = null, array $options = []) + * @method \CakeProducts\Model\Entity\ProductAttribute patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductAttribute> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductAttribute|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \CakeProducts\Model\Entity\ProductAttribute saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method iterable<\CakeProducts\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\CakeProducts\Model\Entity\ProductAttribute>|false saveMany(iterable $entities, array $options = []) + * @method iterable<\CakeProducts\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\CakeProducts\Model\Entity\ProductAttribute> saveManyOrFail(iterable $entities, array $options = []) + * @method iterable<\CakeProducts\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\CakeProducts\Model\Entity\ProductAttribute>|false deleteMany(iterable $entities, array $options = []) + * @method iterable<\CakeProducts\Model\Entity\ProductAttribute>|\Cake\Datasource\ResultSetInterface<\CakeProducts\Model\Entity\ProductAttribute> deleteManyOrFail(iterable $entities, array $options = []) */ class ProductAttributesTable extends Table { diff --git a/src/Model/Table/ProductCatalogsTable.php b/src/Model/Table/ProductCatalogsTable.php index 1ef4f5d..af56248 100644 --- a/src/Model/Table/ProductCatalogsTable.php +++ b/src/Model/Table/ProductCatalogsTable.php @@ -13,17 +13,13 @@ use Cake\Validation\Validator; * * @method \CakeProducts\Model\Entity\ProductCatalog newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductCatalog newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCatalog> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCatalog get() * @method \CakeProducts\Model\Entity\ProductCatalog findOrCreate() * @method \CakeProducts\Model\Entity\ProductCatalog patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductCatalog|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCatalog> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductCatalog|false save(\CakeProducts\Model\Entity\ProductCatalog|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductCatalog saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductCatalogsTable extends Table { diff --git a/src/Model/Table/ProductCategoriesTable.php b/src/Model/Table/ProductCategoriesTable.php index e9d5424..9858d7f 100644 --- a/src/Model/Table/ProductCategoriesTable.php +++ b/src/Model/Table/ProductCategoriesTable.php @@ -14,31 +14,27 @@ use CakeProducts\Model\Enum\ProductProductTypeId; /** * ProductCategories Model * - * @property ProductCatalogsTable&BelongsTo $ProductCatalogs - * @property ProductCategoriesTable&BelongsTo $ParentProductCategories - * @property ProductCategoriesTable&HasMany $ChildProductCategories + * @property ProductCatalogsTable&\Cake\ORM\Association\BelongsTo $ProductCatalogs + * @property ProductCategoriesTable&\Cake\ORM\Association\BelongsTo $ParentProductCategories + * @property ProductCategoriesTable&\Cake\ORM\Association\HasMany $ChildProductCategories * * @method \CakeProducts\Model\Entity\ProductCategory newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductCategory newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategory> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategory get() * @method \CakeProducts\Model\Entity\ProductCategory findOrCreate() * @method \CakeProducts\Model\Entity\ProductCategory patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategory> patchEntities(iterable $entities, array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategory saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) * - * @mixin TreeBehavior + * @mixin \Cake\ORM\Behavior\TreeBehavior */ class ProductCategoriesTable extends Table { /** * Current scope for Tree behavior - per catalog * - * @var string + * @var string|int */ protected $treeCatalogId; @@ -115,7 +111,7 @@ class ProductCategoriesTable extends Table { $this->getSchema()->setColumnType('default_product_type_id', EnumType::from(ProductProductTypeId::class)); - $this->behaviors()->Tree->setConfig('scope', ['product_catalog_id' => $this->treeCatalogId]); + $this->getBehavior('Tree')->setConfig('scope', ['product_catalog_id' => $this->treeCatalogId]); $this->addBehavior('Muffin/Trash.Trash'); } @@ -181,7 +177,7 @@ class ProductCategoriesTable extends Table { */ public function setConfigureCatalogId(string $catalogId) { $this->treeCatalogId = $catalogId; - $this->behaviors()->Tree->setConfig('scope', ['product_catalog_id' => $this->treeCatalogId]); + $this->getBehavior('Tree')->setConfig('scope', ['product_catalog_id' => $this->treeCatalogId]); } /** @@ -193,7 +189,7 @@ class ProductCategoriesTable extends Table { public function save(EntityInterface $entity, array $options = []): EntityInterface|false { $this->behaviors()->get('Tree')->setConfig([ 'scope' => [ - 'product_catalog_id' => $entity->product_catalog_id, + 'product_catalog_id' => $entity->product_catalog_id ?? null, ], ]); diff --git a/src/Model/Table/ProductCategoryAttributeOptionsTable.php b/src/Model/Table/ProductCategoryAttributeOptionsTable.php index ef6083b..ca123f6 100644 --- a/src/Model/Table/ProductCategoryAttributeOptionsTable.php +++ b/src/Model/Table/ProductCategoryAttributeOptionsTable.php @@ -11,21 +11,17 @@ use Cake\Validation\Validator; /** * ProductCategoryAttributeOptions Model * - * @property ProductCategoryAttributesTable&BelongsTo $ProductCategoryAttributes + * @property ProductCategoryAttributesTable&\Cake\ORM\Association\BelongsTo $ProductCategoryAttributes * * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryAttributeOption> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption get() * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption findOrCreate() * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductCategoryAttributeOption|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryAttributeOption> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption|false save(\CakeProducts\Model\Entity\ProductCategoryAttributeOption|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryAttributeOption saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductCategoryAttributeOptionsTable extends Table { diff --git a/src/Model/Table/ProductCategoryAttributesTable.php b/src/Model/Table/ProductCategoryAttributesTable.php index 2c2b4f9..4dac6be 100644 --- a/src/Model/Table/ProductCategoryAttributesTable.php +++ b/src/Model/Table/ProductCategoryAttributesTable.php @@ -14,21 +14,17 @@ use CakeProducts\Model\Enum\ProductCategoryAttributeTypeId; /** * ProductCategoryAttributes Model * - * @property ProductCategoriesTable&BelongsTo $ProductCategories + * @property ProductCategoriesTable&\Cake\ORM\Association\BelongsTo $ProductCategories * * @method \CakeProducts\Model\Entity\ProductCategoryAttribute newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductCategoryAttribute newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryAttribute> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryAttribute get() * @method \CakeProducts\Model\Entity\ProductCategoryAttribute findOrCreate() * @method \CakeProducts\Model\Entity\ProductCategoryAttribute patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductCategoryAttribute|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryAttribute> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductCategoryAttribute|false save(\CakeProducts\Model\Entity\ProductCategoryAttribute|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryAttribute saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductCategoryAttributesTable extends Table { @@ -134,12 +130,12 @@ class ProductCategoryAttributesTable extends Table { ->contain(['ProductCategoryAttributes', 'ProductCategoryAttributes.ProductCategoryAttributeOptions']); } - /** + /** * @param string $internalCategoryId - * @return array|array[]|\Cake\Datasource\EntityInterface[] + * @return \Cake\Datasource\EntityInterface[]|array[] */ public function getAllCategoryAttributesForCategoryId(string $internalCategoryId) { - return $this->find('allCategoryAttributesForCategoryId', $internalCategoryId)->toArray(); + return $this->find('allCategoryAttributesForCategoryId', internalCategoryId: $internalCategoryId)->toArray(); } } diff --git a/src/Model/Table/ProductCategoryVariantOptionsTable.php b/src/Model/Table/ProductCategoryVariantOptionsTable.php index 894e8b3..a78c061 100644 --- a/src/Model/Table/ProductCategoryVariantOptionsTable.php +++ b/src/Model/Table/ProductCategoryVariantOptionsTable.php @@ -11,23 +11,19 @@ use Cake\Validation\Validator; /** * ProductCategoryVariantOptions Model * - * @property ProductCategoryVariantsTable&BelongsTo $ProductCategoryVariants + * @property ProductCategoryVariantsTable&\Cake\ORM\Association\BelongsTo $ProductCategoryVariants * * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryVariantOption> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption get() * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption findOrCreate() * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductCategoryVariantOption|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryVariantOption> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption|false save(\CakeProducts\Model\Entity\ProductCategoryVariantOption|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryVariantOption saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) * - * @mixin TimestampBehavior + * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class ProductCategoryVariantOptionsTable extends Table { @@ -50,6 +46,7 @@ class ProductCategoryVariantOptionsTable extends Table { $this->addBehavior('Timestamp'); $this->belongsTo('ProductCategoryVariants', [ + 'className' => 'CakeProducts.ProductCategoryVariants', 'foreignKey' => 'product_category_variant_id', 'joinType' => 'INNER', ]); diff --git a/src/Model/Table/ProductCategoryVariantsTable.php b/src/Model/Table/ProductCategoryVariantsTable.php index a8d35fd..20b6e50 100644 --- a/src/Model/Table/ProductCategoryVariantsTable.php +++ b/src/Model/Table/ProductCategoryVariantsTable.php @@ -12,22 +12,18 @@ use Cake\Validation\Validator; /** * ProductCategoryVariants Model * - * @property ProductCategoriesTable&BelongsTo $ProductCategories - * @property ProductsTable&BelongsTo $Products + * @property ProductCategoriesTable&\Cake\ORM\Association\BelongsTo $ProductCategories + * @property ProductsTable&\Cake\ORM\Association\BelongsTo $Products * * @method \CakeProducts\Model\Entity\ProductCategoryVariant newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductCategoryVariant newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryVariant> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryVariant get() * @method \CakeProducts\Model\Entity\ProductCategoryVariant findOrCreate() * @method \CakeProducts\Model\Entity\ProductCategoryVariant patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductCategoryVariant|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductCategoryVariant> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductCategoryVariant|false save(\CakeProducts\Model\Entity\ProductCategoryVariant|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductCategoryVariant saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductCategoryVariantsTable extends Table { @@ -126,9 +122,9 @@ class ProductCategoryVariantsTable extends Table { * @param \Cake\ORM\Query\SelectQuery $query * @param string $internalCategoryId * - * @return Query|\Cake\ORM\Query\SelectQuery|array + * @return \Cake\ORM\Query\SelectQuery */ - public function findAllCategoryVariantsForCategoryId(SelectQuery $query, string $internalCategoryId) { + public function findAllCategoryVariantsForCategoryId(SelectQuery $query, string $internalCategoryId): SelectQuery { $category = $this->ProductCategories->find()->where(['internal_id' => $internalCategoryId])->firstOrFail(); $this->ProductCategories->behaviors()->get('Tree')->setConfig([ @@ -144,10 +140,11 @@ class ProductCategoryVariantsTable extends Table { /** * @param string $internalCategoryId + * * @return array */ - public function getAllCategoryVariantsForCategoryId(string $internalCategoryId) { - return $this->find('allCategoryVariantsForCategoryId', $internalCategoryId)->toArray(); + public function getAllCategoryVariantsForCategoryId(string $internalCategoryId): array { + return $this->find('allCategoryVariantsForCategoryId', internalCategoryId: $internalCategoryId)->toArray(); } } diff --git a/src/Model/Table/ProductPhotosTable.php b/src/Model/Table/ProductPhotosTable.php index 66bfea1..3b3931f 100644 --- a/src/Model/Table/ProductPhotosTable.php +++ b/src/Model/Table/ProductPhotosTable.php @@ -11,24 +11,20 @@ use Cake\Validation\Validator; /** * ProductPhotos Model * - * @property ProductsTable&BelongsTo $Products - * @property ProductSkusTable&BelongsTo $ProductSkus + * @property ProductsTable&\Cake\ORM\Association\BelongsTo $Products + * @property ProductSkusTable&\Cake\ORM\Association\BelongsTo $ProductSkus * * @method \CakeProducts\Model\Entity\ProductPhoto newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductPhoto newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductPhoto> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductPhoto get() * @method \CakeProducts\Model\Entity\ProductPhoto findOrCreate() * @method \CakeProducts\Model\Entity\ProductPhoto patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductPhoto|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductPhoto> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductPhoto|false save(\CakeProducts\Model\Entity\ProductPhoto|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductPhoto saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) * - * @mixin TimestampBehavior + * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class ProductPhotosTable extends Table { diff --git a/src/Model/Table/ProductSkuVariantValuesTable.php b/src/Model/Table/ProductSkuVariantValuesTable.php index db7ae0e..1b00214 100644 --- a/src/Model/Table/ProductSkuVariantValuesTable.php +++ b/src/Model/Table/ProductSkuVariantValuesTable.php @@ -10,23 +10,19 @@ use Cake\Validation\Validator; /** * ProductSkuVariantValues Model * - * @property ProductSkusTable&BelongsTo $ProductSkus - * @property ProductCategoryVariantsTable&BelongsTo $ProductCategoryVariants - * @property ProductCategoryVariantOptionsTable&BelongsTo $ProductCategoryVariantOptions + * @property ProductSkusTable&\Cake\ORM\Association\BelongsTo $ProductSkus + * @property ProductCategoryVariantsTable&\Cake\ORM\Association\BelongsTo $ProductCategoryVariants + * @property ProductCategoryVariantOptionsTable&\Cake\ORM\Association\BelongsTo $ProductCategoryVariantOptions * * @method \CakeProducts\Model\Entity\ProductSkuVariantValue newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductSkuVariantValue newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductSkuVariantValue> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductSkuVariantValue get() * @method \CakeProducts\Model\Entity\ProductSkuVariantValue findOrCreate() * @method \CakeProducts\Model\Entity\ProductSkuVariantValue patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductSkuVariantValue|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductSkuVariantValue> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductSkuVariantValue|false save(\CakeProducts\Model\Entity\ProductSkuVariantValue|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductSkuVariantValue saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductSkuVariantValuesTable extends Table { diff --git a/src/Model/Table/ProductSkusTable.php b/src/Model/Table/ProductSkusTable.php index dcd6dba..34898bf 100644 --- a/src/Model/Table/ProductSkusTable.php +++ b/src/Model/Table/ProductSkusTable.php @@ -11,23 +11,19 @@ use Cake\Validation\Validator; /** * ProductSkus Model * - * @property ProductsTable&BelongsTo $Products + * @property ProductsTable&\Cake\ORM\Association\BelongsTo $Products * * @method \CakeProducts\Model\Entity\ProductSku newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductSku newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductSku> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductSku get() * @method \CakeProducts\Model\Entity\ProductSku findOrCreate() * @method \CakeProducts\Model\Entity\ProductSku patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductSku|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductSku> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductSku|false save(\CakeProducts\Model\Entity\ProductSku|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductSku saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) * - * @mixin TimestampBehavior + * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class ProductSkusTable extends Table { diff --git a/src/Model/Table/ProductVariantsTable.php b/src/Model/Table/ProductVariantsTable.php index 4865680..16cccfc 100644 --- a/src/Model/Table/ProductVariantsTable.php +++ b/src/Model/Table/ProductVariantsTable.php @@ -10,22 +10,18 @@ use Cake\Validation\Validator; /** * ProductVariants Model * - * @property ProductCategoryVariantsTable&BelongsTo $ProductCategoryVariants - * @property ProductsTable&BelongsTo $Products + * @property ProductCategoryVariantsTable&\Cake\ORM\Association\BelongsTo $ProductCategoryVariants + * @property ProductsTable&\Cake\ORM\Association\BelongsTo $Products * * @method \CakeProducts\Model\Entity\ProductVariant newEmptyEntity() * @method \CakeProducts\Model\Entity\ProductVariant newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductVariant> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\ProductVariant get() * @method \CakeProducts\Model\Entity\ProductVariant findOrCreate() * @method \CakeProducts\Model\Entity\ProductVariant patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method ProductVariant|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\ProductVariant> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\ProductVariant|false save(\CakeProducts\Model\Entity\ProductVariant|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\ProductVariant saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductVariantsTable extends Table { diff --git a/src/Model/Table/ProductsTable.php b/src/Model/Table/ProductsTable.php index 4d2a8ee..2cc424b 100644 --- a/src/Model/Table/ProductsTable.php +++ b/src/Model/Table/ProductsTable.php @@ -13,21 +13,17 @@ use CakeProducts\Model\Enum\ProductProductTypeId; /** * Products Model * - * @property ProductCategoriesTable&BelongsTo $ProductCategories + * @property ProductCategoriesTable&\Cake\ORM\Association\BelongsTo $ProductCategories * * @method \CakeProducts\Model\Entity\Product newEmptyEntity() * @method \CakeProducts\Model\Entity\Product newEntity() - * @method array newEntities(array $data, array $options = []) + * @method array<\CakeProducts\Model\Entity\Product> newEntities(array $data, array $options = []) * @method \CakeProducts\Model\Entity\Product get() * @method \CakeProducts\Model\Entity\Product findOrCreate() * @method \CakeProducts\Model\Entity\Product patchEntity() - * @method array patchEntities(iterable $entities, array $data, array $options = []) - * @method Product|false save(EntityInterface $entity, array $options = []) + * @method array<\CakeProducts\Model\Entity\Product> patchEntities(iterable $entities, array $data, array $options = []) + * @method \CakeProducts\Model\Entity\Product|false save(\CakeProducts\Model\Entity\Product|\Cake\Datasource\EntityInterface $entity, array $options = []) * @method \CakeProducts\Model\Entity\Product saveOrFail() - * @method iterable|ResultSetInterface|false saveMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface saveManyOrFail(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface|false deleteMany(iterable $entities, array $options = []) - * @method iterable|ResultSetInterface deleteManyOrFail(iterable $entities, array $options = []) */ class ProductsTable extends Table {