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 = [
|
|
|
|
|
];
|
|
|
|
|
}
|