class CommerceOptionUIController in Commerce Product Option 7.2
@file Extends the EntityDefaultUIController so we have a better admnin UI.
Hierarchy
- class \EntityDefaultUIController
- class \CommerceOptionUIController
Expanded class hierarchy of CommerceOptionUIController
1 string reference to 'CommerceOptionUIController'
- commerce_option_entity_info in ./
commerce_option.module - Implements hook_entity_info().
File
- ./
commerce_option.inc, line 8 - Extends the EntityDefaultUIController so we have a better admnin UI.
View source
class CommerceOptionUIController extends EntityDefaultUIController {
/**
* Generates the table headers for the overview table.
*/
protected function overviewTableHeaders($conditions, $rows, $additional_header = array()) {
$header = array(
t('Option id'),
t('Option set id'),
t('Order id'),
t('Commerce product'),
t('Commerce product id'),
);
// Add operations with the right colspan.
$header[] = array(
'data' => t('Operations'),
'colspan' => $this
->operationCount(),
);
return $header;
}
/**
* Generates the row for the passed entity.
*
* @param $additional_cols
* Additional columns to be added after the entity label column.
*/
protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
// Option ID.
$row[] = $entity->option_id;
// Type
$row[] = entity_label($this->entityType, $entity);
// Order info.
$line_item = commerce_line_item_load($entity->line_item_id);
$liw = entity_metadata_wrapper('commerce_line_item', $line_item);
$row[] = l($liw->order_id
->value(), 'admin/commerce/orders/' . $liw->order_id
->value() . '/view');
$row[] = $liw->commerce_product->title
->value();
$row[] = $liw->commerce_product->product_id
->value();
// Operations.
$row[] = l(t('edit'), $this->path . '/manage/' . $id);
$row[] = l(t('delete'), $this->path . '/manage/' . $id . '/delete', array(
'query' => drupal_get_destination(),
));
return $row;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommerceOptionUIController:: |
protected | function |
Generates the table headers for the overview table. Overrides EntityDefaultUIController:: |
|
CommerceOptionUIController:: |
protected | function |
Generates the row for the passed entity. Overrides EntityDefaultUIController:: |
|
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
public | property | Defines the number of entries to show per page in overview table. | |
EntityDefaultUIController:: |
public | function | Applies an operation to the given entity. | |
EntityDefaultUIController:: |
public | function | Entity submit builder invoked via entity_ui_form_submit_build_entity(). | |
EntityDefaultUIController:: |
public | function | Provides definitions for implementing hook_forms(). | |
EntityDefaultUIController:: |
public | function | Provides definitions for implementing hook_menu(). | 1 |
EntityDefaultUIController:: |
protected | function | Returns the operation count for calculating colspans. | |
EntityDefaultUIController:: |
public | function | Builds the operation form. | |
EntityDefaultUIController:: |
public | function | Operation form submit callback. | 1 |
EntityDefaultUIController:: |
public | function | Operation form validation callback. | |
EntityDefaultUIController:: |
public | function | Builds the entity overview form. | |
EntityDefaultUIController:: |
public | function | Overview form submit callback. | |
EntityDefaultUIController:: |
public | function | Overview form validation callback. | |
EntityDefaultUIController:: |
public | function | Generates the render array for a overview table for arbitrary entities matching the given conditions. | |
EntityDefaultUIController:: |
public | function |