<?php

class StranasSurveyAnswerCommentAttachment extends \Phalcon\Mvc\Model
{
    public function initialize()
    {
        $this->setSchema("jaga");
        $this->setSource("stranas_survey_answer_comment_attachment");
        // $this->belongsTo("id_comment", "StranasSurveyAnswerComment", "id");
        $this->belongsTo("id_attachment", "Attachments", "id");
    }

    public function getDetail()
    {
        return $this->attachments->toArray(['uuid', 'filename', 'keterangan', 'tipe']);
    }
    
    public function toArray($columns = null)
    {
        $result = parent::toArray($columns);
        $result['files'] = $this->Attachments;

        return $result;
    }
}
