本文整理汇总了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;
}