<?php
namespace Components\Models;

class CustomerBasketAttribute extends BaseModel
{
    protected static string $table = 'customers_basket_attributes';
    protected static string $primaryKey = 'customers_basket_attributes_id';

    public static function isReadOnly(): bool
    {
        return true;
    }

    public function customer(): ?Customer
    {
        $customer = $this->belongsTo(Customer::class, 'customers_id', 'customers_id');
        return $customer instanceof Customer ? $customer : null;
    }
}
