You are here

public function StateFlowEntity::isActivePublishedRevision in State Machine 7.3

Check if the current object is the active published revision.

A active published revision is it if:

  • The object isn't ignored.
  • The published_revision_id property is empty.
  • The published_revision_id property is equal to the current revision id.

Return value

bool Whether or not the current object is a the active published revision.

1 call to StateFlowEntity::isActivePublishedRevision()
StateFlowEntity::get_available_events_options in modules/state_flow_entity/plugins/state_flow_entity.inc
Get available events as an array suitable for FAPI.

File

modules/state_flow_entity/plugins/state_flow_entity.inc, line 449
State Flow implementation of the State Machine class.

Class

StateFlowEntity
@file State Flow implementation of the State Machine class.

Code

public function isActivePublishedRevision() {
  $entity = $this
    ->get_object();
  if (!$this
    ->ignore()) {
    $this
      ->set_available_publish_revision();
    return empty($entity->published_revision_id) || $this->object->{$this
      ->get_revision_key()} == $entity->published_revision_id;
  }
  return !empty($entity->status);
}