<?php

namespace App\Models;

use CodeIgniter\Model;

class CandidateProjectModel extends Model
{
    protected $table         = 'candidate_projects';
    protected $allowedFields = ['candidate_profile_id', 'title', 'description', 'project_url', 'start_date', 'end_date'];
    protected $validationRules = [
        'title' => 'required|max_length[150]',
    ];

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