Files
UNIT3D-Community-Edition/app/Models/Season.php
T
2020-10-28 17:07:09 -04:00

75 lines
1.7 KiB
PHP

<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Season extends Model
{
protected $guarded = [];
public $timestamps = false;
public $table = 'seasons';
/**
* Has Many Torrents.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function torrents()
{
return $this->hasMany(Torrent::class, 'tmdb', 'tv_id');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tv()
{
return $this->belongsTo(Tv::class);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function episodes()
{
return $this->hasMany(Episode::class)
->orderBy('episode_number');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function person()
{
return $this->belongsToMany(Person::class);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function cast()
{
return $this->belongsToMany(Cast::class);
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function crew()
{
return $this->belongsToMany(Crew::class);
}
}