2525function initConfigOption ()
2626{
2727 if (!isset ($ _POST ['id ' ])){
28- $ data = Capsule::table ('tblproducts ' )->where ('servertype ' , 'solusvmpro ' )->where ('id ' , $ _GET ['id ' ])->get ();
28+ $ data = SolusVM:: collectionToArray ( Capsule::table ('tblproducts ' )->where ('servertype ' , 'solusvmpro ' )->where ('id ' , $ _GET ['id ' ])->get () );
2929 }else {
30- $ data = Capsule::table ('tblproducts ' )->where ('servertype ' , 'solusvmpro ' )->where ('id ' , $ _POST ['id ' ])->get ();
30+ $ data = SolusVM:: collectionToArray ( Capsule::table ('tblproducts ' )->where ('servertype ' , 'solusvmpro ' )->where ('id ' , $ _POST ['id ' ])->get () );
3131 }
32+
3233 $ packageconfigoption = [];
3334 if (is_array ($ data ) && count ($ data ) > 0 ) {
3435 $ packageconfigoption [1 ] = $ data [0 ]->configoption1 ;
@@ -47,7 +48,7 @@ function solusvmpro_ConfigOptions() {
4748
4849 $ master_array = array ();
4950 /** @var stdClass $row */
50- foreach ( Capsule::table ( 'tblservers ' )->where ( 'type ' , 'solusvmpro ' )->get () as $ row ) {
51+ foreach ( SolusVM:: collectionToArray ( Capsule::table ( 'tblservers ' )->where ( 'type ' , 'solusvmpro ' )->get () ) as $ row ) {
5152 $ master_array [] = $ row ->id . " - " . $ row ->name ;
5253 }
5354
@@ -724,7 +725,7 @@ function solusvmpro_ChangePackage( $params ) {
724725
725726 if ( $ cextraip > 0 ){
726727 //first() function doesn't work
727- $ ipaddresses = Capsule::table ('tblhosting ' )->select ('assignedips ' )->where ( 'id ' , $ params ['serviceid ' ] )->get ();
728+ $ ipaddresses = SolusVM:: collectionToArray ( Capsule::table ('tblhosting ' )->select ('assignedips ' )->where ( 'id ' , $ params ['serviceid ' ] )->get () );
728729 $ ips = $ ipaddresses [0 ]->assignedips ;
729730
730731 $ lines_arr = explode (PHP_EOL , $ ips );
0 commit comments