<?php

namespace App\Models;

use CodeIgniter\Model;

class CandidateReferenceModel extends Model
{
    protected $table         = 'candidate_references';
    protected $allowedFields = ['candidate_profile_id', 'name', 'relationship', 'company', 'email', 'phone'];
    protected $validationRules = [
        'name' => 'required|max_length[150]',
    ];

    public function forProfile(int $candidateProfileId): array
    {
        return $this->where('candidate_profile_id', $candidateProfileId)->findAll();
    }
}
