/** * 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); } }
/** * Remove a product from the basket * * @param string $sku * @return void */ public function remove($sku) { $product = $this->pick($sku); $this->products->remove($sku); }
/** @test */ public function should_return_collection_as_array() { $this->assertEquals($this->items, $this->collection->toArray()); }
/** * Add a tag * * @param string $tag * @return void */ public function tags($tag) { $this->tags->push($tag); }