You are here

class CommerceGCTransactionViewsController in Commerce GC 7

Commerce discount entity Views definitions.

Hierarchy

Expanded class hierarchy of CommerceGCTransactionViewsController

1 string reference to 'CommerceGCTransactionViewsController'
commerce_gc_entity_info in ./commerce_gc.module

File

includes/views/commerce_gc.views.inc, line 55
Provides support for the Views module.

View source
class CommerceGCTransactionViewsController extends EntityDefaultViewsController {

  /**
   * Override EntityDefaultViewsController::views_data().
   */
  public function views_data() {
    $data = parent::views_data();
    $data['commerce_gc_transaction']['table']['base']['access query tag'] = 'commerce_gc_transaction_access';

    // Make amount a currency field
    $data['commerce_gc_transaction']['amount']['field'] = array(
      'handler' => 'commerce_gc_handler_field_amount',
    );
    $data['commerce_gc_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_gc_transaction']['coupon_id']['relationship'] = array(
      'handler' => 'views_handler_relationship',
      'base' => 'commerce_coupon',
      'field' => 'coupon_id',
      'label' => t('Coupon'),
    );

    // Giftcard balance summary field
    $data['commerce_gc_transaction']['delete'] = array(
      'field' => array(
        'title' => t('Delete transaction link'),
        'help' => t('Provides a link to delete a transaction.'),
        'handler' => 'commerce_gc_handler_field_transaction_delete',
      ),
    );
    return $data;
  }

}

Members

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