33 lines
687 B
PHP
33 lines
687 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class WidgetInWidgetArea
|
|
*/
|
|
class WidgetInWidgetArea extends Model
|
|
{
|
|
protected $table = 'widget_in_widget_area';
|
|
public $timestamps = false;
|
|
protected $fillable = [
|
|
'widget_id',
|
|
'widget_area_id',
|
|
'position'
|
|
];
|
|
protected $guarded = [];
|
|
|
|
public static function getWidgetIdsFromArea($widgetAreaId)
|
|
{
|
|
$models = WidgetInWidgetArea::where('widget_area_id', $widgetAreaId)
|
|
->get();
|
|
|
|
$ids = [];
|
|
foreach ($models as $model) {
|
|
$ids[] = $model->widget_id;
|
|
}
|
|
|
|
return $ids;
|
|
}
|
|
} |