You are here

class CommerceDiscountViewsController in Commerce Discount 7

Commerce discount entity Views definitions.

Hierarchy

Expanded class hierarchy of CommerceDiscountViewsController

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

File

includes/views/commerce_discount.views.inc, line 11
Provides support for the Views module.

View source
class CommerceDiscountViewsController extends EntityDefaultViewsController {

  /**
   * Override EntityDefaultViewsController::views_data().
   */
  public function views_data() {
    $data = parent::views_data();

    // Expose the product status.
    $data['commerce_discount']['status'] = array(
      'title' => t('Status'),
      'help' => t('Whether or not the discount is active.'),
      'field' => array(
        'handler' => 'views_handler_field_boolean',
        'click sortable' => TRUE,
        'output formats' => array(
          'active-disabled' => array(
            t('Active'),
            t('Disabled'),
          ),
        ),
      ),
      'filter' => array(
        'handler' => 'views_handler_filter_boolean_operator',
        'label' => t('Active'),
        'type' => 'yes-no',
      ),
      'sort' => array(
        'handler' => 'views_handler_sort',
      ),
    );

    // Show the operations using CTools dropbutton menu.
    $data['commerce_discount']['operations_dropbutton'] = array(
      'title' => t('Operations'),
      'help' => t('Show the operation links using dropbutton menu.'),
      'field' => array(
        'handler' => 'commerce_discount_handler_field_operations_dropbutton',
      ),
      // This is a dummy field, so attach it to the ID column.
      'real field' => 'discount_id',
    );
    return $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommerceDiscountViewsController::views_data public function Override EntityDefaultViewsController::views_data(). Overrides EntityDefaultViewsController::views_data
EntityDefaultViewsController::$type protected property
EntityDefaultViewsController::getRelationshipHandlerClass public function Determines the handler to use for a relationship to an entity type.
EntityDefaultViewsController::map_from_schema_info protected function Comes up with views information based on the given schema and property info.
EntityDefaultViewsController::optionsListCallback public static function A callback returning property options, suitable to be used as views options callback.
EntityDefaultViewsController::schema_fields protected function Try to come up with some views fields with the help of the schema and the entity property information.
EntityDefaultViewsController::schema_revision_fields protected function Try to come up with some views fields with the help of the revision schema and the entity property information.
EntityDefaultViewsController::__construct public function