public function StateFlow::set_node_revision in State Machine 7.2
Same name and namespace in other branches
- 6 modules/state_flow/plugins/state_flow.inc \StateFlow::set_node_revision()
- 7 modules/state_flow/plugins/state_flow.inc \StateFlow::set_node_revision()
1 call to StateFlow::set_node_revision()
- StateFlow::on_enter_published in modules/
state_flow/ plugins/ state_flow.inc
File
- modules/
state_flow/ plugins/ state_flow.inc, line 317
Class
Code
public function set_node_revision() {
$vid = $this
->get_latest_revision($this->object->nid);
if (!empty($vid) && $vid != $this->object->vid) {
$rev_state_rec = $this
->revision_state_record($this->object->nid, $this->object->vid);
state_flow_promote_node_revision($rev_state_rec, $this->object->nid, $this->object->vid);
}
$result = db_update('node_revision')
->fields(array(
'status' => 1,
))
->condition('vid', $vid)
->execute();
}