<?php

class Article extends ContentTypeModel{
  use LanguageSupportTrait;

  protected $hidden = array('languages', "websites");
  protected $with = array("languages", "websites");

    public function entries()
    {
        return $this->belongsTo('Entry')
        ->withPivot('position');
    }

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

    public function isVideoLink()
    {
      return !empty($this->link) && (starts_with($this->link, "https://videos.impresa.pt") || starts_with($this->link, "https://videos.impresa.pt") || starts_with($this->link, "https://cdn-1.metacdn.net"));
    }

}
