gurl_o/plugins/tps/birzha/models/Term.php

49 lines
1.0 KiB
PHP

<?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'];
public function scopeAbout($query){
return $query->where('type','about');
}
public function scopePrivacy($query){
return $query->where('type','privacy');
}
public function scopeProdAdd($query){
return $query->where('type','success_prod_add');
}
}