class RulesFormsStructureWrapper in Rules Forms Support 7.2
Base metadata wrapper for Rules Forms data structures.
Hierarchy
- class \EntityMetadataWrapper
- class \EntityStructureWrapper implements \IteratorAggregate
- class \RulesFormsStructureWrapper
- class \EntityStructureWrapper implements \IteratorAggregate
Expanded class hierarchy of RulesFormsStructureWrapper
File
- includes/
rules_forms.wrapper.inc, line 11 - Manages and Process Form structure.
View source
class RulesFormsStructureWrapper extends EntityStructureWrapper {
/**
* Overrides EntityStructureWrapper::get() to ensure data is properly wrapped.
*/
public function get($name) {
// Look it up in the cache if possible.
if (!array_key_exists($name, $this->cache)) {
// Try to get the property info without the hash. If this fails,
// add the hash mark to the $name. This allows us to support chaining
// with element attribute #names which are otherwise invalid PHP code.
try {
$info = $this
->getPropertyInfo($name);
} catch (EntityMetadataWrapperException $e) {
$name = '#' . $name;
}
if (!empty($info) || ($info = $this
->getPropertyInfo($name))) {
$info += array(
'parent' => $this,
'name' => $name,
'langcode' => $this->langcode,
'property defaults' => array(),
);
$info['property defaults'] += $this->info['property defaults'];
// Check if this is a form element attribute and wrap it if necessary.
if (!empty($info['attribute info'])) {
$this->cache[$name] = new RulesFormsAttributeWrapper($info['type'], NULL, $info);
}
else {
$this->cache[$name] = rules_wrap_data(NULL, $info, TRUE);
}
}
else {
throw new EntityMetadataWrapperException('There is no property ' . check_plain($name) . " for this entity.");
}
}
return $this->cache[$name];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityMetadataWrapper:: |
protected | property | ||
EntityMetadataWrapper:: |
protected | property | ||
EntityMetadataWrapper:: |
protected | property | ||
EntityMetadataWrapper:: |
protected | property | 1 | |
EntityMetadataWrapper:: |
public | function | Determines whether the given user has access to view or edit this property. Apart from relying on access metadata of properties, this takes into account information about entity level access, if available: | 1 |
EntityMetadataWrapper:: |
protected | function | Returns whether data is available to work with. | |
EntityMetadataWrapper:: |
public | function | Returns a string to use to identify this wrapper in error messages. | 1 |
EntityMetadataWrapper:: |
public | function | Gets info about the wrapped data. | |
EntityMetadataWrapper:: |
public | function | Returns the label for the currently set property value if there is one available, i.e. if an options list has been specified. | 2 |
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:: |
public | function | Set a new data value. | 2 |
EntityMetadataWrapper:: |
public | function | Gets the (entity)type of the wrapped data. | 1 |
EntityMetadataWrapper:: |
protected | function | Updates the parent data structure of a data property with the latest data value. | |
EntityMetadataWrapper:: |
public | function | Returns whether $value is a valid value to set. | 1 |
EntityMetadataWrapper:: |
public | function | Returns the wrapped data. If no options are given the data is returned as described in the info. | 3 |
EntityMetadataWrapper:: |
public | function | ||
EntityStructureWrapper:: |
protected | property | ||
EntityStructureWrapper:: |
protected | property | ||
EntityStructureWrapper:: |
protected | property | ||
EntityStructureWrapper:: |
public | function |
Clears the data value and the wrapper cache. Overrides EntityMetadataWrapper:: |
1 |
EntityStructureWrapper:: |
public | function | Returns the identifier of the data structure. If there is none, NULL is returned. | 1 |
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:: |
protected | function | May be used to lazy-load additional info about the data, depending on the concrete passed data. | 1 |
EntityStructureWrapper:: |
public | function |
Construct a new EntityStructureWrapper object. Overrides EntityMetadataWrapper:: |
1 |
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. | |
EntityStructureWrapper:: |
public | function |
Prepare for serializiation. Overrides EntityMetadataWrapper:: |
1 |
RulesFormsStructureWrapper:: |
public | function |
Overrides EntityStructureWrapper::get() to ensure data is properly wrapped. Overrides EntityStructureWrapper:: |