43 lines
890 B
PHP
43 lines
890 B
PHP
<?php namespace Tps\Reklama\Models;
|
|
|
|
use Model;
|
|
|
|
/**
|
|
* Model
|
|
*/
|
|
class Group 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 = 'tps_reklama_group';
|
|
|
|
/**
|
|
* @var array Validation rules
|
|
*/
|
|
public $rules = [
|
|
];
|
|
|
|
public $hasMany = [
|
|
'adds_count' => ['Tps\Reklama\Models\Reklama',
|
|
'table' => 'tps_reklama_item',
|
|
'count' => true
|
|
],
|
|
'adds' => ['Tps\Reklama\Models\Reklama',
|
|
'table' => 'tps_reklama_item',
|
|
'scope' => 'unExpiered'
|
|
// 'order' => 'order asc',
|
|
// 'condition' => 'active = 1'
|
|
],
|
|
];
|
|
}
|