<?php

namespace Modules\Option\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Attribute\Models\Attribute;

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

    protected $fillable =
    [
        'id'
    ];

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

    public function attributes()
    {
        return $this->belongsToMany(Attribute::class,'attribute_options');
    }
}
