You are here

class CommerceDiscountMetadataController in Commerce Discount 7

Extend the defaults metadata properties for Commerce discount entity.

Hierarchy

Expanded class hierarchy of CommerceDiscountMetadataController

1 string reference to 'CommerceDiscountMetadataController'
commerce_discount_entity_info in ./commerce_discount.module
Implements hook_entity_info().

File

./commerce_discount.info.inc, line 11
Provides Entity metadata integration.

View source
class CommerceDiscountMetadataController extends EntityDefaultMetadataController {

  /**
   * {@inheritdoc}
   */
  public function entityPropertyInfo() {
    $info = parent::entityPropertyInfo();
    $properties =& $info[$this->type]['properties'];

    // Update certain elements of the property info array.
    $properties['discount_id']['label'] = t('Discount ID');
    $properties['discount_id']['description'] = t('The serial numeric ID of the discount.');
    $properties['name']['label'] = t('Machine name');
    $properties['name']['description'] = t('The text machine name of the discount.');
    $properties['label']['label'] = t('Admin title');
    $properties['label']['description'] = t('The label used for the discount on administrative screens.');
    $properties['type']['description'] = t('The type of the discount (e.g. Order vs. Product).');
    $properties['status']['type'] = 'boolean';
    $properties['status']['description'] = t('The status of the discount (i.e. Active vs. Disabled).');
    $properties['status']['setter callback'] = 'entity_property_verbatim_set';
    $properties['export_status']['label'] = t('Export status');
    $properties['export_status']['description'] = t('The exportable status of the discount.');
    $properties['module']['description'] = t('The name of the module that defined the discount if applicable.');
    $properties['component_title']['label'] = t('Name');
    $properties['component_title']['description'] = t('The name of the discount as shown to customers (e.g. in the price component list).');
    $properties['sort_order']['label'] = t('Sort order');
    $properties['sort_order']['description'] = t('The default sort order of the rule created for the discount.');
    return $info;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommerceDiscountMetadataController::entityPropertyInfo public function Overrides EntityDefaultMetadataController::entityPropertyInfo
EntityDefaultMetadataController::$type protected property
EntityDefaultMetadataController::bundleOptionsList public static function A options list callback returning all bundles for an entity type.
EntityDefaultMetadataController::convertSchema protected function Return a set of properties for an entity based on the schema definition
EntityDefaultMetadataController::__construct public function