1 | <?php |
||
10 | abstract class AbstractHandler implements FieldHandlerInterface { |
||
11 | |||
12 | /** |
||
13 | * The entity language. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $language = NULL; |
||
18 | |||
19 | /** |
||
20 | * The simulated entity. |
||
21 | * |
||
22 | * @var object |
||
23 | */ |
||
24 | protected $entity = NULL; |
||
25 | |||
26 | /** |
||
27 | * The entity type. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $entityType = NULL; |
||
32 | |||
33 | /** |
||
34 | * The field name. |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $fieldName = NULL; |
||
39 | |||
40 | /** |
||
41 | * The field array, as returned by field_read_fields(). |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $fieldInfo = []; |
||
46 | |||
47 | /** |
||
48 | * Constructs an AbstractHandler object. |
||
49 | * |
||
50 | * @param object $entity |
||
51 | * The simulated entity object containing field information. |
||
52 | * @param string $entity_type |
||
53 | * The entity type. |
||
54 | * @param string $field_name |
||
55 | * The field name. |
||
56 | */ |
||
57 | public function __construct(\stdClass $entity, $entity_type, $field_name) { |
||
64 | |||
65 | /** |
||
66 | * Magic caller. |
||
67 | */ |
||
68 | public function __call($method, $args) { |
||
74 | |||
75 | /** |
||
76 | * Returns field information. |
||
77 | * |
||
78 | * @return array |
||
79 | * The field array, as returned by field_read_fields(). |
||
80 | */ |
||
81 | public function getFieldInfo() { |
||
84 | |||
85 | /** |
||
86 | * Returns the entity language. |
||
87 | * |
||
88 | * @return string |
||
89 | * The entity language. |
||
90 | */ |
||
91 | public function getEntityLanguage() { |
||
97 | |||
98 | } |
||
99 |