You are here

class Notifications_Node_Field in Notifications 7

Node fields

Hierarchy

Expanded class hierarchy of Notifications_Node_Field

1 string reference to 'Notifications_Node_Field'
notifications_notifications in ./notifications.module
Implementation of hook_notifications()

File

./notifications.field.inc, line 484
Drupal Notifications Framework - Default class file

View source
class Notifications_Node_Field extends Notifications_Field_Autocomplete {
  public $type = 'node:nid';
  public $field = 'nid';
  public $object_type = 'node';

  /**
   * Get field name
   */
  function get_title() {
    return t('Node');
  }

  /**
   * Get description
   */
  function get_description() {
    return t('Node');
  }

  /**
   * Get system path
   */
  function get_path() {
    return isset($this->value) ? 'node/' . $this->value : '';
  }

  /**
   * Get autocomplete path
   */
  function autocomplete_path() {
    return 'notifications/autocomplete/node/title';
  }

  /**
   * Parse value from autocomplete
   */
  function autocomplete_parse($string, $field = NULL) {
    module_load_include('inc', 'notifications', 'includes/node');
    return notifications_node_title2nid($string, $field);
  }

  /**
   * Format value for autocomplete
   */
  function autocomplete_value() {
    $node = $this
      ->drupal_object();
    return $node ? check_plain($node->title) . ' [nid:' . $node->nid . ']' : '';
  }

  /**
   * Get query condition for nodes
   */
  function get_object_condition($object) {
    if ($object->type == 'node' && isset($object->value)) {
      return $this
        ->get_value_condition($object->value);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Notifications_Field::$data_type protected property 1
Notifications_Field::$name public property
Notifications_Field::$object protected property
Notifications_Field::$position public property
Notifications_Field::$sid public property
Notifications_Field::$subscription protected property
Notifications_Field::$value public property
Notifications_Field::build public static function Quick build
Notifications_Field::build_from_value public static function Build a field object from submitted values
Notifications_Field::build_object public static function Build from db object
Notifications_Field::build_type public static function Build field instance
Notifications_Field::check_value function Check if the field has a valid value or the parameter is a valid value
Notifications_Field::drupal_object function Get related Drupal object
Notifications_Field::element_info function Build a form element to display this field
Notifications_Field::format function Format title and value
Notifications_Field::format_value function Format value
Notifications_Field::get_link function Get link if this field is linked to an object
Notifications_Field::get_name function Get field value name 1
Notifications_Field::get_object function Get related Notifications object 1
Notifications_Field::get_property protected function Get field type property
Notifications_Field::get_query_condition function Get query condition for current value
Notifications_Field::get_value function Get field value
Notifications_Field::get_value_condition function Get query condition for a given value
Notifications_Field::index function Get unique index for this field
Notifications_Field::load_multiple public static function Load multiple fields
Notifications_Field::object_value function Get value/s from object 3
Notifications_Field::save function Save to db
Notifications_Field::set_subscription function Set subscription
Notifications_Field::set_value function Set value for this field, update related properties
Notifications_Field::type_info public static function Get field type information
Notifications_Field::user_access function Check user access
Notifications_Field::validate_value static function Check if the value is valid for this field has a valid value
Notifications_Field::valid_value function Check if this is a valid value for this field 1
Notifications_Field::__construct public function Constructor
Notifications_Field::__sleep public function PHP Magic. Regurn object properties to be serialized
Notifications_Field_Autocomplete::element_edit function Build a form element to edit this field Overrides Notifications_Field::element_edit
Notifications_Field_Autocomplete::parse_value function Parsing values may be different for these ones Overrides Notifications_Field::parse_value
Notifications_Node_Field::$field public property
Notifications_Node_Field::$object_type public property Overrides Notifications_Field::$object_type
Notifications_Node_Field::$type public property Overrides Notifications_Field::$type
Notifications_Node_Field::autocomplete_parse function Parse value from autocomplete Overrides Notifications_Field_Autocomplete::autocomplete_parse
Notifications_Node_Field::autocomplete_path function Get autocomplete path Overrides Notifications_Field_Autocomplete::autocomplete_path
Notifications_Node_Field::autocomplete_value function Format value for autocomplete Overrides Notifications_Field_Autocomplete::autocomplete_value
Notifications_Node_Field::get_description function Get description Overrides Notifications_Field::get_description
Notifications_Node_Field::get_object_condition function Get query condition for nodes
Notifications_Node_Field::get_path function Get system path Overrides Notifications_Field::get_path
Notifications_Node_Field::get_title function Get field name Overrides Notifications_Field::get_title