Files
UNIT3D-Community-Edition/app/Models/Episode.php
HDVinnie e5a4a16ddf refactor: meta data system
- Complete rewrite of meta data system
- New media hub feature.
- Torrent Bumping Refactor
- Wish System Disabled until refactored
- Fetch meta command added for fetchinng new meta on prexsisnting torrents.
- plus alot more
- closes #1428
- closes #1344
- closes #1147
- closes #361
2020-10-28 16:42:22 -04:00

54 lines
1.3 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 Episode extends Model
{
protected $guarded = [];
protected $orderBy = 'order';
protected $orderDirection = 'ASC';
protected $primaryKey = 'id';
public $table = 'episodes';
public function season()
{
return $this->belongsTo(Season::class)
->orderBy('season_id')
->orderBy('episode_id');;
}
public function person()
{
return $this->belongsToMany(Person::class);
}
public function cast()
{
return $this->belongsToMany(Cast::class)
->orderBy('order');
}
public function crew()
{
return $this->belongsToMany(Crew::class, 'crew_episode', 'person_id', 'episode_id');
}
public function guest_star()
{
return $this->belongsToMany(GuestStar::class, 'episode_guest_star', 'person_id', 'episode_id');
}
}