/
interface.exportablefield.php
83 lines (70 loc) · 1.63 KB
/
interface.exportablefield.php
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
78
79
80
81
82
83
<?php
/**
* @package interface
*/
/**
* The `ExportableField` interface defines the functions required to implement
* the field export API proposal.
*
* @since Symphony 2.3.1
* @link https://github.com/symphonycms/symphony-2/issues/1394
*/
interface ExportableField
{
/**
* Select an array of values from a field.
*/
const LIST_OF = 1100;
/**
* Select a `boolean` from a field.
*/
const BOOLEAN = 1101;
/**
* Select an `object` from a field.
*/
const OBJECT = 1102;
/**
* Select an entry ID from a field.
*/
const ENTRY = 1103;
/**
* Select an author ID from a field.
*/
const AUTHOR = 1104;
/**
* Select handles from a field.
*/
const HANDLE = 1105;
/**
* Select raw values from a field, oriented towards the human readable.
*/
const VALUE = 1106;
/**
* Select raw values from a field, as expected by `prepareImportValue`.
*/
const POSTDATA = 1107;
/**
* Select formatted values from a field.
*/
const FORMATTED = 1108;
/**
* Select unformatted values from a field.
*/
const UNFORMATTED = 1109;
/**
* Return a list of supported export modes for use with `prepareExportValue`.
*
* @return array
*/
public function getExportModes();
/**
* Give the field some data and ask it to return a value using one of many
* possible modes.
*
* @param mixed $data
* @param integer $mode
* @param integer $entry_id
* @return mixed
*/
public function prepareExportValue($data, $mode, $entry_id = null);
}