Issue
I have experience in using cakephp 2 but i have no idea in cakephp 3.
My database admin keep creating database table with uppercase name even in column name, so i have to make cakephp model with custom table/view name.
<?php
namespace App\Model\Table;
use Cake\ORM\Table;
class ListCrewBooking extends Table
{
public function initialize(array $config)
{
$this->table('VW_CREW_ON_DUTY');
}
}
and then i want to preview it on a controller directly without a cake view (using die();)
class TestController extends AppController
{
function index(){
$this->viewBuilder()->layout = false;
$this->loadModel('ListCrewBooking');
$data = $this->ListCrewBooking->find('all');
pr($data);
die();
}
}
and then an error comes out
Cannot describe list_crew_booking. It has 0 columns.
Why this is happened? and how to solve this? i have no clue what is going on.
ps: the view have 5000 rows and many columns
Thank you for any reply
Solution
Currently Cake 3 is not able to inspect views in the database when using the Sql server driver. There was a pull request for it, but was abandoned by the author. Maybe, if you have knowledge of this database, you can contribute this feature?
Answered By - José Lorenzo Rodríguez
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.