1 | <?php |
||
19 | final class Descriptor |
||
20 | { |
||
21 | /** |
||
22 | * Defines the category for the module. |
||
23 | * |
||
24 | * When modules are listed they are usually grouped by category. The category is also often |
||
25 | * used to create the main navigation menu of the admin interface. |
||
26 | * |
||
27 | * The category of the module is translated within the `module_category` scope. |
||
28 | */ |
||
29 | const CATEGORY = 'category'; |
||
30 | |||
31 | /** |
||
32 | * Defines the PHP class of the module. |
||
33 | * |
||
34 | * If the class is not defined it is resolved during indexing using the {@link NS} |
||
35 | * tag and the following pattern : `<namespace>\Module`. |
||
36 | */ |
||
37 | const CLASSNAME = 'class'; |
||
38 | |||
39 | /** |
||
40 | * Defines a short description of what the module do. |
||
41 | */ |
||
42 | const DESCRIPTION = 'description'; |
||
43 | |||
44 | /** |
||
45 | * Defines the state of the module. |
||
46 | */ |
||
47 | const DISABLED = 'disabled'; |
||
48 | |||
49 | /** |
||
50 | * Defines extra values. |
||
51 | */ |
||
52 | const EXTRA = 'extra'; |
||
53 | |||
54 | /** |
||
55 | * Defines the parent module the module inherits from. |
||
56 | */ |
||
57 | const INHERITS = 'inherits'; |
||
58 | |||
59 | /** |
||
60 | * Defines the identifier of the module. |
||
61 | * |
||
62 | * If the identifier is not defined the name of the module directory is used instead. |
||
63 | */ |
||
64 | const ID = 'id'; |
||
65 | |||
66 | /** |
||
67 | * Defines the state of the module. |
||
68 | * |
||
69 | * Required modules are always enabled. |
||
70 | */ |
||
71 | const REQUIRED = 'required'; |
||
72 | |||
73 | /** |
||
74 | * Defines the modules that the module requires. |
||
75 | * |
||
76 | * The required modules are defined using an array of identifiers. |
||
77 | */ |
||
78 | const REQUIRES = 'requires'; |
||
79 | |||
80 | /** |
||
81 | * Defines the models of the module. |
||
82 | */ |
||
83 | const MODELS = 'models'; |
||
84 | |||
85 | /** |
||
86 | * Defines the namespace of the module. |
||
87 | * |
||
88 | * This attribute must be defined at construct time. |
||
89 | */ |
||
90 | const NS = 'namespace'; |
||
91 | |||
92 | /** |
||
93 | * Path to the module's directory. |
||
94 | * |
||
95 | * This tag is resolved when the module is indexed. |
||
96 | */ |
||
97 | const PATH = 'path'; |
||
98 | |||
99 | /** |
||
100 | * General permission of the module. |
||
101 | */ |
||
102 | const PERMISSION = 'permission'; |
||
103 | |||
104 | /** |
||
105 | * Defines the permissions added by the module. |
||
106 | */ |
||
107 | const PERMISSIONS = 'permissions'; |
||
108 | |||
109 | /** |
||
110 | * Defines the title of the module. |
||
111 | * |
||
112 | * The title of the module is translated within the `module_title` scope. |
||
113 | */ |
||
114 | const TITLE = 'title'; |
||
115 | |||
116 | /** |
||
117 | * Defines the weight of the module. |
||
118 | * |
||
119 | * The weight of the module is resolved during modules indexing according to the |
||
120 | * {@link EXTENDS} and {@link REQUIRES} tags. |
||
121 | */ |
||
122 | const WEIGHT = 'weight'; |
||
123 | |||
124 | /** |
||
125 | * Normalizes a descriptor array. |
||
126 | * |
||
127 | * @param array $descriptor |
||
128 | * |
||
129 | * @return array |
||
130 | */ |
||
131 | static public function normalize(array $descriptor) |
||
152 | |||
153 | private function __construct() {} |
||
154 | } |
||
155 |