Sunnysideup\EcommerceProductVariation\Model\TypesAndValues\ProductAttributeType
This class contains list items such as "size", "colour" Not XL, Red, etc..., but the lists that contain the ProductAttributeValues.
For a clothing store you will have two entries:
- Size
- Colour
Synopsis
class ProductAttributeType
extends DataObject
implements
EditableEcommerceObject
{
- // members
- private static array $api_access = ;
- private static string $table_name = 'ProductAttributeType';
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $belongs_many_many = ;
- private static array $casting = ;
- private static array $indexes = ;
- private static string $default_sort = '"Sort" ASC, "Name"';
- private static $dropdown_field_for_orderform = DropdownField::class;
- private static string $singular_name = 'Variation Attribute Type';
- private static string $plural_name = 'Variation Attribute Types';
- private static array $_drop_down_values = ;
- // methods
- public void i18n_singular_name()
- public void i18n_plural_name()
- public static void get_plural_name()
- public static ProductAttributeType find_or_make()
- public void getCMSFields()
- public string CMSEditLink()
- public void addValues()
- public ArrayList convertArrayToValues()
- public DropdownField getDropDownField()
- public array getValuesForDropdown()
- public boolean canDelete()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void onBeforeDelete()
- public void cleanup()
- public string getFullName()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Implements
- Sunnysideup\Ecommerce\Interfaces\EditableEcommerceObject
Tasks
Line | Task |
---|---|
200 | make this a really fast editing interface. Table list field?? |
Members
private
- $_drop_down_values
-
$api_access
Standard SS variable. -
$belongs_many_many
Standard SS variable. -
$casting
Standard SS variable. - $db
-
$default_sort
Standard SS variable. - $dropdown_field_for_orderform
-
$has_many
Standard SS variable. -
$has_one
Standard SS variable. -
$indexes
Standard SS variable. -
$plural_name
Standard SS variable. -
$searchable_fields
Standard SS variable. -
$singular_name
Standard SS variable. -
$summary_fields
Standard SS variable. -
$table_name
### @@@@ START REPLACEMENT @@@@ ### OLD: private static $db (case sensitive) NEW: private static $db (COMPLEX) EXP: Check that is class indeed extends DataObject and that it is not a data-extension! ### @@@@ STOP REPLACEMENT @@@@ ###
Methods
public
- CMSEditLink() — link to edit the record
- addValues() — add more values to a type array should be an something like red, blue, orange (strings NOT objects)
- canDelete() — It can be deleted if all its Values can be deleted only...
- cleanup()
- convertArrayToValues() — takes an array of values and finds them or creates them.
- find_or_make() — finds or makes a ProductAttributeType, based on the lower case Name.
- getCMSFields() — Standard SS Methodd.
- getDropDownField()
- getFullName() — useful for GridField
- getValuesForDropdown()
- get_plural_name()
- i18n_plural_name()
- i18n_singular_name()
- onAfterWrite()
- onBeforeDelete() — Delete all the values that are related to this type.
- onBeforeWrite() — standard SS method Adds a name if there is no name.