<?php

class StranasNewPeriode extends \Phalcon\Mvc\Model
{

    /**
     * Initialize method for model.
     */
    public function initialize() {
        $this->setSchema("jaga");
        $this->setSource("str_periode");
        $this->hasMany("id", "StranasNewPeriodeTriwulan", "id_periode", ["params" => ["order" => 'label ASC']]);
    }

    public function getDetail()
    {
        return $this->StranasNewPeriodeTriwulan->toArray(['id']);
    }
    
    public function toArray($columns = null)
    {
        $result = parent::toArray($columns);
        $result['triwulan'] = $this->StranasNewPeriodeTriwulan;

        return $result;
    }

    public function toDetail()
    {
        return $this->StranasNewPeriodeTriwulan->toArray(['id']);
    }
}
