class SlotFilterer (View source)

Responsible for filtering slot templates down to the appropriate ones given design criteria on the board, total content slots in templates, etc.

..

Properties

protected AvailableTemplateCollectionFactory $availableTemplateCollectionFactory

Methods

__construct(AvailableTemplateCollectionFactory $availableTemplateCollectionFactory)

SlotFilterer constructor.

array
sortTemplatesForSlotNumber(array $validTemplatesForSlotNumber, int $slot)

Given an array of potential slot templates, let's reorder them so that we don't just have the same types of templates showing up all the time.

array
getPotentialSlotTemplates(PlannedInstance $plannedInstance, int $slot)

Given a planned instance and a slot number, get all potential templates that could work. This filters out templates not available for the current board instance, as well as templates that have more content slots than what are remaining in the planned instance object.

getPossibleContentObjectCollection(PlannedInstance $plannedInstance, SlotTemplate $potentialTemplate)

No description

createValidContentObjectCollection(PlannedInstance $plannedInstance, PossibleContentObjectCollection $possibleContentObjectCollection, int $slot)

No description

PlannedSlotTemplate|null
findValidTemplateForSlot(PlannedInstance $plannedInstance, array $templateChoices, int $slot)

No description

Details

__construct(AvailableTemplateCollectionFactory $availableTemplateCollectionFactory)

SlotFilterer constructor.

Parameters

AvailableTemplateCollectionFactory $availableTemplateCollectionFactory

protected array sortTemplatesForSlotNumber(array $validTemplatesForSlotNumber, int $slot)

Given an array of potential slot templates, let's reorder them so that we don't just have the same types of templates showing up all the time.

Parameters

array $validTemplatesForSlotNumber
int $slot

Return Value

array

array getPotentialSlotTemplates(PlannedInstance $plannedInstance, int $slot)

Given a planned instance and a slot number, get all potential templates that could work. This filters out templates not available for the current board instance, as well as templates that have more content slots than what are remaining in the planned instance object.

Parameters

PlannedInstance $plannedInstance
int $slot

Return Value

array

protected getPossibleContentObjectCollection(PlannedInstance $plannedInstance, SlotTemplate $potentialTemplate)

No description

Parameters

PlannedInstance $plannedInstance
SlotTemplate $potentialTemplate

protected createValidContentObjectCollection(PlannedInstance $plannedInstance, PossibleContentObjectCollection $possibleContentObjectCollection, int $slot)

No description

Parameters

PlannedInstance $plannedInstance
PossibleContentObjectCollection $possibleContentObjectCollection
int $slot

PlannedSlotTemplate|null findValidTemplateForSlot(PlannedInstance $plannedInstance, array $templateChoices, int $slot)

No description

Parameters

PlannedInstance $plannedInstance
array $templateChoices
int $slot

Return Value

PlannedSlotTemplate|null