Example #1
0
 /**
  * Get the private attributes
  *
  * @param string $key
  *
  * @return mixed
  */
 public function __get($key)
 {
     if (property_exists($this, $key)) {
         return $this->{$key};
     }
     if ($this->attributes->has($key)) {
         return $this->attributes->get($key);
     }
 }
Example #2
0
 /**
  * Remove a product from the basket
  *
  * @param string $sku
  * @return void
  */
 public function remove($sku)
 {
     $product = $this->pick($sku);
     $this->products->remove($sku);
 }
Example #3
0
 /** @test */
 public function should_return_collection_as_array()
 {
     $this->assertEquals($this->items, $this->collection->toArray());
 }
Example #4
0
 /**
  * Add a tag
  *
  * @param string $tag
  * @return void
  */
 public function tags($tag)
 {
     $this->tags->push($tag);
 }