46 lines
859 B
PHP
Executable File
46 lines
859 B
PHP
Executable File
<?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->name;
|
|
}
|
|
|
|
public function getReportFieldAttribute() {
|
|
return $this->report->name;
|
|
}
|
|
}
|