Skip to content

Commit 69c8bf5

Browse files
committed
further modifications suggested by @litzinger
1 parent 71d482c commit 69c8bf5

File tree

1 file changed

+64
-16
lines changed

1 file changed

+64
-16
lines changed

docs/development/extension-hooks/model/fluid-field.md

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,36 @@ lang: php
1515

1616
[TOC=3]
1717

18-
### `fluid_field_get_all_data($data, $fluid_field_id)`
18+
### `fluid_field_get_all_data($data, $fluid_field_id, $fluid_field)`
1919

20-
| Parameter | Type | Description |
21-
| ---------------- | ------------ | ----------------------------------------------------------------------- |
22-
| \$data | `FieldData` | Instance of ExpressionEngine\Model\Content\FieldData for fluid field |
23-
| \$fluid_field_id | `Int` | The ID of Fluid field being fetched |
24-
| Returns | `FieldData` | Current instance of ExpressionEngine\Model\Content\FieldData |
20+
| Parameter | Type | Description |
21+
| ---------------- | ------------ | ------------------------------------------------------------------------- |
22+
| \$data | `FieldData` | Instance of ExpressionEngine\Model\Content\FieldData for fluid field |
23+
| \$fluid_field_id | `Int` | The ID of Fluid field being fetched |
24+
| \$fluid_field | `FluidField` | Current instance of [FluidField model](development/models/fluid-field.md) |
25+
| Returns | `FieldData` | Current instance of ExpressionEngine\Model\Content\FieldData |
2526

26-
Called before the fluid field field object is returned.
27+
Called after field data has been fetched and before the fluid field field object is returned.
2728

2829
How it's called:
2930

30-
ee()->extensions->call('fluid_field_get_all_data', $data, $fluid_field_id);
31+
ee()->extensions->call('fluid_field_get_all_data', $data, $fluid_field_id, $fluid_field);
32+
33+
### `fluid_field_get_field_data($data, $fluid_field_id, $field_data_id, $fluid_field)`
34+
35+
| Parameter | Type | Description |
36+
| ---------------- | ------------ | ------------------------------------------------------------------------- |
37+
| \$data | `FieldData` | Instance of ExpressionEngine\Model\Content\FieldData for fluid field |
38+
| \$fluid_field_id | `Int` | The ID of Fluid field being fetched |
39+
| \$field_data_id | `Int` | The ID of row of field data racord |
40+
| \$fluid_field | `FluidField` | Current instance of [FluidField model](development/models/fluid-field.md) |
41+
| Returns | `Array` | Data for the field in Fluid that's currently fetched |
42+
43+
Called before field data is fetched. When hook is present, the field data will not be fetched from the database.
44+
45+
How it's called:
46+
47+
ee()->extensions->call('fluid_field_get_all_data', $data, $fluid_field_id, $field_data_id, $fluid_field);
3148

3249
### `fluid_field_add_field($field_table_name, $values, $fluid_field)`
3350

@@ -44,27 +61,58 @@ How it's called:
4461

4562
ee()->extensions->call('fluid_field_add_field', $field_table_name, $values, $fluid_field);
4663

64+
### `fluid_field_after_add_field($fluid_field, $field_table_name, $values, $id)`
65+
66+
| Parameter | Type | Description |
67+
| ------------------ | ------------ | ----------------------------- |
68+
| \$fluid_field | `FluidField` | Current instance of [FluidField model](development/models/fluid-field.md) |
69+
| \$field_table_name | `String` | Name of table being changed |
70+
| \$values | `Array` | The current field values |
71+
| \$id | `Int` | The ID of field that was added |
72+
| Returns | `Void` | Does not return any data |
73+
74+
Called after the fluid field is inserted.
75+
76+
How it's called:
77+
78+
ee()->extensions->call('fluid_field_after_add_field', $fluid_field, $field_table_name, $values, $id);
79+
4780
### `fluid_field_update_field($fluid_field, $field_table_name, $values)`
4881

49-
| Parameter | Type | Description |
50-
| ------------------ | ------------ | ----------------------------------------------------------------------- |
82+
| Parameter | Type | Description |
83+
| ------------------ | ------------ | ------------------------------------------------------------------------- |
5184
| \$fluid_field | `FluidField` | Current instance of [FluidField model](development/models/fluid-field.md) |
52-
| \$field_table_name | `String` | Name of table being changed |
53-
| \$values | `Array` | The current field values |
54-
| Returns | `Array` | Adjusted field values |
85+
| \$field_table_name | `String` | Name of table being changed |
86+
| \$values | `Array` | The current field values |
87+
| Returns | `Array` | Adjusted field values |
5588

5689
Called before the fluid field is updated. Changes made to the object will be saved automatically.
5790

5891
How it's called:
5992

6093
ee()->extensions->call('fluid_field_add_field', $field_table_name, $values);
6194

95+
### `fluid_field_after_update_field($fluid_field, $field_table_name, $values)`
96+
97+
| Parameter | Type | Description |
98+
| ------------------ | ------------ | ------------------------------------------------------------------------- |
99+
| \$fluid_field | `FluidField` | Current instance of [FluidField model](development/models/fluid-field.md) |
100+
| \$field_table_name | `String` | Name of table being changed |
101+
| \$values | `Array` | The current field values |
102+
| Returns | `Void` | Does not return any data |
103+
104+
Called after the fluid field has been updated.
105+
106+
How it's called:
107+
108+
ee()->extensions->call('fluid_field_add_field', $fluid_field, $field_table_name, $values);
109+
62110
### `fluid_field_remove_field($fluid_field)`
63111

64-
| Parameter | Type | Description |
65-
| ------------------ | ------------ | ----------------------------------------------------------------------- |
112+
| Parameter | Type | Description |
113+
| ------------------ | ------------ | ------------------------------------------------------------------------- |
66114
| \$fluid_field | `FluidField` | Current instance of [FluidField model](development/models/fluid-field.md) |
67-
| Returns | `null` | |
115+
| Returns | `null` | |
68116

69117
Called before the fluid field is deleted. Field will be deleted after hook is called
70118

0 commit comments

Comments
 (0)