ProductAssociation
class ProductAssociation extends BaseModel (View source)
Traits
Constants
CROSS_SELL |
Define the cross sell type. |
UP_SELL |
Define the up sell type. |
ALTERNATE |
Define the alternate type. |
Properties
protected array | $fillable | Define the fillable attributes. |
|
int | $id | ||
int | $product_parent_id | ||
int | $product_target_id | ||
string | $type | ||
Carbon | $created_at | ||
Carbon | $updated_at |
Methods
Get new instance of the registered model.
Handle dynamic and static method calls into the model.
Forward a method call to the model only when calling a method on the model.
Register a model event with the dispatcher.
Fire the given event for the model.
Remove all the event listeners for the model.
Handle dynamic static method calls into the model.
Return a new factory instance for the model.
Return the parent relationship.
Return the parent relationship.
Apply the cross sell scope.
Apply the up sell scope.
Apply the up alternate scope.
Apply the type scope.
Details
Model
newInstance(array $attributes = [], bool $exists = false)
Get new instance of the registered model.
mixed
__call(string $method, array $parameters)
Handle dynamic and static method calls into the model.
Model
swap(string $newModelClass)
Swap the model implementation.
string
getMorphClass()
Get the class name of the base model.
protected bool
forwardCallsWhen(string $method, Model $model)
Forward a method call to the model only when calling a method on the model.
static protected void
registerModelEvent(string $event, QueuedClosure|Closure|string $callback)
Register a model event with the dispatcher.
protected mixed
fireModelEvent(string $event, bool $halt = true)
Fire the given event for the model.
static void
flushEventListeners()
Remove all the event listeners for the model.
__construct(array $attributes = [])
Create a new instance of the Model.
MorphOne
thumbnail()
Relationship for thumbnail.
void
registerMediaCollections()
No description
void
registerMediaConversions(Media $media = null)
No description
static mixed
__callStatic(string $method, array $parameters)
Handle dynamic static method calls into the model.
static protected ProductAssociationFactory
newFactory()
Return a new factory instance for the model.
BelongsTo
parent()
Return the parent relationship.
BelongsTo
target()
Return the parent relationship.
void
scopeCrossSell(Builder $query)
Apply the cross sell scope.
void
scopeUpSell(Builder $query)
Apply the up sell scope.
void
scopeAlternate(Builder $query)
Apply the up alternate scope.
void
scopeType(Builder $query, string $type)
Apply the type scope.