2012-04-03 45 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(); 
} 
相關問題