Custom TVs and additional document fields

In general, values have to be transferred between the $fields array and a temporary array of TV values while you are creating and updating items. Form fields and TVs containing the same data often need different names. Several features of the class definition deal with this (see listing of Event class for an example):

You can add more TVs to your classes provided you follow the above steps.Look at the pkVenue TV in the Event class for an example.

PubKit already processes quite a few built-in document fields explicitly. More built-in fields such as description can be added using a similar technique. List the names of the fields as a variable in the class definition in an array called $docFields, and adhere to the standard names of the fields in your form. Then they will be saved and retrieved like other fields, with no need to add purpose-built functions.