Skip to content

Instantly share code, notes, and snippets.

@danjohnson95
Created May 4, 2017 08:59
Show Gist options
  • Save danjohnson95/82cc04497abb2ebba39e0552bde92028 to your computer and use it in GitHub Desktop.
Save danjohnson95/82cc04497abb2ebba39e0552bde92028 to your computer and use it in GitHub Desktop.
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Contracts\ProductDataInterface;
class Product extends Model implements ProductDataInterface
{
protected $table = "products";
/**
* Sets the title of the product
* @param string $title
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Sets the price of the product
* @param float $price
* @return $this
*/
public function setPrice($price)
{
$this->price = $price;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment