94 lines
2.9 KiB
PHP
94 lines
2.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class PaymentOption
|
|
*
|
|
* @property int $id
|
|
* @property string $article_number
|
|
* @property string $type
|
|
* @property float $price
|
|
* @property int|null $is_hidden
|
|
* @property string|null $event_name_prefix
|
|
* @property int|null $activate_on_first_payment
|
|
* @property Collection|Coupon[] $coupons
|
|
* @property PaymentOptionAccessGroup $payment_option_access_group
|
|
* @property PaymentOptionExcludeGroup $payment_option_exclude_group
|
|
* @property PaymentOptionReference $payment_option_reference
|
|
* @property PaymentOptionTranslation $payment_option_translation
|
|
* @property Collection|UserPaymentOption[] $user_payment_options
|
|
* @property-read int|null $coupons_count
|
|
* @property-read int|null $user_payment_options_count
|
|
*
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereActivateOnFirstPayment($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereArticleNumber($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereEventNamePrefix($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereIsHidden($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption wherePrice($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|PaymentOption whereType($value)
|
|
*
|
|
* @mixin \Eloquent
|
|
*/
|
|
class PaymentOption extends Model
|
|
{
|
|
protected $table = 'payment_option';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'price' => 'float',
|
|
'is_hidden' => 'int',
|
|
'activate_on_first_payment' => 'int',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'article_number',
|
|
'type',
|
|
'price',
|
|
'is_hidden',
|
|
'event_name_prefix',
|
|
'activate_on_first_payment',
|
|
];
|
|
|
|
public function coupons()
|
|
{
|
|
return $this->hasMany(Coupon::class);
|
|
}
|
|
|
|
public function payment_option_access_group()
|
|
{
|
|
return $this->hasOne(PaymentOptionAccessGroup::class);
|
|
}
|
|
|
|
public function payment_option_exclude_group()
|
|
{
|
|
return $this->hasOne(PaymentOptionExcludeGroup::class);
|
|
}
|
|
|
|
public function payment_option_reference()
|
|
{
|
|
return $this->hasOne(PaymentOptionReference::class, 'parent_payment_option_id');
|
|
}
|
|
|
|
public function payment_option_translation()
|
|
{
|
|
return $this->hasOne(PaymentOptionTranslation::class, 'id');
|
|
}
|
|
|
|
public function user_payment_options()
|
|
{
|
|
return $this->hasMany(UserPaymentOption::class);
|
|
}
|
|
}
|