public function hold($quantity, $reason = '', $cost = 0)
{
$this->validatePreviousState([null, $this::STATE_OPENED], $this::STATE_INVENTORY_ON_HOLD);
$this->setAttribute('quantity', $quantity);
$this->setAttribute('state', $this::STATE_INVENTORY_ON_HOLD);
if (empty($reason)) {
$reason = $this->getTransactionReason('hold');
}
return $this->processStockTakeAndSave($quantity, 'inventory.transaction.hold', $reason, $cost);
}