Callbacks.php

Same filename in this branch
  1. 11.x core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php
  2. 11.x core/modules/system/tests/modules/form_test/src/Callbacks.php
Same filename in other branches
  1. 9 core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php
  2. 9 core/modules/system/tests/modules/form_test/src/Callbacks.php
  3. 8.9.x core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php
  4. 8.9.x core/modules/system/tests/modules/form_test/src/Callbacks.php
  5. 10 core/modules/system/tests/modules/ajax_forms_test/src/Callbacks.php
  6. 10 core/modules/system/tests/modules/form_test/src/Callbacks.php

Namespace

Drupal\entity_test

File

core/modules/system/tests/modules/entity_test/src/Callbacks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\entity_test;

use Drupal\Core\Form\FormStateInterface;

/**
 * Simple object with callbacks.
 */
class Callbacks {
    
    /**
     * Validation handler for the entity_test entity form.
     */
    public static function entityTestFormValidate(array &$form, FormStateInterface $form_state) : void {
        $form['#entity_test_form_validate'] = TRUE;
    }
    
    /**
     * Validation handler for the entity_test entity form.
     */
    public static function entityTestFormValidateCheck(array &$form, FormStateInterface $form_state) : void {
        if (!empty($form['#entity_test_form_validate'])) {
            \Drupal::state()->set('entity_test.form.validate.result', TRUE);
        }
    }

}

Classes

Title Deprecated Summary
Callbacks Simple object with callbacks.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.