abstract class PurgePurgerBundle in Purge 7.2
Class definition for basic bundles.
Bundles are objects containing purposed set of properties and methods, depending on its subclass.
This is a basic parent class.
Hierarchy
- class \Purge
- class \PurgePurger
- class \PurgePurgerBundle
- class \PurgePurger
Expanded class hierarchy of PurgePurgerBundle
File
- includes/
purge.class.inc, line 754 - Contains all class and interface definitions for Purge.
View source
abstract class PurgePurgerBundle extends PurgePurger {
public $type = array();
/**
* Override for parents sleep to make sure we include the bundled objects.
*/
public function __sleep() {
// First let call the parent function.
$return_properties = parent::__sleep();
// Add each type to the item array.
foreach ($this->item as $type_name => $items) {
if (!isset($return_properties[$type_name])) {
$return_properties[] = $type_name;
}
}
return $return_properties;
}
/**
* Set the item objects linked in this bundle when waking up.
*/
public function __wakeup() {
// Each item in the item array.
foreach ($this->item as $type_name => $items) {
foreach ($this->{$type_name} as $bundle_item_name => $bundle_item) {
// Check if the item contains items.
if (isset($this->{$type_name}[$bundle_item_name]->item)) {
foreach ($this->{$type_name}[$bundle_item_name]->item as $item_type => $item_names) {
foreach ($item_names as $item_name) {
// Set the item to the bundle item.
// dprint_r($this->{$type_name}[$bundle_item_name]->{$item_type});
// if$this->{$type_name}[$bundle_item_name]->{$item_type} = array();
$this->{$type_name}[$bundle_item_name]->{$item_type}[$item_name] = $this->{$item_type}[$item_name];
}
}
}
}
}
}
/**
* Function to select data from the dataset.
*
* @return array $data
*/
public function get_data() {
// Get the data from the given dataset.
$data = array();
$data = variable_get('purge_config', NULL);
return $data;
}
/**
* Function to set the type objects.
*/
public function set_types($data) {
// Get the datastructure of the types up.
foreach ($data['type'] as $type_name => $type_data) {
// And create an object for each type
$this->type[$type_name] = unserialize($type_data);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | property | ||
Purge:: |
public | function | Does basic dependency checks for builtin dependencies. | 5 |
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurger:: |
public | property | ||
PurgePurgerBundle:: |
public | property | ||
PurgePurgerBundle:: |
public | function | Function to select data from the dataset. | |
PurgePurgerBundle:: |
public | function | Function to set the type objects. | |
PurgePurgerBundle:: |
public | function |
Override for parents sleep to make sure we include the bundled objects. Overrides Purge:: |
|
PurgePurgerBundle:: |
public | function | Set the item objects linked in this bundle when waking up. |