mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-21 17:28:31 -05:00
75 lines
1.7 KiB
PHP
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);
|
|
}
|
|
}
|