ConfigInstallDependencyTestHooks.php

Namespace

Drupal\config_install_dependency_test\Hook

File

core/modules/config/tests/config_install_dependency_test/src/Hook/ConfigInstallDependencyTestHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\config_install_dependency_test\Hook;

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for config_install_dependency_test.
 */
class ConfigInstallDependencyTestHooks {
    
    /**
     * Implements hook_ENTITY_TYPE_create().
     */
    public function configTestCreate(EntityInterface $entity) {
        // Add an enforced dependency on this module so that we can test if this is
        // possible during module installation.
        $entity->setEnforcedDependencies([
            'module' => [
                'config_install_dependency_test',
            ],
        ]);
    }

}

Classes

Title Deprecated Summary
ConfigInstallDependencyTestHooks Hook implementations for config_install_dependency_test.

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