<?php namespace Tps\Shops\Models;

use Model;

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

    /*
     * Disable timestamps by default.
     * Remove this line if timestamps are defined in the database table.
     */
    public $timestamps = false;


    /**
     * @var string The database table used by the model.
     */
    public $table = 'tps_shops_report_details';

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

    public $belongsTo = [
        'report' => [
            'Tps\Shops\Models\Report'
        ],
        'shop' => [
            'Tps\Shops\Models\Shop'
        ],
    ];

    public function getShopFieldAttribute() {
        return $this->shop != null ? $this->shop->name : '';
    }

    public function getReportFieldAttribute() {
        return $this->report != null ? $this->report->name : '';
    }
}
