File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,12 +87,16 @@ public function getMessages()
8787 public static function createFromArray (array $ data )
8888 {
8989 $ obj = new self ();
90- $ obj ->name = $ data ['JourneyName ' ]['name ' ];
91- $ obj ->type = $ data ['JourneyType ' ]['type ' ];
90+ $ obj ->name = isset ( $ data ['JourneyName ' ][ ' name ' ]) ? $ data [ ' JourneyName ' ][ ' name ' ] : $ data [ ' JourneyName ' ][ 0 ]['name ' ];
91+ $ obj ->type = isset ( $ data ['JourneyType ' ][ ' type ' ]) ? $ data [ ' JourneyType ' ][ ' type ' ] : $ data [ ' JourneyType ' ][ 0 ]['type ' ];
9292
9393 if (isset ($ data ['Note ' ])) {
94- foreach ($ data ['Note ' ] as $ note ) {
95- $ obj ->notes [] = $ note ['text ' ];
94+ if (isset ($ data ['Note ' ][0 ]) && is_array ($ data ['Note ' ][0 ])) {
95+ foreach ($ data ['Note ' ] as $ note ) {
96+ $ obj ->notes [] = $ note ['text ' ];
97+ }
98+ } else {
99+ $ obj ->notes [] = $ data ['Note ' ]['text ' ];
96100 }
97101 }
98102
You can’t perform that action at this time.
0 commit comments