<?php

class StranasNewReportLogAttachments extends \Phalcon\Mvc\Model
{
    const TIPE_JAWABAN = 0;
    const TIPE_VERIFIKASI = 1;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("jaga");
        $this->setSource("str_target_attachment");
        $this->hasOne("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;
    }
}
