Sunnysideup\Ecommerce\ProductsAndGroups\Builders\RelatedProductGroups
A wrapper for a list of {@link Sunnysideup\Ecommerce\Pages\ProductGroup} instances.
Provides short cuts for ways to retrieve the nested structure or related
groups
- Author: : Nicolaas [at] Sunny Side Up .co.nz
Synopsis
class RelatedProductGroups
{
- // constants
- const SHOW_PRODUCT_LEVELS = ;
- // members
- protected null|DataList $groups;
- protected integer $levelsToShow = 0;
- protected ProductGroup $rootGroup;
- protected bool $includeRoot = true;
- private static array $default_product_group_filter = ;
- // methods
- public void __construct()
- public static DataList apply_default_filter_to_groups()
- public void getShowProductLevelsArray()
- public void setRootGroup()
- public void setLevelOfProductsToShow()
- public void setIncludeRoot()
- public void getLevelOfProductsToShow()
- public void getParentGroupIds()
- public DataList getGroups()
- protected void getGroupsRecursive()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
SHOW_PRODUCT_LEVELS |
Members
private
- $default_product_group_filter
—
array
default filter.
protected
- $groups — Sunnysideup\Ecommerce\ProductsAndGroups\Builders\null|DataList
- $includeRoot — Sunnysideup\Ecommerce\ProductsAndGroups\Builders\bool
- $levelsToShow
—
int
How deep to go special cases: -2 => 'None', -1 => 'All products',. - $rootGroup — Sunnysideup\Ecommerce\Pages\ProductGroup
Methods
protected
- getGroupsRecursive() — Returns all the Group IDs under a given root group to a max depth.
public
- __construct()
- apply_default_filter_to_groups()
- getGroups()
- getLevelOfProductsToShow()
- getParentGroupIds()
- getShowProductLevelsArray()
- setIncludeRoot() — do we include the root?
- setLevelOfProductsToShow() — how many levels deep do we go?
- setRootGroup() — what is the the product group we are working with?