2023-07-23 05:57:06 +00:00
|
|
|
<?php namespace TPS\Birzha\Models;
|
|
|
|
|
|
|
|
|
|
use Model;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Model
|
|
|
|
|
*/
|
|
|
|
|
class Term extends Model
|
|
|
|
|
{
|
|
|
|
|
use \October\Rain\Database\Traits\Validation;
|
|
|
|
|
|
|
|
|
|
use \October\Rain\Database\Traits\SoftDelete;
|
|
|
|
|
|
|
|
|
|
protected $dates = ['deleted_at'];
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Disable timestamps by default.
|
|
|
|
|
* Remove this line if timestamps are defined in the database table.
|
|
|
|
|
*/
|
|
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
|
|
public $implement = ['@RainLab.Translate.Behaviors.TranslatableModel'];
|
|
|
|
|
/**
|
|
|
|
|
* @var string The database table used by the model.
|
|
|
|
|
*/
|
|
|
|
|
public $table = 'tps_birzha_terms';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var array Validation rules
|
|
|
|
|
*/
|
|
|
|
|
public $rules = [
|
|
|
|
|
'name' => 'required'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public $translatable = ['name'];
|
|
|
|
|
|
2023-07-27 20:13:51 +00:00
|
|
|
public function scopeAbout($query){
|
|
|
|
|
return $query->where('type','about');
|
2023-07-23 05:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 20:13:51 +00:00
|
|
|
public function scopePrivacy($query){
|
|
|
|
|
return $query->where('type','privacy');
|
2023-07-23 05:57:06 +00:00
|
|
|
}
|
2023-10-03 11:42:10 +00:00
|
|
|
|
|
|
|
|
public function scopeProdAdd($query){
|
|
|
|
|
return $query->where('type','success_prod_add');
|
|
|
|
|
}
|
2023-07-23 05:57:06 +00:00
|
|
|
}
|