TPS_web_october/plugins/akami/tps/models/Portfolio.php

52 lines
1014 B
PHP
Raw Permalink Normal View History

2024-04-03 13:18:37 +00:00
<?php namespace Akami\Tps\Models;
use Model;
/**
* Model
*/
class Portfolio 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 = 'akami_tps_portfolio';
public $implement = [
'@RainLab.Translate.Behaviors.TranslatableModel',
];
public $translatable = ['header', 'txt'];
public $belongsTo = [
'category' => \Akami\Tps\Models\PortfolioCategory::class
];
public function scopeGetBYCategory($query, $id)
{
if($id){
return $query->where('category_id', $id);
}
}
public $jsonable = ['img'];
/**
* @var array Validation rules
*/
public $rules = [
];
}