You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
671 B
32 lines
671 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SpSection extends Model{
|
|
|
|
protected $fillable = ['name_en', 'name_fa', 'description', 'sp_page_id', 'editable'];
|
|
|
|
public function page()
|
|
{
|
|
return $this->belongsTo('App\SpPage','sp_page_id','id');
|
|
}
|
|
|
|
public function allowed_frames()
|
|
{
|
|
return $this->hasMany('App\SpFrame','sp_section_id','id');
|
|
}
|
|
|
|
public function frames()
|
|
{
|
|
return $this->belongsToMany('App\SpFrame','sp_user_frames','sp_section_id','sp_frame_id');
|
|
}
|
|
|
|
public function user_frames()
|
|
{
|
|
return $this->hasMany('App\SpUserFrame','sp_section_id','id');
|
|
}
|
|
|
|
}
|