ldc-mesbr-app/app/Panier.php

52 lines
898 B
PHP
Raw Normal View History

2019-01-15 14:17:15 +01:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Panier extends Model
{
/**
* @var string
*/
protected $table = 'panier';
/**
* @var string
*/
protected $primaryKey = 'panier_id';
/**
2025-04-03 09:30:16 +02:00
* @var boolean
2019-01-15 14:17:15 +01:00
*/
public $timestamps = false;
2025-04-03 09:30:16 +02:00
// protected $with = ['panierContents'];
2019-01-15 14:17:15 +01:00
/**
* OneToMany
* Panier -> PanierContent
*/
public function panierContents()
{
2019-01-29 12:26:00 +01:00
return $this->hasMany('App\PanierContent', 'panier_content_panierId', 'panier_id');
2019-01-15 14:17:15 +01:00
}
/**
* 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');
}
}