且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

帮助Kohana 3 ORM加快一点速度

更新时间:2023-11-15 22:26:34

biakaveron 用评论回答了我的问题,所以我只能回答正确的问题.

biakaveron answered my question with a comment so I can't except the correct answer.

从Wouters的官方Kohana论坛(biakaveron指出)上得到答案,这是正确的答案:

Taken from Wouters answer on the official Kohana forums (where biakaveron pointed to), this is the correct answer:

非常简单,$table_columns是 具有大量信息的大型阵列,但是 实际上这些信息很少 用于ORM.

It's very easy, $table_columns is a big array with a lot of info, but actually only very little of this info is used in ORM.

这可以做到:

protected $_table_columns = array(
    'id'            =>  array('type'=>'int'),
    'name'          =>  array('type'=>'string'),
    'allowNull'     =>  array('type'=>'string','null'=>TRUE),
    'created'       =>  array('type'=>'int')
);