SingleSubmissionInterface.php
1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Contract defining single submission storage and retrieval
*
* NOTE: File location would not permanently be in the Models folder; it
* currently resides here during initial development.
*/
interface NF_Exports_Interfaces_SingleSubmissionInterface {
/**
* Get Field Value
*
* Return a single submission value by field ID or field key.
*
* @param int|string $field_ref
* @return string
*/
public function getFieldValue($field_ref);
/**
* Get all submission field values for a single, pre-defined submission
*
* @return array|mixed
*/
public function getFieldValues();
/**
* Return the submission Id
* @return int
*/
public function getId();
/**
* Return the Sequence Number of a predefined submission Id
*/
public function getSeqNum();
/**
* Return the submission date for predefined submission Id
* @param string $format Optional date format
*/
public function getSubmissionDate($format = 'm/d/Y');
/**
* Filter field values to return only provided keys
*
* NOTE: filter is performed on array KEYS of incoming parameter. This
* enables use of `field labels` array generated at the collection level,
* which is keyed off the same field keys as the submission for perfect
* matching of array columns.
*
* @param array $fieldKeys Array keyed on field keys with optional value
* @return array
*/
public function filterFieldValues($fieldKeys)/* :array */;
/**
* Set timestamp of export
* @param int $unixTimestamp
*/
public function setExportDatetime(int $unixTimestamp);
/**
* Return true if submission has been exported
*
* @return bool
*/
public function wasExported();
/**
* Return bool `true` if submission is unread
* @return bool
*/
public function isUnread();
}