\Pricelist
Class Pricelist
Synopsis
class Pricelist
extends DataObject
implements
PermissionProvider
{
- // members
- private static boolean $include_stylesheet = false;
- private static string $currency_sign = '€';
- private static string $currency_side = 'right';
- private static array $db = ;
- private static array $many_many = ;
- private static array $many_many_extraFields = ;
- private static array $belongs_many_many = ;
- private static array $summary_fields = ;
- private static string $default_sort = 'SortOrder';
- // methods
- public void fieldLabels()
- public void getCMSFields()
- public static void Columns()
- public static void IncludeStylesheet()
- public void forTemplate()
- public void providePermissions()
- public void canCreate()
- public void canEdit()
- public void canDelete()
- public void canView()
- public string SummaryTitle()
- public string SummaryDescription()
Hierarchy
Extends
- DataObject
Implements
- PermissionProvider
Tasks
Line | Task |
---|---|
110 | Make the function non static so that different pricelists can have different column sets. Also implement some flexible way to define the columns instead of hardcoding them here. |
Members
private
- $belongs_many_many
- $currency_side
—
string
To which side of a price the currency sign should be placed. Can be 'left' or 'right'. -
$currency_sign
A string/character that should be displayed next to a price. - $db
- $default_sort
-
$include_stylesheet
Whether to use the Requirements class to include this module's own stylesheet in frontend to perform some small styling. Off by default. - $many_many
- $many_many_extraFields
- $summary_fields
Methods
public
- Columns()
- IncludeStylesheet() — Uses the Requirements class to include the module's own stylesheet when rendering content that needs it in the frontend. However, it only does this if it's permitted by the configuration variable Pricelist::$include_stylesheet.
- SummaryDescription() — Removes HTML tags from the Description field so that it can be used in the $summary_fields.
- SummaryTitle() — Used in the backend to display the Pricelist Title - or, if it's empty, a generic pricelist word just to make the pricelist row to be notable in the GridField editor.
- canCreate()
- canDelete()
- canEdit()
- canView()
- fieldLabels()
- forTemplate()
- getCMSFields()
- providePermissions() — Return a map of permission codes to add to the dropdown shown in the Security section of the CMS.