sintonia_webapp/app/Models/PlaylistContent.php

46 lines
983 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use PhpParser\Node\Stmt\Block;
class PlaylistContent extends Model
{
use HasFactory;
protected $table = 'cc_playlistcontents';
public $timestamps = false;
protected $fillable = [
'playlist_id',
'file_id',
'block_id',
'stream_id',
'type', //0 = file, 1 = stream, 2 = block
'position',
'trackoffset',
'cliplength',
'cuein',
'cueout',
'fadein',
'fadeout'
];
public function playlist() {
return $this->belongsTo(Playlist::class);
}
public function file() {
return $this->belongsTo(File::class);
}
public function block() {
return $this->belongsTo(SmartBlock::class, 'block_id');
}
public function stream() {
//ToDo create belongsTo relationship after create stream model
}
}