<?php

class StranasSurveyAnswerAttachment extends \Phalcon\Mvc\Model
{
    const TIPE_JAWABAN = 0;
    const TIPE_VERIFIKASI = 1;
    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("jaga");
        $this->setSource("stranas_survey_answer_attachment");
        $this->belongsTo("id_answer", "StranasSurveyAnswer", "id");
        $this->belongsTo("id_attachment", "Attachments", "id");
    }

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