<?php
/**
 * Created by PhpStorm.
 * User: ntaylor
 * Date: 3/10/20
 * Time: 12:23 PM
 */

namespace Hilco\Models;


class Assortment extends WebModel {
    protected $table = 'Assortments';

    public function parts() {
        return
            $this
                ->belongsToMany(Part::class, 'Assortment_Part', 'assortment_id', 'part_id')
                ->where('Assortment_Part.deleted_at', '=', '0000-00-00 00:00:00')
        ;
    }

    public function customersegments() {
        return $this->hasMany(CustomerSegment::class, 'assortment_id', 'id');
    }
}