You are here

public static function Notifications_Field::build_type in Notifications 7

Build field instance

4 calls to Notifications_Field::build_type()
Notifications_Field::build in ./notifications.field.inc
Quick build
Notifications_Field::build_from_value in ./notifications.field.inc
Build a field object from submitted values
Notifications_Field::build_object in ./notifications.field.inc
Build from db object
Notifications_Subscription::type_fields in ./notifications.subscription.inc
Get subscription type fields as array of field objects

File

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

Class

Notifications_Field
Base class for Notifications fields

Code

public static function build_type($type, $template = NULL) {
  if ($class = notifications_field_type($type, 'class')) {
    return new $class($template);
  }
  else {

    // Unknown field type, let's build something
    $field = new Notifications_Field_Default($template);
    $field->type = $type;
    return $field;
  }
}