\CatalogueCategory
Base class for all product categories stored in the database. The intention is to allow category objects to be extended in the same way as a more conventional "Page" object.
This allows users familier with working with the CMS a common
platform for developing ecommerce type functionality.
- Author: i-lateral (http://www.i-lateral.com)
Synopsis
class CatalogueCategory
extends DataObject
implements
PermissionProvider
{
- // members
- private static string $description = "A basic product category";
- private static array $db = ;
- private static array $has_one = ;
- private static array $many_many = ;
- private static array $many_many_extraFields = ;
- private static array $extensions = ;
- private static array $summary_fields = ;
- private static array $casting = ;
- private static string $default_sort = '"Sort" ASC';
- // methods
- public Boolean isEnabled()
- public Boolean isDisabled()
- public SiteConfig getSiteConfig()
- public string Link()
- public string AbsoluteLink()
- public string RelativeLink()
- public void getMenuTitle()
- public bool isCurrent()
- public bool isSection()
- public string LinkingMode()
- public string LinkOrSection()
- public string Breadcrumbs()
- public void Level()
- public ArrayList EnabledChildren()
- public ArrayList EnabledProducts()
- public ArrayList SortedProducts()
- public ArrayList AllProducts()
- public void getCMSFields()
- public void onBeforeWrite()
- public void onBeforeDelete()
- public void requireDefaultRecords()
- public void providePermissions()
- public void canView()
- public void canCreate()
- public void canEdit()
- public void canDelete()
Hierarchy
Extends
- DataObject
Implements
- PermissionProvider
Members
private
- $casting
- $db
- $default_sort
- $description
—
string
Description for this object that will get loaded by the website when it comes to creating it for the first time. - $extensions
- $has_one
- $many_many
- $many_many_extraFields
- $summary_fields
Methods
public
- AbsoluteLink() — Get the absolute URL for this page, including protocol and host.
- AllProducts() — Get a list of all products from this category and it's children categories.
- Breadcrumbs() — Return a breadcrumb trail for this product (which accounts for parent categories)
- EnabledChildren() — Return a list of child categories that are not disabled
- EnabledProducts() — Return a list of products in that category that are not disabled
- Level() — Returns the category in the current stack of the given level.
- Link() — Return the link for this {@link SimpleProduct} object, with the {@link Director::baseURL()} included.
- LinkOrSection() — Return "link" or "section" depending on if this is the current section.
- LinkingMode() — Return "link", "current" or section depending on if this page is the current page, or not on the current page but in the current section.
- RelativeLink() — Return the link for this {@link Category}
- SortedProducts() — Return sorted products in thsi category that are enabled
- canCreate()
- canDelete()
- canEdit()
- canView()
- getCMSFields()
- getMenuTitle()
- getSiteConfig() — Stub method to get the site config, unless the current class can provide an alternate.
- isCurrent() — Returns TRUE if this is the currently active category being used to handle a request.
- isDisabled() — Is this object disabled?
- isEnabled() — Is this object enabled?
- isSection() — Check if this object is in the currently active section (e.g. it is either current or one of it's children is currently being viewed).
- onBeforeDelete()
- onBeforeWrite()
- providePermissions()
- requireDefaultRecords()