예제 #1
0
 /**
  * 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.'));
     }
 }
예제 #2
0
 /**
  * {@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.'));
     }
 }