A delegate class is a PHP class that complements a particular table with custom behaviors. Basic table metadata can be supplied using the fields.ini file, however some things are better customized using PHP.
Delegate Class Location
The delegate class should be located in a file named TABLENAME.php (where TABLENAME is the name of the table with which the delegate class is associated) inside the table's configuration directory?. E.g. given a table named "people", you would place the delegate class in the file "tables/people/people.php"
Defines the SQL query that can be used to fetch records of this table. This is identical to the fields.ini file __sql__? directive, except that by defining it in the delegate class you have more flexibility.
Parses the input value for the field fieldname. This is called by Xataface inside the setValue() method or each record to normalize input values before they are stored in the object (not the database).
Converts the value of the field fieldname to a string. This string representation is used as the basis for most higher level data retrieval methods (such as serialize and display). This could be treated as an inverse to the fieldname__parse? method.
Converts a value of the field fieldname to be saved in the database. This should return a string representation of the value that is suitable for database storage.
A link that appears beside the field fieldname on the edit form.
Overrides the getURL() method for a record. Returns the URL that should be used to display the given record.
Returns a string SQL select expression that is used to describe the title of records. This function is mainly used in drop-down select lists, such as the "jump menu" in the ResultList controller and the Add Existing Records select list in relationship tabs. Most other forms of the title are displayed using the getTitle function instead. Normally, these functions are set to output the same string, but they can be different if needed. For example, it may be helpful to use either abbreviate or use more detail in these drop-down lists. Note that this function will override the title directive in the fields.ini file if set there.
Returns the exact HTML that you want to have displayed for each row of the oneLineDescription() method in the target table's delegate class (i.e the documents table in this case) to return the exact HTML that you want to have displayed for each row of the glance list. This will allow you to add whatever links you want. Also see template blocks after_oneLineDescription and before_oneLineDescription.