1

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

1 Answer 1

3

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.