<?php

namespace Modules\Sector\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Region\Models\Region;
use Modules\User\Models\UserSector;

class Sector extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable =
    [
        'lock'
    ];

    /**
     * Get current description of the the Room
     * @return HasOne
     */
    public function currentDescription() :HasOne
    {
        return $this->hasOne(SectorDescription::class)->where('language_id', currentLanguage()->id);
    }
    public function users()
    {
        return $this->hasMany(UserSector::class);
    }
}
