本文整理匯總了PHP中Tinebase_Backend_Sql_Abstract::_getColumnsToFetch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_Backend_Sql_Abstract::_getColumnsToFetch方法的具體用法?PHP Tinebase_Backend_Sql_Abstract::_getColumnsToFetch怎麽用?PHP Tinebase_Backend_Sql_Abstract::_getColumnsToFetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tinebase_Backend_Sql_Abstract
的用法示例。
在下文中一共展示了Tinebase_Backend_Sql_Abstract::_getColumnsToFetch方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getColumnsToFetch
/**
* returns columns to fetch in first query and if an id/value pair is requested
*
* @param array|string $_cols
* @param Tinebase_Model_Filter_FilterGroup $_filter
* @param Tinebase_Model_Pagination $_pagination
* @return array
*/
protected function _getColumnsToFetch($_cols, Tinebase_Model_Filter_FilterGroup $_filter = NULL, Tinebase_Model_Pagination $_pagination = NULL)
{
$result = parent::_getColumnsToFetch($_cols, $_filter, $_pagination);
// sanitize sorting fields
$foreignTableSortFields = array('size' => 'tree_filerevisions', 'creation_time' => 'tree_fileobjects', 'created_by' => 'tree_fileobjects', 'last_modified_time' => 'tree_fileobjects', 'last_modified_by' => 'tree_fileobjects', 'type' => 'tree_fileobjects', 'contenttype' => 'tree_fileobjects', 'revision' => 'tree_fileobjects');
foreach ($foreignTableSortFields as $field => $table) {
if (isset($result[0][$field])) {
$result[0][$field] = $table . '.' . $field;
}
}
return $result;
}