walletservice/app/Models/OperatorsCountry.php

62 lines
1.2 KiB
PHP
Raw Normal View History

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
2020-11-06 17:40:08 +00:00
* Class OperatorsCountry
*
* @property int $id
2020-11-06 17:40:08 +00:00
* @property int $id_operator
* @property int $id_country
* @property string|null $adresse
2020-11-06 17:40:08 +00:00
* @property string|null $code
* @property bool $status
*
2020-11-06 17:40:08 +00:00
* @property Operator $operator
* @property Country $country
2020-11-06 17:40:08 +00:00
* @property Collection|NetworksOperator[] $networks_operators
*
* @package App\Models
*/
2020-11-06 17:40:08 +00:00
class OperatorsCountry extends Model
{
2020-11-06 17:40:08 +00:00
protected $table = 'operators_countries';
public $timestamps = false;
protected $casts = [
2020-11-06 17:40:08 +00:00
'id_operator' => 'int',
'id_country' => 'int',
'status' => 'bool'
];
protected $fillable = [
2020-11-06 17:40:08 +00:00
'id_operator',
'id_country',
'adresse',
2020-11-06 17:40:08 +00:00
'code',
'status'
];
2020-11-06 17:40:08 +00:00
public function operator()
{
2020-11-06 17:40:08 +00:00
return $this->belongsTo(Operator::class, 'id_operator');
}
public function country()
{
return $this->belongsTo(Country::class, 'id_country');
}
2020-11-06 17:40:08 +00:00
public function networks_operators()
{
2020-11-06 17:40:08 +00:00
return $this->hasMany(NetworksOperator::class, 'id_operator_country');
}
}