function views_handler_relationship::option_definition

Same name in other branches
  1. 7.x-3.x handlers/views_handler_relationship.inc \views_handler_relationship::option_definition()

Overrides views_handler::option_definition

2 calls to views_handler_relationship::option_definition()
views_handler_relationship_node_term_data::option_definition in modules/taxonomy/views_handler_relationship_node_term_data.inc
Information about options for all kinds of purposes will be held here.
views_handler_relationship_translation::option_definition in modules/translation/views_handler_relationship_translation.inc
Information about options for all kinds of purposes will be held here.
2 methods override views_handler_relationship::option_definition()
views_handler_relationship_node_term_data::option_definition in modules/taxonomy/views_handler_relationship_node_term_data.inc
Information about options for all kinds of purposes will be held here.
views_handler_relationship_translation::option_definition in modules/translation/views_handler_relationship_translation.inc
Information about options for all kinds of purposes will be held here.

File

handlers/views_handler_relationship.inc, line 62

Class

views_handler_relationship
Simple relationship handler that allows a new version of the primary table to be linked in.

Code

function option_definition() {
    $options = parent::option_definition();
    // Relationships definitions should define a default label, but if they aren't get another default value.
    if (!empty($this->definition['label'])) {
        $label = $this->definition['label'];
    }
    else {
        $label = !empty($this->definition['field']) ? $this->definition['field'] : $this->definition['base field'];
    }
    $options['label'] = array(
        'default' => $label,
        'translatable' => TRUE,
    );
    $options['required'] = array(
        'default' => FALSE,
    );
    return $options;
}