本文整理汇总了PHP中GVCommon::get_entries方法的典型用法代码示例。如果您正苦于以下问题:PHP GVCommon::get_entries方法的具体用法?PHP GVCommon::get_entries怎么用?PHP GVCommon::get_entries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GVCommon
的用法示例。
在下文中一共展示了GVCommon::get_entries方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_entries
/**
* Get the entries that will be shown in the current widget
*
* @param array $instance Settings for the current widget
*
* @return array $entries Multidimensional array of Gravity Forms entries
*/
private function get_entries($instance, $form_id)
{
// Get the settings for the View ID
$view_settings = gravityview_get_template_settings($instance['view_id']);
// Set the context view ID to avoid conflicts with the Advanced Filter extension.
$criteria['context_view_id'] = $instance['view_id'];
$instance['limit'] = isset($instance['limit']) ? $instance['limit'] : 10;
$view_settings['id'] = $instance['view_id'];
$view_settings['page_size'] = $instance['limit'];
// Prepare paging criteria
$criteria['paging'] = array('offset' => 0, 'page_size' => $instance['limit']);
// Prepare Search Criteria
$criteria['search_criteria'] = array('field_filters' => array());
$criteria['search_criteria'] = GravityView_frontend::process_search_only_approved($view_settings, $criteria['search_criteria']);
$criteria['search_criteria']['status'] = apply_filters('gravityview_status', 'active', $view_settings);
/**
* Modify the search parameters before the entries are fetched
*/
$criteria = apply_filters('gravityview/widget/recent-entries/criteria', $criteria, $instance, $form_id);
$results = GVCommon::get_entries($form_id, $criteria);
return $results;
}
示例2: array
$criteria['paging'] = array('offset' => 0, 'page_size' => $view_settings['page_size']);
// Prepare Search Criteria
$criteria['search_criteria'] = array('field_filters' => array(array('key' => 'created_by', 'value' => $created_by, 'operator' => 'is')));
$criteria['search_criteria'] = GravityView_frontend::process_search_only_approved($view_settings, $criteria['search_criteria']);
$criteria['search_criteria']['status'] = apply_filters('gravityview_status', 'active', $view_settings);
/**
* Modify the search parameters before the entries are fetched
*
* @since 1.11
*
* @param array $criteria Gravity Forms search criteria array, as used by GVCommon::get_entries()
* @param array $view_settings Associative array of settings with plugin defaults used if not set by the View
* @param int $form_id The Gravity Forms ID
*/
$criteria = apply_filters('gravityview/field/other_entries/criteria', $criteria, $view_settings, $form_id);
$entries = GVCommon::get_entries($form_id, $criteria);
// Don't show if no entries and the setting says so
if (empty($entries) && $gravityview_view->getCurrentFieldSetting('no_entries_hide')) {
return;
}
// If there are search results, get the entry list object
$list = new GravityView_Entry_List($entries, $gravityview_view->getPostId(), $field['form'], $gravityview_view->getCurrentFieldSetting('link_format'), $gravityview_view->getCurrentFieldSetting('after_link'), 'other_entries');
// Generate and echo the output
$list->output();
/**
* @since 1.7.6
* @deprecated since 1.11
*/
$deprecated = apply_filters('gravityview/field/other_entries/args', array(), $field);
if (!empty($deprecated)) {
_deprecated_function('The "gravityview/field/other_entries/args" filter', 'GravityView 1.11', 'gravityview/field/other_entries/criteria');
示例3: gravityview_get_entries
/**
* Retrieve entries given search, sort, paging criteria
*
* @see GFAPI::get_entries()
* @see GFFormsModel::get_field_filters_where()
* @access public
* @param int|array $form_ids The ID of the form or an array IDs of the Forms. Zero for all forms.
* @param mixed $passed_criteria (default: null)
* @param mixed &$total (default: null)
* @return mixed False: Error fetching entries. Array: Multi-dimensional array of Gravity Forms entry arrays
*/
function gravityview_get_entries($form_ids = null, $passed_criteria = null, &$total = null)
{
return GVCommon::get_entries($form_ids, $passed_criteria, $total);
}