public static function AddToCartItem::propertyDefinitions in Basic cart 8.2
Same name and namespace in other branches
- 8.6 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::propertyDefinitions()
- 8 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::propertyDefinitions()
- 8.0 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::propertyDefinitions()
- 8.3 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::propertyDefinitions()
- 8.4 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::propertyDefinitions()
- 8.5 src/Plugin/Field/FieldType/AddToCartItem.php \Drupal\basic_cart\Plugin\Field\FieldType\AddToCartItem::propertyDefinitions()
Defines field item properties.
Properties that are required to constitute a valid, non-empty item should be denoted with \Drupal\Core\TypedData\DataDefinition::setRequired().
Return value
\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.
Overrides FieldItemInterface::propertyDefinitions
See also
\Drupal\Core\Field\BaseFieldDefinition
File
- src/
Plugin/ Field/ FieldType/ AddToCartItem.php, line 51
Class
- AddToCartItem
- Plugin implementation of the 'addtocart' field type.
Namespace
Drupal\basic_cart\Plugin\Field\FieldTypeCode
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$config = Utility::cartSettings();
$properties['value'] = DataDefinition::create('boolean')
->setLabel(t($config
->get('add_to_cart_button')));
// $properties['no_ui'] = TRUE;.
return $properties;
}