public function StateFlowNode::load in State Machine 7.3
Provide the current state of this revision or entity.
Return value
string Machine name of a state.
Overrides StateFlowEntity::load
File
- modules/
state_flow/ plugins/ state_flow_node.inc, line 66 - State Flow implementation of the State Machine class
Class
- StateFlowNode
- Class StateFlowNode.
Code
public function load() {
$state = parent::load();
// When State Flow is installed on an existing site there may be nodes
// already published. Those nodes should be considered as "published" by
// State Flow.
if (empty($state) && !empty($this->object->status) && !empty($this->object->nid)) {
return 'published';
}
return $state;
}