<?php

class UmSharedUserRole extends \Phalcon\Mvc\Model
{

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

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

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

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

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("public");
        $this->setSource("um_shared_user_role");
        $this->belongsTo('um_user_tenant_id', 'public\UmUser', 'um_id', ['alias' => 'UmUser']);
        $this->belongsTo('um_role_tenant_id', 'public\UmRole', 'um_tenant_id', ['alias' => 'UmRole']);
    }

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

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

}
