<?php
namespace App\Models;
use CodeIgniter\Model;

class CustomerTagModel extends Model
{
    protected $table         = 'customer_tags';
    protected $primaryKey    = 'id';
    protected $allowedFields  = ['company_id','customer_id','tag','created_at','updated_at','deleted_at'];

    public function forCustomer(int $id): array
    {
        return array_column($this->where('customer_id', $id)->findAll(), 'tag');
    }
}
