FUELPHP ORM: Database view 'viewname' is defined without columns

44 views Asked by At

I am using ORM in FuelPHP to fetch some data on a table view I created in my data base.

I followed the instruction that is given here but I'm getting an error as seen on the title above. Here is a screenshot of the error for reference (http://prntscr.com/72ssqc).

Here is the code: http://pastebin.com/ips5VCzV

Here is a screenshot of the view Table: http://prntscr.com/72st1e

1

There are 1 answers

0
WanWizard On

Your view definition is wrong, it misses the 'columns' array, as the message explains.

protected static $_views = array(
    'hugot_summary' => array(
        'columns' => array(
            'id',
            'user_id',
            'photo_id',
            'hugot',
            'url',
            'comment_count',
            'upvotes',
            'created_at',
            'updated_at'
        ),
    ),
);