-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathModule7.php
More file actions
55 lines (44 loc) · 1.47 KB
/
Module7.php
File metadata and controls
55 lines (44 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace DrupalCodeBuilder\Generator;
/**
* Drupal 7 version of component.
*/
class Module7 extends Module {
/**
* {@inheritdoc}
*/
public static function componentDataDefinition() {
$component_data_definition = parent::componentDataDefinition();
unset($component_data_definition['plugins']);
unset($component_data_definition['plugins_yaml']);
unset($component_data_definition['plugin_types']);
unset($component_data_definition['services']);
unset($component_data_definition['phpunit_tests']);
unset($component_data_definition['tests']['description']);
unset($component_data_definition['config_entity_types']);
// TODO: implement these for D7.
unset($component_data_definition['content_entity_types']);
unset($component_data_definition['theme_hooks']);
unset($component_data_definition['forms']);
$component_data_definition['router_items'] = [
'label' => "Menu paths",
'description' => "Paths for hook_menu(), eg 'path/foo'",
'required' => FALSE,
'format' => 'array',
'component_type' => 'RouterItem',
];
return $component_data_definition;
}
/**
* {@inheritdoc}
*/
public function requiredComponents() {
$components = parent::requiredComponents();
// On D7 and lower, modules need a .module file, even if empty.
$components['%module.module'] = [
'component_type' => 'ModuleCodeFile',
'filename' => '%module.module',
];
return $components;
}
}