ldc-mesbr-app/app/Panier.php
Thibault Richy dec7bd1328 Fix Stats
2019-07-10 14:36:55 +02:00

51 lines
894 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Panier extends Model
{
/**
* @var string
*/
protected $table = 'panier';
/**
* @var string
*/
protected $primaryKey = 'panier_id';
/**
* @var bool
*/
public $timestamps = false;
//protected $with = ['panierContents'];
/**
* OneToMany
* Panier -> PanierContent
*/
public function panierContents()
{
return $this->hasMany('App\PanierContent', 'panier_content_panierId', 'panier_id');
}
/**
* ManyToOne
* Panier -> Campagne
*/
public function campagne()
{
return $this->belongsTo('App\Campagne', 'panier_campId');
}
/**
* ManyToOne
* Panier -> Contact
*/
public function contact()
{
return $this->belongsTo('App\Contact', 'panier_contactId');
}
}