Removed Cart facade from coverage (does not provide a public inteterface)

Exclude migrations from coverage
Added tests for InstanceIdentifier
Added InstanceIdentifier support to store, restore and merge
Added weight to CanBeBought trait
Excluded CanBeBought trait from coverage temporarily
This commit is contained in:
Patrick Henninger
2019-01-09 14:08:09 +01:00
parent 70073ccb92
commit 59eadb74a1
5 changed files with 113 additions and 6 deletions

View File

@@ -16,15 +16,20 @@ trait CanBeBought
}
/**
* Get the description or title of the Buyable item.
* Get the name, title or description of the Buyable item.
*
* @return string
*/
public function getBuyableDescription($options = null)
{
if(property_exists($this, 'name')) return $this->name;
if(property_exists($this, 'title')) return $this->title;
if(property_exists($this, 'description')) return $this->description;
if(property_exists($this, 'name'))
return $this->name;
if(property_exists($this, 'title'))
return $this->title;
if(property_exists($this, 'description'))
return $this->description;
return null;
}
@@ -36,8 +41,20 @@ trait CanBeBought
*/
public function getBuyablePrice($options = null)
{
if(property_exists($this, 'price')) return $this->price;
if(property_exists($this, 'price'))
return $this->price;
return null;
}
/**
* Get the weight of the Buyable item.
*
* @return float
*/
public function getBuyableWeight($options = null)
{
if(property_exists($this, 'weight'))
return $this->weight;
return 0;
}
}