abstract class Notifications_Entity in Notifications 7
Base class for all Notifications entities
Hierarchy
- class \Notifications_Entity
Expanded class hierarchy of Notifications_Entity
File
- ./
notifications.object.inc, line 10 - Drupal Notifications Framework - Default class file
View source
abstract class Notifications_Entity {
protected $type;
/**
* Constructor
*/
public function __construct($template = NULL) {
if ($template) {
$properties = (array) $template;
foreach ($properties as $key => $value) {
$this->{$key} = $value;
}
}
}
/**
* Get object title
*/
public abstract function get_title();
/**
* Get object name
*/
public abstract function get_name();
/**
* Build from db object or template
*/
public static function build_object($object) {
return new Notifications_Entity($object);
}
/**
* User access function
*/
public abstract function user_access($account, $op = 'view');
/**
* Get information from notifications hooks
*/
public static function type_info($type = NULL, $property = NULL, $default = NULL) {
// Creating static abstract functions produces warnings.
}
/**
* Get information for specific instance.
*
* This is useful for properties that can be overridden with alter hooks
*/
public function get_info($property = NULL, $default = NULL) {
return $this
->type_info($this->type, $property, $default);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Notifications_Entity:: |
protected | property | 2 | |
Notifications_Entity:: |
public static | function | Build from db object or template | 2 |
Notifications_Entity:: |
public | function | Get information for specific instance. | |
Notifications_Entity:: |
abstract public | function | Get object name | 2 |
Notifications_Entity:: |
abstract public | function | Get object title | 2 |
Notifications_Entity:: |
public static | function | Get information from notifications hooks | 2 |
Notifications_Entity:: |
abstract public | function | User access function | 2 |
Notifications_Entity:: |
public | function | Constructor | 1 |