1 | <?php |
||
14 | class GF_Entry extends Entry implements \ArrayAccess { |
||
15 | |||
16 | /** |
||
17 | * @var string The identifier of the backend used for this entry. |
||
18 | * @api |
||
19 | * @since future |
||
20 | */ |
||
21 | public static $backend = 'gravityforms'; |
||
22 | |||
23 | /** |
||
24 | * Initialization. |
||
25 | */ |
||
26 | private function __construct() { |
||
31 | |||
32 | /** |
||
33 | * Construct a \GV\Entry instance by ID. |
||
34 | * |
||
35 | * @param int|string $entry_id The internal entry ID. |
||
36 | * |
||
37 | * @api |
||
38 | * @since future |
||
39 | * @return \GV\Entry|null An instance of this entry or null if not found. |
||
40 | */ |
||
41 | public static function by_id( $entry_id ) { |
||
49 | |||
50 | /** |
||
51 | * Construct a \GV\Entry instance from a Gravity Forms entry array. |
||
52 | * |
||
53 | * @param array $entry The array ID. |
||
54 | * |
||
55 | * @return \GV\Entry|null An instance of this entry or null if not found. |
||
56 | */ |
||
57 | public static function from_entry( $entry ) { |
||
69 | |||
70 | /** |
||
71 | * ArrayAccess compatibility layer with a Gravity Forms entry array. |
||
72 | * |
||
73 | * @internal |
||
74 | * @deprecated |
||
75 | * @since future |
||
76 | * @return bool Whether the offset exists or not. |
||
77 | */ |
||
78 | public function offsetExists( $offset ) { |
||
81 | |||
82 | /** |
||
83 | * ArrayAccess compatibility layer with a Gravity Forms entry array. |
||
84 | * |
||
85 | * Maps the old keys to the new data; |
||
86 | * |
||
87 | * @internal |
||
88 | * @deprecated |
||
89 | * @since future |
||
90 | * |
||
91 | * @return mixed The value of the requested entry data. |
||
92 | */ |
||
93 | public function offsetGet( $offset ) { |
||
96 | |||
97 | /** |
||
98 | * ArrayAccess compatibility layer with a Gravity Forms entry array. |
||
99 | * |
||
100 | * @internal |
||
101 | * @deprecated |
||
102 | * @since future |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | public function offsetSet( $offset, $value ) { |
||
109 | |||
110 | /** |
||
111 | * ArrayAccess compatibility layer with a Gravity Forms entry array. |
||
112 | * |
||
113 | * @internal |
||
114 | * @deprecated |
||
115 | * @since future |
||
116 | * @return void |
||
117 | */ |
||
118 | public function offsetUnset( $offset ) { |
||
121 | } |
||
122 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.