@@ -19,11 +19,8 @@ public function allowMultiple() {
1919 );
2020
2121 public function tableMapFilter (&$ script ) {
22- $ table = $ this ->getTable ();
2322
24- foreach ($ this ->getEncryptedColumnNames () as $ columnName ) {
25- $ column = $ table ->getColumn ($ columnName );
26- $ columnPhpName = $ column ->getPhpName ();
23+ foreach ($ this ->getEncryptedColumnPhpNames () as $ columnPhpName ) {
2724
2825 $ encryptedColumnsDeclarationLocation = strpos ($ script , "ENCRYPTED_COLUMNS " );
2926
@@ -45,26 +42,24 @@ public function tableMapFilter(&$script) {
4542 }
4643
4744 public function objectFilter (&$ script ) {
48- $ table = $ this ->getTable ();
49-
50- foreach ($ this ->getEncryptedColumnNames () as $ columnName ) {
51- $ aggregateColumn = $ table ->getColumn ($ columnName );
52- $ columnPhpName = $ aggregateColumn ->getPhpName ();
5345
46+ foreach ($ this ->getEncryptedColumnPhpNames () as $ columnPhpName ) {
5447 $ this ->modifySetterWithEncryption ($ script , $ columnPhpName );
5548 $ this ->modifyGetterWithDecryption ($ script , $ columnPhpName );
56-
5749 }
5850 }
5951
60- protected function getEncryptedColumnNames () {
61- $ encryptedColumnNames = [];
62- foreach ($ this ->getParameters () as $ key => $ parameter ) {
63- if (strpos ($ key , "column_name " ) !== false ) {
64- $ encryptedColumnNames [] = $ parameter ;
52+ protected function getEncryptedColumnPhpNames () {
53+ $ table = $ this ->getTable ();
54+
55+ $ encryptedColumnPhpNames = [];
56+ foreach ($ this ->getParameters () as $ key => $ columnName ) {
57+ if (strpos ($ key , "column_name " ) !== false && $ columnName ) {
58+ $ column = $ table ->getColumn ($ columnName );
59+ $ encryptedColumnPhpNames [] = $ column ->getPhpName ();
6560 }
6661 }
67- return $ encryptedColumnNames ;
62+ return $ encryptedColumnPhpNames ;
6863 }
6964
7065 protected function makeEncryptedColumnsDeclaration ($ columnPhpName ) {
0 commit comments