<?php namespace TPS\Birzha\Models;

use Model;

/**
 * Model
 */
class Orders extends Model
{
    use \October\Rain\Database\Traits\Validation;
    
    use \October\Rain\Database\Traits\SoftDelete;

    protected $dates = ['deleted_at'];


    /**
     * @var string The database table used by the model.
     */
    public $table = 'tps_birzha_orders';
    
    public $belongsTo = [
        'user' => ['RainLab\User\Models\User', 'table' => 'users'],
    ];
    
    public $hasMany = [
        'order_items' => ['TPS\Birzha\Models\OrderItems', 'key' => 'order_id', 'softDelete' => true],
        'vendor_sales' => ['TPS\Birzha\Models\VendorSales', 'key' => 'order_id', 'softDelete' => true],
    ];

    /**
     * @var array Validation rules
     */
    public $rules = [
    ];
}
