2012-04-03 57 views

回答

1

关于该文件,这是不可能的:http://propelorm.org/reference/model-criteria.html#getting-columns-instead-of-objects

但是你可以做你自己。

内置的字段(根据您的同行类)的数组,并删除那些当你建立你的查询,你不需要

$fields = MyTablePeer::$fieldKeys[BasePeer::TYPE_PHPNAME]; 

/** 
    will give you (for example): 

    array (
    'Id' => 0, 
    'Name' => 1, 
    'Content' => 2, 
    ) 
*/ 

// remove unwanted column 
unset($fields['Name']); 

$items = MyTableQuery::create() 
    ->select(array_keys($fields)) 
    ->find(); 
} 
相关问题