Stevebauman\Inventory\Traits\InventoryTransactionTrait::removeAll PHP Метод

removeAll() публичный Метод

Permanently removes all of the transaction quantity from the stock. Since the stock was already removed with the on-hold method, the removed state is an 'end of the line' state, and cannot be recovered or reversed.
public removeAll ( )
    public function removeAll()
    {
        /*
         * Only allow the previous state of on hold
         */
        $this->validatePreviousState([$this::STATE_INVENTORY_ON_HOLD], $this::STATE_INVENTORY_REMOVED);
        $this->setAttribute('quantity', 0);
        $this->setAttribute('state', $this::STATE_INVENTORY_REMOVED);
        return $this->processSave('inventory.transaction.removed');
    }