<?php

class UmRole extends \Phalcon\Mvc\Model
{

    /**
     *
     * @var integer
     */
    public $um_id;

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

    /**
     *
     * @var integer
     */
    public $um_tenant_id;

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

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("public");
        $this->setSource("um_role");
        $this->hasMany('um_tenant_id', 'public\UmSharedUserRole', 'um_role_tenant_id', ['alias' => 'UmSharedUserRole']);
        $this->hasMany('um_id', 'public\UmUserRole', 'um_role_id', ['alias' => 'UmUserRole']);
    }

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

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

}
