48 lines
976 B
PHP
48 lines
976 B
PHP
<?php namespace Tps\Shops\Models;
|
|
|
|
use Model;
|
|
|
|
/**
|
|
* Model
|
|
*/
|
|
class Shop extends Model
|
|
{
|
|
use \October\Rain\Database\Traits\Validation;
|
|
|
|
public $implement = ['RainLab.Translate.Behaviors.TranslatableModel'];
|
|
/**
|
|
* @var string The database table used by the model.
|
|
*/
|
|
public $table = 'tps_shops_';
|
|
|
|
/**
|
|
* @var array Validation rules
|
|
*/
|
|
public $rules = [
|
|
];
|
|
|
|
public $fillable = ["name", "floor", "phone", "instagram_name", "instagram_link"];
|
|
|
|
public $attachOne = [
|
|
'badge' => 'System\Models\File',
|
|
'image' => 'System\Models\File',
|
|
];
|
|
|
|
public $belongsTo = [
|
|
'category' => [
|
|
'Tps\Shops\Models\Category'
|
|
],
|
|
'user' => [
|
|
'RainLab\User\Models\User'
|
|
],
|
|
];
|
|
|
|
public $hasMany = [
|
|
'reports' => [
|
|
'Tps\Shops\Models\ReportDetail',
|
|
]
|
|
];
|
|
|
|
public $translatable = ['name','description','open_time'];
|
|
}
|