class RulesOrganigramsWrapper in Organigrams 7
Custom wrapper class for organigrams for loading organigrams by machine name.
Hierarchy
- class \EntityMetadataWrapper
- class \EntityStructureWrapper implements \IteratorAggregate
- class \EntityDrupalWrapper
- class \RulesOrganigramsWrapper
- class \EntityDrupalWrapper
- class \EntityStructureWrapper implements \IteratorAggregate
Expanded class hierarchy of RulesOrganigramsWrapper
1 string reference to 'RulesOrganigramsWrapper'
- organigrams_rules_data_info_alter in ./
organigrams.rules.inc - Implements hook_rules_data_info_alter().
File
- ./
organigrams.rules.inc, line 183 - Rules integration for the organigrams module.
View source
class RulesOrganigramsWrapper extends EntityDrupalWrapper {
/**
* Overridden to support identifying organigrams by machine names.
*
* @param string $data
* Contains a machine name.
*/
protected function setEntity($data) {
if (isset($data) && $data !== FALSE && !is_object($data) && !is_numeric($data)) {
// The organigrams name has been passed.
parent::setEntity(organigrams_machine_name_load($data));
}
else {
parent::setEntity($data);
}
}
/**
* Overridden to permit machine names as values.
*
* @param string $value
* String to validate.
*
* @return bool
* TRUE is $value is a string, otherwise FALSE.
*/
public function validate($value) {
if (isset($value) && is_string($value)) {
return TRUE;
}
return parent::validate($value);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDrupalWrapper:: |
protected | property | ||
EntityDrupalWrapper:: |
protected | property | ||
EntityDrupalWrapper:: |
protected | property | Contains the entity id. | |
EntityDrupalWrapper:: |
public | function |
Note that this method checks property access, but can be used for checking
entity access *only* if the wrapper is not a property (i.e. has no parent
wrapper).
To be safe, better use EntityDrupalWrapper::entityAccess() for checking
entity access. Overrides EntityMetadataWrapper:: |
|
EntityDrupalWrapper:: |
public | function |
Overridden. Overrides EntityStructureWrapper:: |
|
EntityDrupalWrapper:: |
public | function |
Returns a string to use to identify this wrapper in error messages. Overrides EntityMetadataWrapper:: |
|
EntityDrupalWrapper:: |
public | function | Permanently delete the wrapped entity. | |
EntityDrupalWrapper:: |
public | function | Checks whether the operation $op is allowed on the entity. | |
EntityDrupalWrapper:: |
public | function | Gets the info about the wrapped entity. | |
EntityDrupalWrapper:: |
public | function | Returns the name of the key used by the entity for given entity key. | |
EntityDrupalWrapper:: |
public | function | Returns the bundle of an entity, or FALSE if it has no bundles. | |
EntityDrupalWrapper:: |
public | function |
Returns the identifier of the wrapped entity. Overrides EntityStructureWrapper:: |
|
EntityDrupalWrapper:: |
public | function |
Returns the entity label. Overrides EntityMetadataWrapper:: |
|
EntityDrupalWrapper:: |
public | function | Permanently save the wrapped entity. | |
EntityDrupalWrapper:: |
public | function |
Overridden to support setting the entity by either the object or the id. Overrides EntityMetadataWrapper:: |
|
EntityDrupalWrapper:: |
protected | function | ||
EntityDrupalWrapper:: |
protected | function | Tries to determine the bundle and adds in the according property info. | |
EntityDrupalWrapper:: |
protected | function |
Used to lazy-load bundle info. So the wrapper can be loaded e.g. just
for setting without the data being loaded. Overrides EntityStructureWrapper:: |
|
EntityDrupalWrapper:: |
public | function |
Overridden. Overrides EntityMetadataWrapper:: |
|
EntityDrupalWrapper:: |
public | function |
Overridden. Overrides EntityMetadataWrapper:: |
|
EntityDrupalWrapper:: |
public | function | Returns the entity prepared for rendering. | |
EntityDrupalWrapper:: |
public | function |
Construct a new EntityDrupalWrapper object. Overrides EntityStructureWrapper:: |
|
EntityDrupalWrapper:: |
public | function |
Prepare for serializiation. Overrides EntityStructureWrapper:: |
|
EntityDrupalWrapper:: |
public | function | ||
EntityMetadataWrapper:: |
protected | property | ||
EntityMetadataWrapper:: |
protected | property | ||
EntityMetadataWrapper:: |
protected | property | ||
EntityMetadataWrapper:: |
protected | property | 1 | |
EntityMetadataWrapper:: |
protected | function | Returns whether data is available to work with. | |
EntityMetadataWrapper:: |
public | function | Gets info about the wrapped data. | |
EntityMetadataWrapper:: |
public | function | Returns the options list specifying possible values for the property, if defined. | |
EntityMetadataWrapper:: |
public | function | Returns the raw, unprocessed data. Most times this is the same as returned by value(), however for already processed and sanitized textual data, this will return the unprocessed data in contrast to value(). | |
EntityMetadataWrapper:: |
protected | function | Updates the parent data structure of a data property with the latest data value. | |
EntityMetadataWrapper:: |
public | function | ||
EntityStructureWrapper:: |
protected | property | ||
EntityStructureWrapper:: |
protected | property | ||
EntityStructureWrapper:: |
protected | property | ||
EntityStructureWrapper:: |
public | function | Get the wrapper for a property. | |
EntityStructureWrapper:: |
public | function | ||
EntityStructureWrapper:: |
public | function | Gets the info about the given property. | |
EntityStructureWrapper:: |
public | function | Gets the language used for retrieving properties. | |
EntityStructureWrapper:: |
protected | function | Gets the raw value of a property. | |
EntityStructureWrapper:: |
protected | function | Gets the value of a property. | |
EntityStructureWrapper:: |
public | function | Sets a new language to use for retrieving properties. | |
EntityStructureWrapper:: |
protected | function | ||
EntityStructureWrapper:: |
public | function | Returns a reference on the property info. | |
EntityStructureWrapper:: |
protected | function | Sets a property. | |
EntityStructureWrapper:: |
public | function | Magic method: Get a wrapper for a property. | |
EntityStructureWrapper:: |
public | function | Magic method: Can be used to check if a property is known. | |
EntityStructureWrapper:: |
public | function | Magic method: Set a property. | |
RulesOrganigramsWrapper:: |
protected | function |
Overridden to support identifying organigrams by machine names. Overrides EntityDrupalWrapper:: |
|
RulesOrganigramsWrapper:: |
public | function |
Overridden to permit machine names as values. Overrides EntityMetadataWrapper:: |