Skip to content

Commit 06ab2d6

Browse files
author
Alex Westergaard
committed
Add facade for items and add resetter
1 parent 90da024 commit 06ab2d6

29 files changed

+107
-155
lines changed

src/Event/AddPaymentInfo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,9 @@ public function addItem(Item $item)
7777
$this->items[] = $item->toArray();
7878
return $this;
7979
}
80+
81+
public function resetItems()
82+
{
83+
$this->items = [];
84+
}
8085
}

src/Event/AddShippingInfo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,9 @@ public function addItem(Item $item)
7777
$this->items[] = $item->toArray();
7878
return $this;
7979
}
80+
81+
public function resetItems()
82+
{
83+
$this->items = [];
84+
}
8085
}

src/Event/AddToCart.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ public function addItem(Item $item)
6161
$this->items[] = $item->toArray();
6262
return $this;
6363
}
64+
65+
public function resetItems()
66+
{
67+
$this->items = [];
68+
}
6469
}

src/Event/AddToWishlist.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ public function addItem(Item $item)
6161
$this->items[] = $item->toArray();
6262
return $this;
6363
}
64+
65+
public function resetItems()
66+
{
67+
$this->items = [];
68+
}
6469
}

src/Event/BeginCheckout.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,9 @@ public function addItem(Item $item)
6969
$this->items[] = $item->toArray();
7070
return $this;
7171
}
72+
73+
public function resetItems()
74+
{
75+
$this->items = [];
76+
}
7277
}

src/Event/Purchase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,9 @@ public function addItem(Item $item)
102102
$this->items[] = $item->toArray();
103103
return $this;
104104
}
105+
106+
public function resetItems()
107+
{
108+
$this->items = [];
109+
}
105110
}

src/Event/Refund.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,9 @@ public function addItem(Item $item)
118118
$this->items[] = $item->toArray();
119119
return $this;
120120
}
121+
122+
public function resetItems()
123+
{
124+
$this->items = [];
125+
}
121126
}

src/Event/RemoveFromCart.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ public function addItem(Item $item)
6161
$this->items[] = $item->toArray();
6262
return $this;
6363
}
64+
65+
public function resetItems()
66+
{
67+
$this->items = [];
68+
}
6469
}

src/Event/SelectPromotion.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ public function addItem(Item $item)
7272
$this->items[] = $item->toArray();
7373
return $this;
7474
}
75+
76+
public function resetItems()
77+
{
78+
$this->items = [];
79+
}
7580
}

src/Event/ViewCart.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,9 @@ public function addItem(Item $item)
6161
$this->items[] = $item->toArray();
6262
return $this;
6363
}
64+
65+
public function resetItems()
66+
{
67+
$this->items = [];
68+
}
6469
}

0 commit comments

Comments
 (0)