RestApiArticleDetailUpdaterService

Implements \Shopware\Plugins\ViisonPickwareERP\Components\RestApi\RestApiArticleDetailUpdater, \Enlight_Hook

package

Default

Methods

__construct

__construct(\Shopware\Components\Model\ModelManager $entityManager, \Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockLedgerService $stockLedgerService, \Shopware\Plugins\ViisonPickwareERP\Components\StockLedger\StockChangeList\StockChangeListFactoryService $stockChangeListFactoryService, \Shopware\Plugins\ViisonPickwareERP\Components\DerivedPropertyUpdater\DerivedPropertyUpdater $derivedPropertyUpdater) 

Removes several custom Pickware article detail attribute fields from the passed `$postData`, if present, and returns the cleaned data.

removeCustomAttributesFromPostData(array $postData) : array
inheritdoc

Arguments

$postData

array

Response

array

Removes the fields 'inStock' and 'stockMin' from the passed `$postData`, if present, and returns the cleaned data.

removeStockFieldsFromPostData(array $postData) : array
inheritdoc

Arguments

$postData

array

Response

array

Checks the passed `$postData` for the `stockMin` field and, if present, initializes the stock limits of the passed `$articleDetail` to the respective value.

updateStockLimitsWithPostData(\Shopware\Models\Article\Detail $articleDetail, array $postData) 
inheritdoc

Arguments

$articleDetail

\Shopware\Models\Article\Detail

$postData

array

Checks the passed `$postData` for the attribute `pickwareStockManagementDisabled` and, if set, either starts or stops managing the passed `$articleDetail`'s stock, depending on the value.

updateStockManagementStatusWithPostData(\Shopware\Models\Article\Detail $articleDetail, array $postData) 
inheritdoc

Arguments

$articleDetail

\Shopware\Models\Article\Detail

$postData

array

Checks the passed `$postData` for the `inStock` field and, if present, updates the (physical) stock of the passed `$articleDetail` in accordance with the passed `inStock` value.

updateStockWithPostData(\Shopware\Models\Article\Detail $articleDetail, array $postData) 
inheritdoc

Arguments

$articleDetail

\Shopware\Models\Article\Detail

$postData

array

Constants

Comment used for stock ledger entries created by self::updateStockWithPostData()

COMMENT