SliderAssignmentRepository

Implements \SliderAssignmentRepositoryInterface

Class SliderAssignmentRepository

category

System

package

Slider

subpackage

Repositories

Methods

SliderAssignmentRepository constructor.

__construct(\CI_DB_query_builder $db) 

Arguments

$db

\CI_DB_query_builder

Query builder.

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

_validateEntityType(\NonEmptyStringType $entityType) 
Throws
\InvalidArgumentException

If the given entity type is not valid.

Arguments

$entityType

\NonEmptyStringType

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

deleteByEntityTypeAndEntityId(\NonEmptyStringType $entityType, \IdType $entityId) : \SliderAssignmentRepositoryInterface
Throws
\InvalidArgumentException

If the given entity type is not valid.

Arguments

$entityType

\NonEmptyStringType

$entityId

\IdType

Response

\SliderAssignmentRepositoryInterface

Same instance for method chaining.

Deletes all slider assignments by the given slider ID.

deleteBySliderId(\IdType $sliderId) : \SliderAssignmentRepositoryInterface

Arguments

$sliderId

\IdType

Response

\SliderAssignmentRepositoryInterface

Same instance for method chaining.

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

findAssignedSliderIdForEntityTypeAndEntityId(\NonEmptyStringType $entityType, \IdType $entityId) : integer|null
Throws
\InvalidArgumentException

If the given entity type is not valid.

Arguments

$entityType

\NonEmptyStringType

$entityId

\IdType

Response

integer|null

Returns the ID of the slider which is assigned for the given content id or null if no record was found.

Inserts a slider assignment into the database.

store(\IdType $sliderId, \NonEmptyStringType $entityType, \IdType $entityId) : \SliderAssignmentRepositoryInterface
Throws
\InvalidArgumentException

If the given entity type is not valid.

Arguments

$sliderId

\IdType

$entityType

\NonEmptyStringType

$entityId

\IdType

Response

\SliderAssignmentRepositoryInterface

Same instance for method chaining.

Properties

Table name

table : string
var

Type(s)

string

Query builder.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder