<?php

namespace App\Models;

use CodeIgniter\Model;

class CandidateCertificationModel extends Model
{
    protected $table         = 'candidate_certifications';
    protected $allowedFields = ['candidate_profile_id', 'title', 'issuing_org', 'issue_date', 'expiry_date', 'credential_url'];
    protected $validationRules = [
        'title' => 'required|max_length[150]',
    ];

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