<?php
namespace Components\Models;

class AddressBook extends BaseModel
{
    protected static string $table = 'address_book';
    protected static string $primaryKey = 'address_book_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;
    }
}
