\DevOwl\TcfVendorListNormalizeStackCalculator

Quote from docs: Stacks may be used to substitute Initial Layer information about two or more Purposes and/or Special Features (also see Appendix B). Purposes must not be included in more than one Stack, and must not be presented as part of a Stack and outside of Stacks at the same time. Conversely, any Stacks used must not include the same Purpose more than once, nor include Purposes presented separately from Stacks.

Summary

Methods
Properties
Constants
__construct()
calculateBestSuitableStacks()
No public properties found
STACK_DECLARATIONS
usedDeclarationToStack()
scoring()
sortByScore()
No protected properties found
N/A
No private methods found
$originalStacks
$stacks
$usedDeclarations
$scoreMap
N/A

Constants

STACK_DECLARATIONS

STACK_DECLARATIONS =array(\DevOwl\TcfVendorListNormalize\Persist::DECLARATION_TYPE_PURPOSES, \DevOwl\TcfVendorListNormalize\Persist::DECLARATION_TYPE_SPECIAL_FEATURES)

Properties

$originalStacks

$originalStacks :

Clone stacks so we can obtain the original object by ID for the result.

Type

$stacks

$stacks :

Type

$usedDeclarations

$usedDeclarations :

Type

$scoreMap

$scoreMap :

Type

Methods

__construct()

__construct(array  $stacks,array  $usedDeclarations)

See class description.

Parameters

array $stacks

A list of all available stacks (see Query::stacks)

array $usedDeclarations

List of used declarations as map (purposes and specialPurposes)

calculateBestSuitableStacks()

calculateBestSuitableStacks()

Return best suitable stacks for the current used declarations.

usedDeclarationToStack()

usedDeclarationToStack()

Get best suitable stack for all our used purposes.

scoring()

scoring()

Rate each stack how many purposes and special features suit our used purposes, and remove unused stacks.

sortByScore()

sortByScore(array  $stacks,boolean  $truncateScores = false)

Sort a given array of stacks by score.

Parameters

array $stacks
boolean $truncateScores

If true, the score fields will be removed from the array