You are here

class draggableviews_hierarchy_handler in DraggableViews 7.2

Parent class for all hierarchy handlers.

Hierarchy

Expanded class hierarchy of draggableviews_hierarchy_handler

1 string reference to 'draggableviews_hierarchy_handler'
draggableviews_get_hierarchy_handlers in ./draggableviews.module
Retrieve all hierarchy plugins.

File

handlers/draggableviews_hierarchy_handler.inc, line 11
Base plugin implementation.

View source
class draggableviews_hierarchy_handler {

  /**
   * Get the parent value.
   *
   * @param object $field
   *   Draggableviews field handler. View is $field->view,
   *   to get a row $field->view->result[$index].
   * @param int $index
   *   Index of the row.
   *
   * @return int
   *   Weight value.
   */
  public function get($field, $index) {
  }

  /**
   * Save parent value.
   *
   * @param $form_state
   *   Array of form state of the form.
   *   View object $form_state['values']['view'].
   */
  public function set($form_state) {
  }

  /**
   * Form with settings of the handler.
   *
   * @param object $field
   *  Draggableviews field handler.
   *
   * @return array
   *  Form array.
   */
  public function options_form($field) {
  }

  /**
   * Settings form default values.
   *
   * @return array
   *   Array with default values.
   */
  public function option_definition() {
  }

  /**
   * Get "results" array index of and item with specific base field id.
   *
   * @param object $view
   *   Views object
   * @param type $id
   *   Base field id.
   *
   * @return int
   */
  public function get_index($view, $id) {
    foreach ($view->result as $key => $item) {
      if ($item->{$view->base_field} == $id) {
        return $key;
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
draggableviews_hierarchy_handler::get public function Get the parent value. 2
draggableviews_hierarchy_handler::get_index public function Get "results" array index of and item with specific base field id.
draggableviews_hierarchy_handler::options_form public function Form with settings of the handler.
draggableviews_hierarchy_handler::option_definition public function Settings form default values.
draggableviews_hierarchy_handler::set public function Save parent value. 2