Class SliderAssignmentRepository

Class SliderAssignmentRepository

SliderAssignmentRepository implements SliderAssignmentRepositoryInterface

Methods summary

public __construct( CI_DB_query_builder $db )

SliderAssignmentRepository constructor.

public findAssignedSliderIdForEntityTypeAndEntityId( NonEmptyStringType $entityType, IdType $entityId ) : integer|null

Get the Slider ID for the provided entity type (category, content, product) and entity ID.

public store( IdType $sliderId, NonEmptyStringType $entityType, IdType $entityId ) : SliderAssignmentRepositoryInterface

Inserts a slider assignment into the database.

public deleteBySliderId( IdType $sliderId ) : SliderAssignmentRepositoryInterface

Deletes all slider assignments by the given slider ID.

public deleteByEntityTypeAndEntityId( NonEmptyStringType $entityType, IdType $entityId ) : SliderAssignmentRepositoryInterface

Deletes a slider assignment by the given entity type and entity ID.

protected _validateEntityType( NonEmptyStringType $entityType )

Validates the given entity type. Valid types are: category, content, product.

Properties summary

protected $table : string

Table name

'slider_assignments'
protected $db : CI_DB_query_builder

Query builder.