public function UnpublishingIsEnabled::evaluate in Scheduler 8
Determines whether scheduled unpublishing is enabled for this node type.
Return value
bool TRUE if scheduled unpublishing is enabled for the content type of this node.
Overrides RulesConditionBase::evaluate
File
- scheduler_rules_integration/
src/ Plugin/ Condition/ UnpublishingIsEnabled.php, line 31
Class
- UnpublishingIsEnabled
- Provides 'Unpublishing is enabled' condition.
Namespace
Drupal\scheduler_rules_integration\Plugin\ConditionCode
public function evaluate() {
$node = $this
->getContextValue('node');
$config = \Drupal::config('scheduler.settings');
return $node->type->entity
->getThirdPartySetting('scheduler', 'unpublish_enable', $config
->get('default_unpublish_enable'));
}