You are here

function Notifications_Subscription::is_editable in Notifications 6.4

Same name and namespace in other branches
  1. 7 notifications.subscription.inc \Notifications_Subscription::is_editable()

Whether this subscription's fields are editable or not

Unless preset the 'editable' property, this is how it works:

  • Once we have an instance we don't allow changing the fields, which may cause some consistency problems
  • Also if the subscription type has no fields, this is not editable
  • When it has fields and they've been all preset, not editable either

File

includes/notifications_subscription.class.inc, line 701
Drupal Notifications Framework - Default class file

Class

Notifications_Subscription
Message destination class

Code

function is_editable() {
  if (!isset($this->editable)) {
    if (!$this
      ->is_instance() && ($type_fields = $this
      ->get_type_fields())) {

      // It is editable if not all fields are set
      $this->editable = count($type_fields) > count($this
        ->get_instance_fields());
    }
    else {

      // It is instance or the type has no fields
      $this->editable = FALSE;
    }
  }
  return $this->editable;
}