PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.9
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.9
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Entries / Entries.php

Entries.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.9, at app/Modules/Entries/Entries.php

73 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Entries;
4
5 use FluentForm\App\Modules\Form\FormDataParser;
6 use FluentForm\App\Modules\Form\FormFieldsParser;
7
8 /**
9 * @deprecated Use SubmissionService or direct wpFluent() queries instead.
10 * Backward-compatible stub kept for third-party plugins (Ninja Tables, etc.)
11 * that resolve this class via wpFluentForm() container.
12 * @todo Remove in next major version.
13 */
14 class Entries extends EntryQuery
15 {
16 public function __construct()
17 {
18 parent::__construct();
19 }
20
21 /**
22 * @deprecated Use direct queries or REST API instead.
23 */
24 public function _getEntries(
25 $formId,
26 $currentPage,
27 $perPage,
28 $sortBy,
29 $entryType,
30 $search,
31 $wheres = []
32 ) {
33 $this->formId = $formId;
34 $this->per_page = $perPage;
35 $this->sort_by = $sortBy;
36 $this->page_number = $currentPage;
37 $this->search = $search;
38 $this->wheres = $wheres;
39
40 if ('favorite' == $entryType) {
41 $this->is_favourite = true;
42 } elseif ('all' != $entryType && $entryType) {
43 $this->status = $entryType;
44 }
45
46 $dateRange = $this->request->get('date_range');
47 if ($dateRange) {
48 $this->startDate = $dateRange[0];
49 $this->endDate = $dateRange[1];
50 }
51
52 $form = $this->formModel->find($formId);
53 $formMeta = $this->getFormInputsAndLabels($form);
54 $formLabels = $formMeta['labels'];
55
56 $formLabels = apply_filters('fluentform/entry_lists_labels', $formLabels, $form);
57 $submissions = $this->getResponses();
58 $submissions['data'] = FormDataParser::parseFormEntries($submissions['data'], $form);
59
60 return compact('submissions', 'formLabels');
61 }
62
63 public function getFormInputsAndLabels($form, $with = ['admin_label', 'raw'])
64 {
65 $formInputs = FormFieldsParser::getEntryInputs($form, $with);
66 $inputLabels = FormFieldsParser::getAdminLabels($form, $formInputs);
67 return [
68 'inputs' => $formInputs,
69 'labels' => $inputLabels,
70 ];
71 }
72 }
73