<?php

class MasterKecamatan extends \Phalcon\Mvc\Model
{

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

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

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

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

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

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("jaga");
        $this->setSource("master_kecamatan");
        $this->hasMany('kecamatan_code', 'Sekolah', 'kecamatan_code', ['alias' => 'Sekolah']);
        $this->belongsTo('kota_kabupaten_code', '\MasterKotaKabupaten', 'kota_kabupaten_code', ['alias' => 'MasterKotaKabupaten']);
    }

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

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return MasterKecamatan[]|MasterKecamatan|\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 MasterKecamatan|\Phalcon\Mvc\Model\ResultInterface
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
