<?php

/**
 * @property DesaBidangPenyerapan $bidang
 */
class DesaKegiatanPenyerapan extends \Phalcon\Mvc\Model
{

    /**
     *
     * @var string
     */
    public $kode;

    /**
     *
     * @var string
     */
    public $nama;

    /**
     *
     * @var string
     */
    public $kode_bidang;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("jaga");
        $this->setSource("desa_kegiatan_penyerapan");
        $this->hasMany('kode', 'DesaUraianOutputPenyerapan', 'kode_kegiatan', ['alias' => 'uraianOutput']);
        $this->belongsTo('kode_bidang', '\DesaBidangPenyerapan', 'kode', ['alias' => 'bidang']);
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'desa_kegiatan_penyerapan';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return DesaKegiatanPenyerapan[]|DesaKegiatanPenyerapan|\Phalcon\Mvc\Model\ResultSetInterface
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return DesaKegiatanPenyerapan|\Phalcon\Mvc\Model\ResultInterface
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
