<?php

namespace App\Models;

use CodeIgniter\Model;

class CandidatePortfolioLinkModel extends Model
{
    protected $table         = 'candidate_portfolio_links';
    protected $allowedFields = ['candidate_profile_id', 'label', 'url'];
    protected $validationRules = [
        'url' => 'required|valid_url_strict|max_length[255]',
    ];

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