Promotion
extends AbstractBaseCrmModel
in package
Uses
HasFactory, LogsActivity, Notifiable, PowerJoins, SoftDeletes
Table of Contents
- table = "crm__promotions"
- Table name, as constant, used to avoid table name duplication across the source code base.
- table_price_list_relation = "crm__promotions_price_lists"
- The table name for the many-to-many relation with the Networks
- $activityLogName : string
- $casts : array<string|int, string>
- The attributes that should be casted
- $fillable : array<int, string>
- The attributes that are mass assignable.
- $jobsEnabled : bool
- This parameter specify if jobs should be launched or not
- $table : string
- Table name
- customer() : BelongsTo
- The customer for which the promotion is active, or none if it's available for all customers
- getActivitylogOptions() : LogOptions
- Specifies which model properties should be logged in the activy log
- priceLists() : BelongsToMany
- The price lists that are eligible for this promotion
- promotionCustomers() : HasMany
- The customers that activated the promotion Populated only if the promotions has require_promo_code = true
- saveWithoutJobs() : mixed
- withoutJobs() : mixed
- Executes the callback disabling the jobs launching
- newFactory() : PromotionFactory
- Get the Factory Class
Constants
table
Table name, as constant, used to avoid table name duplication across the source code base.
public
mixed
table
= "crm__promotions"
Tags
table_price_list_relation
The table name for the many-to-many relation with the Networks
public
string
table_price_list_relation
= "crm__promotions_price_lists"
Properties
$activityLogName
public
static string
$activityLogName
= "crud"
$casts
The attributes that should be casted
protected
array<string|int, string>
$casts
= ['status' => \Athomos\Bennu\Modules\Crm\Enums\PromotionStatus::class]
$fillable
The attributes that are mass assignable.
protected
array<int, string>
$fillable
= []
$jobsEnabled
This parameter specify if jobs should be launched or not
protected
bool
$jobsEnabled
= true
$table
Table name
protected
string
$table
= self::table
Methods
customer()
The customer for which the promotion is active, or none if it's available for all customers
public
customer() : BelongsTo
Return values
BelongsTo —getActivitylogOptions()
Specifies which model properties should be logged in the activy log
public
getActivitylogOptions() : LogOptions
Return values
LogOptions —priceLists()
The price lists that are eligible for this promotion
public
priceLists() : BelongsToMany
Return values
BelongsToMany —promotionCustomers()
The customers that activated the promotion Populated only if the promotions has require_promo_code = true
public
promotionCustomers() : HasMany
Return values
HasMany —saveWithoutJobs()
public
saveWithoutJobs() : mixed
Return values
mixed —withoutJobs()
Executes the callback disabling the jobs launching
public
withoutJobs(callable $callback) : mixed
Parameters
- $callback : callable
Return values
mixed —newFactory()
Get the Factory Class
protected
static newFactory() : PromotionFactory