File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,12 +47,12 @@ public function domainContentField(ContentType $contentType)
4747
4848 public function domainGroupName (ContentTypeGroup $ contentTypeGroup )
4949 {
50- return 'DomainGroup ' . ucfirst ($ this ->toCamelCase ($ contentTypeGroup -> identifier ));
50+ return 'DomainGroup ' . ucfirst ($ this ->toCamelCase ($ this -> sanitizeContentTypeGroupIdentifier ( $ contentTypeGroup ) ));
5151 }
5252
5353 public function domainGroupField (ContentTypeGroup $ contentTypeGroup )
5454 {
55- return lcfirst ($ this ->toCamelCase ($ contentTypeGroup -> identifier ));
55+ return lcfirst ($ this ->toCamelCase ($ this -> sanitizeContentTypeGroupIdentifier ( $ contentTypeGroup ) ));
5656 }
5757
5858 public function fieldDefinitionField (FieldDefinition $ fieldDefinition )
@@ -109,4 +109,16 @@ private function pluralize($name)
109109
110110 return $ name . 's ' ;
111111 }
112+
113+ /**
114+ * Removes potential spaces in content types groups names.
115+ * (content types groups identifiers are actually their name)
116+ *
117+ * @param ContentTypeGroup $contentTypeGroup
118+ * @return string
119+ */
120+ protected function sanitizeContentTypeGroupIdentifier (ContentTypeGroup $ contentTypeGroup ): string
121+ {
122+ return str_replace (' ' , '_ ' , $ contentTypeGroup ->identifier );
123+ }
112124}
You can’t perform that action at this time.
0 commit comments