57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Category
|
|
*
|
|
* @property int $id
|
|
* @property Collection|FooterCode[] $footer_codes
|
|
* @property Collection|CategoryTranslation[] $category_translations
|
|
* @property Collection|PressRelease[] $press_releases
|
|
* @property Collection|PromotionLink[] $promotion_links
|
|
* @property-read int|null $category_translations_count
|
|
* @property-read int|null $footer_codes_count
|
|
* @property-read int|null $press_releases_count
|
|
* @property-read int|null $promotion_links_count
|
|
*
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Category newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Category newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Category query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Category whereId($value)
|
|
*
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Category extends Model
|
|
{
|
|
protected $table = 'category';
|
|
|
|
public $timestamps = false;
|
|
|
|
public function footer_codes()
|
|
{
|
|
return $this->belongsToMany(FooterCode::class);
|
|
}
|
|
|
|
public function category_translations()
|
|
{
|
|
return $this->hasMany(CategoryTranslation::class, 'id');
|
|
}
|
|
|
|
public function press_releases()
|
|
{
|
|
return $this->hasMany(PressRelease::class);
|
|
}
|
|
|
|
public function promotion_links()
|
|
{
|
|
return $this->belongsToMany(PromotionLink::class, 'promotion_link_category');
|
|
}
|
|
}
|