function NodeTestHooks::nodeBuildDefaultsAlter

Implements hook_ENTITY_TYPE_build_defaults_alter() for node entities.

File

core/modules/node/tests/modules/node_test/src/Hook/NodeTestHooks.php, line 56

Class

NodeTestHooks
Hook implementations for node_test.

Namespace

Drupal\node_test\Hook

Code

public function nodeBuildDefaultsAlter(array &$build, NodeInterface &$node, $view_mode = 'full') : void {
    if ($view_mode == 'rss') {
        $node->rss_namespaces['xmlns:test'] = 'http://example.com/test-namespace';
    }
}

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