44 lines
806 B
PHP
44 lines
806 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Operator
|
|
*
|
|
* @property int $id
|
|
* @property string $nom
|
|
* @property string|null $type
|
|
*
|
|
* @property TypeOperator $type_operator
|
|
* @property Collection|OperatorsCountry[] $operators_countries
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Operator extends Model
|
|
{
|
|
protected $table = 'operators';
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'nom',
|
|
'type'
|
|
];
|
|
|
|
public function type_operator()
|
|
{
|
|
return $this->belongsTo(TypeOperator::class, 'type', 'code');
|
|
}
|
|
|
|
public function operators_countries()
|
|
{
|
|
return $this->hasMany(OperatorsCountry::class, 'id_operator');
|
|
}
|
|
}
|