function views_handler_relationship::option_definition

Overrides views_handler::option_definition

3 calls to views_handler_relationship::option_definition()
views_handler_relationship_groupwise_max::option_definition in handlers/views_handler_relationship_groupwise_max.inc
Defines default values for options.
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.
3 methods override views_handler_relationship::option_definition()
views_handler_relationship_groupwise_max::option_definition in handlers/views_handler_relationship_groupwise_max.inc
Defines default values for options.
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 67

Class

views_handler_relationship
Relationship handler, allows a new version of the primary table to be linked.

Code

public 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,
        'bool' => TRUE,
    );
    return $options;
}