<?php

namespace App\Models;

use App\Libs\Database\Eloquent\ContentTypeModel;
use App\Models\GenericBackoffice\Traits\LanguageSupportTrait;

class PressRelease extends ContentTypeModel
{
    use LanguageSupportTrait;

    protected $hidden = ['languages', "websites"];
    protected $with = ['languages', "websites"];

    public function image() {
        return $this->belongsTo(MediaItem::class);
    }

    public function imageMobile() {
        return $this->belongsTo(MediaItem::class);
    }

    public function document() {
        return $this->belongsTo(MediaItem::class);
    }

    public function topic() {
        return $this->belongsTo(Topic::class);
    }

    public function country() {
        return $this->belongsTo(Country::class);
    }

    public function tags() {
        return $this->belongsToMany(Tag::class)->withPivot('position');
    }
}
