class RulesTestTypeWrapper

The custom wrapper class for the rules test type.

For testing we internally just make use of nodes.

Hierarchy

Expanded class hierarchy of RulesTestTypeWrapper

1 string reference to 'RulesTestTypeWrapper'
rules_test_rules_data_info in tests/rules_test.rules.inc
Implements hook_rules_data_info().

File

tests/rules_test.rules.inc, line 302

View source
class RulesTestTypeWrapper extends RulesIdentifiableDataWrapper implements RulesDataWrapperSavableInterface {
    
    /**
     * Overrides RulesIdentifiableDataWrapper::extractIdentifier().
     */
    protected function extractIdentifier($data) {
        return $data->nid;
    }
    
    /**
     * Overrides RulesIdentifiableDataWrapper::load().
     */
    protected function load($id) {
        return node_load($id);
    }
    
    /**
     * Implements RulesDataWrapperSavableInterface::save().
     */
    public function save() {
        node_save($this->value());
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
RulesIdentifiableDataWrapper::$id protected property Contains the id.
RulesIdentifiableDataWrapper::clear public function Overridden.
RulesIdentifiableDataWrapper::getIdentifier public function Returns the identifier of the wrapped data.
RulesIdentifiableDataWrapper::set public function Overridden to support setting the data by either the object or the id.
RulesIdentifiableDataWrapper::setData protected function Sets the data internally accepting both the data id and object.
RulesIdentifiableDataWrapper::value public function Overridden.
RulesIdentifiableDataWrapper::__construct public function Construct a new wrapper object.
RulesIdentifiableDataWrapper::__sleep public function Prepare for serialization.
RulesIdentifiableDataWrapper::__wakeup public function Prepare for unserialization.
RulesTestTypeWrapper::extractIdentifier protected function Overrides RulesIdentifiableDataWrapper::extractIdentifier(). Overrides RulesIdentifiableDataWrapper::extractIdentifier
RulesTestTypeWrapper::load protected function Overrides RulesIdentifiableDataWrapper::load(). Overrides RulesIdentifiableDataWrapper::load
RulesTestTypeWrapper::save public function Implements RulesDataWrapperSavableInterface::save(). Overrides RulesDataWrapperSavableInterface::save