<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\traits\SetConnection;

class RelationLawrestriction extends Model
{
    use SetConnection;

    const CREATED_AT = null;
    const UPDATED_AT = null;

    protected $fillable = ['company_id', 'article_id', 'item_id'];
    //

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