本文整理汇总了PHP中Drupal\views\Tests\ViewTestData::viewsData方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewTestData::viewsData方法的具体用法?PHP ViewTestData::viewsData怎么用?PHP ViewTestData::viewsData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Tests\ViewTestData
的用法示例。
在下文中一共展示了ViewTestData::viewsData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: viewsData
/**
* Returns the views data definition.
*/
protected function viewsData()
{
$data = ViewTestData::viewsData();
// Tweak the views data to have a base for testing.
unset($data['views_test_data']['id']['field']);
unset($data['views_test_data']['name']['argument']);
unset($data['views_test_data']['age']['filter']);
unset($data['views_test_data']['job']['sort']);
$data['views_test_data']['created']['area']['id'] = 'text';
$data['views_test_data']['age']['area']['id'] = 'text';
$data['views_test_data']['age']['area']['sub_type'] = 'header';
$data['views_test_data']['job']['area']['id'] = 'text';
$data['views_test_data']['job']['area']['sub_type'] = array('header', 'footer');
// Duplicate the example views test data for different weight, different title,
// and matching data.
$data['views_test_data_2'] = $data['views_test_data'];
$data['views_test_data_2']['table']['base']['weight'] = 50;
$data['views_test_data_3'] = $data['views_test_data'];
$data['views_test_data_3']['table']['base']['weight'] = -50;
$data['views_test_data_4'] = $data['views_test_data'];
$data['views_test_data_4']['table']['base']['title'] = 'A different title';
$data['views_test_data_5'] = $data['views_test_data'];
$data['views_test_data_5']['table']['base']['title'] = 'Z different title';
$data['views_test_data_6'] = $data['views_test_data'];
return $data;
}
示例2: viewsData
/**
* Returns the views data definition.
*
* @return array
*/
protected function viewsData()
{
$data = ViewTestData::viewsData();
// Tweak the views data to have a base for testing
// \Drupal\views\ViewsDataHelper::fetchFields().
unset($data['views_test_data']['id']['field']);
unset($data['views_test_data']['name']['argument']);
unset($data['views_test_data']['age']['filter']);
unset($data['views_test_data']['job']['sort']);
$data['views_test_data']['created']['area']['id'] = 'text';
$data['views_test_data']['age']['area']['id'] = 'text';
$data['views_test_data']['age']['area']['sub_type'] = 'header';
$data['views_test_data']['job']['area']['id'] = 'text';
$data['views_test_data']['job']['area']['sub_type'] = array('header', 'footer');
return $data;
}
示例3: viewsData
/**
* Returns the views data definition.
*/
protected function viewsData()
{
return ViewTestData::viewsData();
}