21
21
namespace Phalcon \Builder ;
22
22
23
23
use Phalcon \Text ;
24
+ use Phalcon \Utils ;
24
25
use Phalcon \Builder \Model as ModelBuilder ;
25
26
use Phalcon \DI \FactoryDefault ;
26
27
use Phalcon \Db \Column ;
@@ -277,7 +278,7 @@ private function _captureFilterInput($var, $fields, $useGetSetters, $identityFie
277
278
}
278
279
}
279
280
280
- $ code .= '$ ' . Text:: camelize ($ var , '- ' ) . '-> ' ;
281
+ $ code .= '$ ' . Utils:: lowerCamelizeWithDelimiter ($ var , '- ' , true ) . '-> ' ;
281
282
if ($ useGetSetters ) {
282
283
$ code .= 'set ' . Text::camelize ($ field ) . '( ' . $ fieldCode . ') ' ;
283
284
} else {
@@ -307,7 +308,7 @@ private function _assignTagDefaults($var, $fields, $useGetSetters)
307
308
$ accessor = $ field ;
308
309
}
309
310
310
- $ code .= '$this->tag->setDefault(" ' . $ field . '", $ ' . Text:: camelize ($ var , '- ' ) . '-> ' . $ accessor . '); ' . PHP_EOL . "\t\t\t" ;
311
+ $ code .= '$this->tag->setDefault(" ' . $ field . '", $ ' . Utils:: lowerCamelizeWithDelimiter ($ var , '- ' , true ) . '-> ' . $ accessor . '); ' . PHP_EOL . "\t\t\t" ;
311
312
}
312
313
313
314
return $ code ;
@@ -491,10 +492,10 @@ private function _makeController()
491
492
492
493
$ code = str_replace ('$fullyQualifiedModelName$ ' , $ this ->options ->get ('modelClass ' ), $ code );
493
494
494
- $ code = str_replace ('$singularVar$ ' , '$ ' . Text:: camelize ($ this ->options ->get ('singular ' ), '- ' ), $ code );
495
+ $ code = str_replace ('$singularVar$ ' , '$ ' . Utils:: lowerCamelizeWithDelimiter ($ this ->options ->get ('singular ' ), '- ' , true ), $ code );
495
496
$ code = str_replace ('$singular$ ' , $ this ->options ->get ('singular ' ), $ code );
496
497
497
- $ code = str_replace ('$pluralVar$ ' , '$ ' . Text:: camelize ($ this ->options ->get ('plural ' ), '- ' ), $ code );
498
+ $ code = str_replace ('$pluralVar$ ' , '$ ' . Utils:: lowerCamelizeWithDelimiter ($ this ->options ->get ('plural ' ), '- ' , true ), $ code );
498
499
$ code = str_replace ('$plural$ ' , $ this ->options ->get ('plural ' ), $ code );
499
500
500
501
$ code = str_replace ('$className$ ' , $ this ->options ->get ('className ' ), $ code );
@@ -726,7 +727,7 @@ private function _makeViewSearch()
726
727
$ rowCode .= "\t\t\t" . '<td><?php echo ' ;
727
728
if (!isset ($ this ->options ->allReferences [$ fieldName ])) {
728
729
if ($ this ->options ->genSettersGetters ) {
729
- $ rowCode .= '$ ' . Text:: camelize ($ this ->options ->singular , '- ' ) . '->get ' . Text::camelize ($ fieldName ) . '() ' ;
730
+ $ rowCode .= '$ ' . Utils:: lowerCamelizeWithDelimiter ($ this ->options ->singular , '- ' , true ) . '->get ' . Text::camelize ($ fieldName ) . '() ' ;
730
731
} else {
731
732
$ rowCode .= '$ ' . $ this ->options ->singular . '-> ' . $ fieldName ;
732
733
}
@@ -747,7 +748,7 @@ private function _makeViewSearch()
747
748
$ code = str_replace ('$plural$ ' , $ this ->options ->plural , $ code );
748
749
$ code = str_replace ('$headerColumns$ ' , $ headerCode , $ code );
749
750
$ code = str_replace ('$rowColumns$ ' , $ rowCode , $ code );
750
- $ code = str_replace ('$singularVar$ ' , '$ ' . Text:: camelize ($ this ->options ->singular , '- ' ), $ code );
751
+ $ code = str_replace ('$singularVar$ ' , '$ ' . Utils:: lowerCamelizeWithDelimiter ($ this ->options ->singular , '- ' , true ), $ code );
751
752
$ code = str_replace ('$pk$ ' , $ idField , $ code );
752
753
753
754
if ($ this ->isConsole ()) {
@@ -791,7 +792,7 @@ private function _makeViewSearchVolt()
791
792
$ rowCode .= "\t\t\t" . '<td>{{ ' ;
792
793
if (!isset ($ this ->options ->allReferences [$ fieldName ])) {
793
794
if ($ this ->options ->contains ('genSettersGetters ' )) {
794
- $ rowCode .= Text:: camelize ($ this ->options ->singular , '- ' ) . '.get ' . Text::camelize ($ fieldName ) . '() ' ;
795
+ $ rowCode .= Utils:: lowerCamelizeWithDelimiter ($ this ->options ->singular , '- ' , true ) . '.get ' . Text::camelize ($ fieldName ) . '() ' ;
795
796
} else {
796
797
$ rowCode .= $ this ->options ->singular . '. ' . $ fieldName ;
797
798
}
@@ -812,7 +813,7 @@ private function _makeViewSearchVolt()
812
813
$ code = str_replace ('$plural$ ' , $ this ->options ->plural , $ code );
813
814
$ code = str_replace ('$headerColumns$ ' , $ headerCode , $ code );
814
815
$ code = str_replace ('$rowColumns$ ' , $ rowCode , $ code );
815
- $ code = str_replace ('$singularVar$ ' , Text:: camelize ($ this ->options ->singular , '- ' ), $ code );
816
+ $ code = str_replace ('$singularVar$ ' , Utils:: lowerCamelizeWithDelimiter ($ this ->options ->singular , '- ' , true ), $ code );
816
817
$ code = str_replace ('$pk$ ' , $ idField , $ code );
817
818
818
819
if ($ this ->isConsole ()) {
0 commit comments