presseportale/dev/Models/PressRelease.php
Kevin Adametz 405df0a122
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
first commit
2025-10-20 17:53:02 +02:00

126 lines
4.1 KiB
PHP

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class PressRelease
*
* @property int $id
* @property string $title
* @property string $language
* @property string $text
* @property string|null $backlink_url
* @property int $category_id
* @property int $user_id
* @property int|null $company_id
* @property int|null $user_payment_id
* @property int|null $payment
* @property string|null $status
* @property int|null $hits
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string|null $slug
* @property int $teaser_begin
* @property int $teaser_end
* @property int $no_export
* @property string|null $keywords
* @property Category $category
* @property Company|null $company
* @property SfGuardUser $sf_guard_user
* @property Collection|Contact[] $contacts
* @property Collection|PressReleaseImageOld[] $press_release_image_olds
* @package App\Models
* @property-read int|null $contacts_count
* @property-read int|null $press_release_image_olds_count
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease query()
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereBacklinkUrl($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCompanyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereHits($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereKeywords($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereLanguage($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereNoExport($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease wherePayment($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTeaserBegin($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTeaserEnd($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereText($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PressRelease whereUserPaymentId($value)
* @mixin \Eloquent
*/
class PressRelease extends Model
{
protected $table = 'press_release';
protected $casts = [
'category_id' => 'int',
'user_id' => 'int',
'company_id' => 'int',
'user_payment_id' => 'int',
'payment' => 'int',
'hits' => 'int',
'teaser_begin' => 'int',
'teaser_end' => 'int',
'no_export' => 'int'
];
protected $fillable = [
'title',
'language',
'text',
'backlink_url',
'category_id',
'user_id',
'company_id',
'user_payment_id',
'payment',
'status',
'hits',
'slug',
'teaser_begin',
'teaser_end',
'no_export',
'keywords'
];
public function category()
{
return $this->belongsTo(Category::class);
}
public function company()
{
return $this->belongsTo(Company::class);
}
public function sf_guard_user()
{
return $this->belongsTo(SfGuardUser::class, 'user_id');
}
public function contacts()
{
return $this->belongsToMany(Contact::class, 'press_release_contact');
}
public function press_release_image_olds()
{
return $this->hasMany(PressReleaseImageOld::class);
}
}