@@ -25,14 +25,14 @@ protected function configure()
25
25
$ this ->addOption ('properties ' , null , InputOption::VALUE_NONE , 'List only the properties of this node ' );
26
26
$ this ->addOption ('filter ' , 'f ' , InputOption::VALUE_REQUIRED |InputOption::VALUE_IS_ARRAY , 'Optional filter to apply ' );
27
27
$ this ->addOption ('level ' , 'L ' , InputOption::VALUE_REQUIRED , 'Depth of tree to show ' );
28
- $ this ->addOption ('no- template ' , 'T ' , InputOption::VALUE_REQUIRED , 'Do not show template nodes and properties ' );
28
+ $ this ->addOption ('template ' , 't ' , InputOption::VALUE_NONE , 'Show template nodes and properties ' );
29
29
$ this ->setHelp (<<<HERE
30
30
List both or one of the children and properties of this node.
31
31
32
32
Multiple levels can be shown by using the <info>--level</info> option.
33
33
34
- The <info>node:list</info> command also shows template nodes and properties as defined a nodes node-type.
35
- These can be suppressed using the <info>--no- template</info> option.
34
+ The <info>node:list</info> command can also shows template nodes and properties as defined a nodes node-type by
35
+ using the <info>--template</info> option. Template nodes and properties are prefixed with the "@" symbol .
36
36
HERE
37
37
);
38
38
}
@@ -46,6 +46,7 @@ public function execute(InputInterface $input, OutputInterface $output)
46
46
47
47
$ this ->showChildren = $ input ->getOption ('children ' );
48
48
$ this ->showProperties = $ input ->getOption ('properties ' );
49
+ $ this ->showTemplate = $ input ->getOption ('template ' );
49
50
50
51
$ session = $ this ->getHelper ('phpcr ' )->getSession ();
51
52
@@ -113,14 +114,16 @@ private function renderChildren($currentNode, $table, $spacers)
113
114
}
114
115
}
115
116
116
- // render empty schematic children
117
- foreach ($ childNodeNames as $ childNodeName => $ childNodeDefinition ) {
118
- // @todo: Determine and show cardinality, 1..*, *..*, 0..1, etc.
119
- $ table ->addRow (array (
120
- '<templatenode> ' . implode ('' , $ spacers ) . '@ ' . $ childNodeName . '</templatenode> ' ,
121
- implode ('| ' , $ childNodeDefinition ->getRequiredPrimaryTypeNames ()),
122
- '' ,
123
- ));
117
+ if ($ this ->showTemplate ) {
118
+ // render empty schematic children
119
+ foreach ($ childNodeNames as $ childNodeName => $ childNodeDefinition ) {
120
+ // @todo: Determine and show cardinality, 1..*, *..*, 0..1, etc.
121
+ $ table ->addRow (array (
122
+ '<templatenode> ' . implode ('' , $ spacers ) . '@ ' . $ childNodeName . '</templatenode> ' ,
123
+ implode ('| ' , $ childNodeDefinition ->getRequiredPrimaryTypeNames ()),
124
+ '' ,
125
+ ));
126
+ }
124
127
}
125
128
}
126
129
@@ -150,12 +153,14 @@ private function renderProperties($currentNode, $table, $spacers)
150
153
));
151
154
}
152
155
153
- foreach ($ propertyNames as $ propertyName => $ property ) {
154
- $ table ->addRow (array (
155
- '<templateproperty> ' . implode ('' , $ spacers ). '@ ' . $ propertyName . '</templateproperty> ' ,
156
- '<property-type> ' . strtoupper (PropertyType::nameFromValue ($ property ->getRequiredType ())) . '</property-type> ' ,
157
- ''
158
- ));
156
+ if ($ this ->showTemplate ) {
157
+ foreach ($ propertyNames as $ propertyName => $ property ) {
158
+ $ table ->addRow (array (
159
+ '<templateproperty> ' . implode ('' , $ spacers ). '@ ' . $ propertyName . '</templateproperty> ' ,
160
+ '<property-type> ' . strtoupper (PropertyType::nameFromValue ($ property ->getRequiredType ())) . '</property-type> ' ,
161
+ ''
162
+ ));
163
+ }
159
164
}
160
165
}
161
166
}
0 commit comments