<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class RelationOtherrestriction extends Model
{
    const CREATED_AT = null;
    const UPDATED_AT = null;
    
    protected $fillable = ['company_id', 'article_id', 'item_id'];
    //

    public static function getDataByArticleId($aid) 
    {
        $res = [];
        $result = RelationOtherrestriction::select('item_id')->where('article_id', '=', $aid)->get();
        foreach($result as $row) {
            $res[] = $row->item_id;
        }
        return $res;
    }
}
