<?php

namespace App\Models;

# use Illuminate\Database\Eloquent\Model;

class ClientProgram extends Model
{
    protected $table = "client_program";

    public function mcp() {
        return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
    }

    public function manager() {
        return $this->hasOne(Pro::class, 'id', 'manager_pro_id');
    }

    public function getProgramMonth($m, $y)
    {
        return ClientProgramMonth::where('client_program_id', $this->id)
            ->where('month', $m)
            ->where('year', $y)
            ->first();
    }
}
