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).
0.5
fieldname__toString
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.
0.5
fieldname__serialize
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.
0.5
fieldname__link
A link that appears beside the field fieldname on the edit form.
Returns a unix timestamp marking the date that a record was created.
0.9
getDescription
Returns a string description summary of this record. This is used for indexing, RSS feeds, and anywhere that a brief summary of a record is appropriate.
0.7
getPublicLink
Returns the public URL of this record (in case it is different than the standard URL).
0.8
getTitle
Returns the title for a given record. The title is used in various parts of the application to represent the record.
Overrides the getURL() method for a record. Returns the URL that should be used to display the given record.
0.6
titleColumn
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.
0.5
oneLineDescription
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.