You are here

public function PublishingIsEnabled::evaluate in Scheduler 8

Determines whether scheduled publishing is enabled for this node type.

Return value

bool TRUE if scheduled publishing is enabled for the content type of this node.

Overrides RulesConditionBase::evaluate

File

scheduler_rules_integration/src/Plugin/Condition/PublishingIsEnabled.php, line 31

Class

PublishingIsEnabled
Provides a 'Publishing is enabled' condition.

Namespace

Drupal\scheduler_rules_integration\Plugin\Condition

Code

public function evaluate() {
  $node = $this
    ->getContextValue('node');
  $config = \Drupal::config('scheduler.settings');
  return $node->type->entity
    ->getThirdPartySetting('scheduler', 'publish_enable', $config
    ->get('default_publish_enable'));
}