<?php
namespace nota\models;

use Yii;

class PaymentMethod extends \yii\db\ActiveRecord
{
    public static function getDb() {
        return Yii::$app->get('dbnota'); 
    }

    public static function tableName()
    {
        return 'payment_method';
    }

    public function rules()
    {
        return [
            [['name','code'], 'required'],
            ['code', 'unique', 'message' => 'Kode pembayaran sudah digunakan!'],
            ['is_active', 'boolean'],
        ];
    }

}
