You are here

class CommerceCouponUsageTransactionViewsController in Commerce Coupon 7.2

Commerce Coupon usage transaction entity Views definitions.

Hierarchy

Expanded class hierarchy of CommerceCouponUsageTransactionViewsController

1 string reference to 'CommerceCouponUsageTransactionViewsController'
commerce_coupon_usage_entity_info in modules/usage/commerce_coupon_usage.module
Implements hook_entity_info().

File

modules/usage/includes/views/commerce_coupon_usage.views.inc, line 10
Views plugin and data definitions for Commerce Coupon Usage.

View source
class CommerceCouponUsageTransactionViewsController extends EntityDefaultViewsController {

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

    // Make date a date field.
    $data['commerce_coupon_usage_transaction']['date'] = array(
      'title' => t('Date'),
      'help' => t('The date the transaction occurred.'),
      'field' => array(
        'handler' => 'views_handler_field_date',
        'click sortable' => TRUE,
      ),
      'sort' => array(
        'handler' => 'views_handler_sort_date',
      ),
      'filter' => array(
        'handler' => 'views_handler_filter_date',
      ),
    );

    // Coupon relationship.
    $data['commerce_coupon_usage_transaction']['coupon_id']['relationship'] = array(
      'handler' => 'views_handler_relationship',
      'base' => 'commerce_coupon',
      'field' => 'coupon_id',
      'label' => t('Coupon'),
    );

    // Order relationship.
    $data['commerce_coupon_usage_transaction']['order_id']['relationship'] = array(
      'handler' => 'views_handler_relationship',
      'base' => 'commerce_order',
      'field' => 'order_id',
      'label' => t('Coupon'),
    );

    // Coupon argument type.
    $data['commerce_coupon_usage_transaction']['coupon_id']['argument'] = array(
      'handler' => 'commerce_coupon_handler_argument_coupon_id',
    );
    $data['commerce_coupon_usage_transaction']['remove'] = array(
      'field' => array(
        'title' => t('Remove button'),
        'help' => t('Button to remove a coupon usage transaction.'),
        'handler' => 'commerce_coupon_usage_views_handler_field_remove',
      ),
    );
    return $data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommerceCouponUsageTransactionViewsController::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