/** * Implements \Drupal\Core\Form\FormInterface::submitForm(). */ public function submitForm(array &$form, array &$form_state) { $this->condition->submitConfigurationForm($form, $form_state); $config = $this->condition->getConfig(); $bundles = implode(' and ', $config['bundles']); drupal_set_message(t('The bundles are @bundles', array('@bundles' => $bundles))); $article = node_load(1); $this->condition->setContextValue('node', $article); if ($this->condition->execute()) { drupal_set_message(t('Executed successfully.')); } }
/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->condition->submitConfigurationForm($form, $form_state); $config = $this->condition->getConfig(); foreach ($config['bundles'] as $bundle) { drupal_set_message('Bundle: ' . $bundle); } $article = Node::load(1); $this->condition->setContextValue('node', $article); if ($this->condition->execute()) { drupal_set_message(t('Executed successfully.')); } }