Dhiman
December 21, 2015, 10:38am
#1
Hello Friends…
I want to retrieve data from a database table with ‘WHERE’ clause.But its not working. Please help me out.
public function data() {
$connector = new SchedulerConnector(null, “PHPLaravel”);
$connector->configure(new MyModel(), "event_id", "start_date, end_date, event_name, details");
$connector->render();
}
The above code returns all the values from the table ‘event_table’.
****But i want to execute the below codes-----
public function data() {
$connector = new SchedulerConnector(null, “PHPLaravel”);
$connector->configure(
MyModel::where(user_id','=',1)->get(),
"event_id",
"start_date, end_date, event_name, details"
);
$connector->render();
}
Hi,
The second snippet is a valid one and must work correctly.
Connector accepts both the Model class and result of custom find
call
Do you have some kind of PHP error or just an empty output for the second snippet ?
Dhiman
December 22, 2015, 10:09am
#3
In my case an window popped-up and inside the tag following errors occur----
Whoops, looks like something went wrong.
1/1
ErrorException
in PHPLaravelDBDataWrapper.php line 14 :
Non-static method Illuminate\Support\Collection
::all() should not be called statically, assuming $this from incompatible context
in PHPLaravelDBDataWrapper.php line 14
at HandleExceptions -
>handleError('2048', 'Non-static method Illuminate\Support\Collection::all() should not be called statically
, assuming $this from incompatible context', 'C:\xampp\htdocs\laravel\vendor\dhtmlx\connector-php\codebase
\Dhtmlx\Connector\DataStorage\PHPLaravelDBDataWrapper.php', '14', array ('source' => object
(DataRequestConfig ), 'sourceData'
=> object (Collection ), 'className'
=> 'Illuminate\Database\Eloquent\Collection')) in PHPLaravelDBDataWrapper.php line 14
at PHPLaravelDBDataWrapper
->select(object (DataRequestConfig
)) in Connector
.php line 274
at Connector ->get_resource() in Connector.php line 254
at Connector ->render() in networksController.php line 572
at networksController ->data('1'
)
at call_user_func_array(array (object (networksController ), 'data'), array ('id' => '1'
)) in Controller.php line
256
at Controller ->callAction('data', array
('id' => '1')) in ControllerDispatcher.php line 164
at ControllerDispatcher ->call
(object (networksController ), object (Route ), 'data') in ControllerDispatcher.php line 112
at ControllerDispatcher ->Illuminate
\Routing\{closure}(object (Request ))
at call_user_func(object (Closure ), object (Request )) in Pipeline.php line 139
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request ))
at call_user_func(object (Closure ), object (Request )) in Pipeline.php line 103
at Pipeline ->then(object (Closure )) in ControllerDispatcher.php line 114
at ControllerDispatcher ->callWithinStack
(object (networksController ), object (Route ), object (Request ), 'data') in ControllerDispatcher.php line 69
at ControllerDispatcher ->dispatch
(object (Route ), object (Request ), 'App\Http\Controllers\networksController', 'data') in Route.php line 201
at Route ->runWithCustomDispatcher(object
(Request )) in Route.php line 134
at Route ->run(object (Request )) in Router.php line 704
at Router ->Illuminate\Routing\{closure}(object (Request ))
at call_user_func(object (Closure ), object (Request )) in Pipeline.php line 139
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request ))
at call_user_func(object (Closure ), object (Request )) in Pipeline.php line 103
at Pipeline ->then(object (Closure )) in Router.php line 706
at Router ->runRouteWithinStack(object<
/em>(Route ), object (Request )) in Router.php line 671
at Router ->dispatchToRoute(object
(Request )) in Router.php line 631
at Router ->dispatch(object (Request )) in Kernel.php line 236
at Kernel ->Illuminate\Foundation\Http
\{closure}(object (Request ))
at call_user_func(object (Closure ), object (Request )) in Pipeline.php line 139
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request )) in VerifyCsrfToken.php line
50
at VerifyCsrfToken ->handle(object (Request ), object (Closure ))
at call_user_func_array(array (object (VerifyCsrfToken ), 'handle'), array (object
(Request ), object (Closure
))) in Pipeline.php
line 124
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request )) in ShareErrorsFromSession.php
line 49
at ShareErrorsFromSession
->handle(object (Request ), object (Closure ))
at call_user_func_array(array (object (ShareErrorsFromSession ), 'handle'), array (object (Request ), object (Closure ))) in Pipeline
.php line 124
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request )) in StartSession.php line 62
at StartSession ->handle(object (Request ), object (Closure ))
at call_user_func_array(array (object (StartSession ), 'handle'), array (object (Request ), object (Closure ))) in Pipeline.php line
124
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request )) in AddQueuedCookiesToResponse
.php line 37
at AddQueuedCookiesToResponse
->handle(object (Request ), object (Closure ))
at call_user_func_array(array (object (AddQueuedCookiesToResponse ), 'handle'), array
(object (Request ), object (Closure ))) in Pipeline.php line 124
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request )) in EncryptCookies.php line 59
at EncryptCookies ->handle
(object (Request ), object (Closure ))
at call_user_func_array(array (object (EncryptCookies ), 'handle'), array (object (Request ), object (Closure ))) in Pipeline.php line
124
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request )) in CheckForMaintenanceMode
.php line 42
at CheckForMaintenanceMode
->handle(object (Request ), object (Closure ))
at call_user_func_array(array (object (CheckForMaintenanceMode ), 'handle'), array (object (Request ), object (Closure ))) in Pipeline.php line 124
at Pipeline ->Illuminate\Pipeline\{closure
}(object (Request ))
at call_user_func(object (Closure ), object (Request )) in Pipeline.php line 103
at Pipeline ->then(object (Closure )) in Kernel.php line 122
at Kernel ->sendRequestThroughRouter
(object (Request )) in Kernel.php line 87
at Kernel ->handle(object (
Request )) in index.php line
54
</div>
</body>
Hi,
Please try to update Dhtmlx\Connector\DataStorage\PHPLaravelDBDataWrapper.php with the attached one.
PHPLaravelDBDataWrapper.zip (880 Bytes)
Dhiman
December 23, 2015, 11:21am
#5
Thank u so much…its working now…
Dhiman
December 24, 2015, 9:47am
#6
In case of add new event it shows below errors----
Whoops, looks like something went wrong.
1/1
FatalErrorException in PHPLaravelDBDataWrapper.php line 33 :
Call to undefined method Illuminate\Database
\Eloquent\Collection::create()
</div>
</body>
***Also it fails to update any events…
Dhiman
December 28, 2015, 9:35am
#7
hello guys,
How to add a new event with fixed values.