Module CustomFields Dev: Difference between revisions

Jump to navigation Jump to search
(→‎Should do: added todo listings)
Line 222: Line 222:
The first step into CustomFields is to create and manage the structure of a custom field.
The first step into CustomFields is to create and manage the structure of a custom field.


=== Creating a custom field ===
=== Creating a custom field definition ===


To create a custom field, you can use the addCustomField() method.
To create a custom field, you can use the addCustomField() method.
Line 232: Line 232:
This will take care of forging the (complicated) SQL query with the forgeSQLCustomField() method, and will return you an error if there was a problem.
This will take care of forging the (complicated) SQL query with the forgeSQLCustomField() method, and will return you an error if there was a problem.


=== Updating a custom field ===
=== Updating a custom field definition ===


To update a custom field, you can use the updateCustomField() method:
To update a custom field, you can use the updateCustomField() method:
Line 245: Line 245:
Note2: updating a custom field will automatically take care of the constraints and foreign keys on its own, thus you can change the foreign key, or remove it altogether if set to null.
Note2: updating a custom field will automatically take care of the constraints and foreign keys on its own, thus you can change the foreign key, or remove it altogether if set to null.


=== Delete a custom field ===
=== Delete a custom field definition ===


You can easily delete a custom field by column_name or by ordinal_position:
You can easily delete a custom field by column_name or by ordinal_position:
439

edits

Navigation menu