<?php

class KorsupgahMcpPenaltyScoreAttachment extends \Phalcon\Mvc\Model
{
    public function initialize()
    {
        $this->setSchema('jaga');
        $this->setSource('korsupgah_mcp_penalty_score_attachment');
        $this->belongsTo('id_template', 'korsupgah_template', 'id');
        $this->belongsTo("id_attachment", "Attachments", "id");
    }

    public function getDetail()
    {
        return $this->attachments->toArray(['uuid', 'filename', 'keterangan', 'tipe', 'created_at', 'deleted_at']);
    }

    public static function getSubfolder($templateId, $year) {
        return "korsupgah-mcp-penalty-score" . DIRECTORY_SEPARATOR . $templateId . DIRECTORY_SEPARATOR . $year;
    }
}
