class RulesTaxonomyVocabularyWrapper in Rules 7.2
A custom wrapper class for vocabularies.
This class is capable of loading vocabularies by machine name.
Hierarchy
- class \EntityMetadataWrapper
- class \EntityStructureWrapper implements \IteratorAggregate
- class \EntityDrupalWrapper
- class \EntityStructureWrapper implements \IteratorAggregate
Expanded class hierarchy of RulesTaxonomyVocabularyWrapper
Related topics
1 string reference to 'RulesTaxonomyVocabularyWrapper'
- rules_rules_core_data_info in modules/
rules_core.rules.inc - Implements hook_rules_data_info() on behalf of the pseudo rules_core module.
File
- modules/
rules_core.eval.inc, line 251 - Contains rules core integration needed during evaluation.
View source
class RulesTaxonomyVocabularyWrapper extends EntityDrupalWrapper {
/**
* Overridden to support identifying vocabularies by machine names.
*/
protected function setEntity($data) {
if (isset($data) && $data !== FALSE && !is_object($data) && !is_numeric($data)) {
// The vocabulary name has been passed.
parent::setEntity(taxonomy_vocabulary_machine_name_load($data));
}
else {
parent::setEntity($data);
}
}
/**
* Overridden to permit machine names as values.
*/
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. | |
RulesTaxonomyVocabularyWrapper:: |
protected | function |
Overridden to support identifying vocabularies by machine names. Overrides EntityDrupalWrapper:: |
|
RulesTaxonomyVocabularyWrapper:: |
public | function |
Overridden to permit machine names as values. Overrides EntityMetadataWrapper:: |