protected function RulesOrganigramsWrapper::setEntity in Organigrams 7
Overridden to support identifying organigrams by machine names.
Parameters
string $data: Contains a machine name.
Overrides EntityDrupalWrapper::setEntity
File
- ./
organigrams.rules.inc, line 191 - Rules integration for the organigrams module.
Class
- RulesOrganigramsWrapper
- Custom wrapper class for organigrams for loading organigrams by machine name.
Code
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);
}
}