Exported array specification¶
This is information for those who would like to implement theirs own method of clearing cache.
ttnewscache creates and passes array which consists of $newsData array and $viewsData array.
- status – (string) type of operation on news. Can have value 'new', 'update', 'delete'.
- id – (integer) uid of the news that have been created/updated/deleted
- relations – (string) comma separated list of relations in format [table]_[uid]. For example tt_news_34, pages_45. Should be used if you want to take care of relation yourself. Then set bidirectionalRelationsCatMatch = 0 so related are excluded from category check.
- categories – (string) comma separated list of categories uids the news belongs to
- relationsBefore – (string) the same as relations but before 'update'
- categoriesBefore – (string) the same as categories but before 'update'
- clearRelated – (boolean) information if related should be cleared. It has only meaning if you will take care of related by yourself using information from relations and relationsBefore. It will be set to 1 if changed news record field belongs to
This array has all views available but only views that have action set will need operation on cache. Action can have two states: view-marker and record-marker. View marker corresponds to wholeViewClearFields and record marker to selectiveViewClearFields. See examples at page 2 for better understanding.Related
Special treatment is reserved for related. There are 2 options:
- you take care of related yourself and use information in $newsData['relations'], $newsData['relationsBefore'] and $newsData['clearRelated'] to clear the proper caches of SINGLE view.
- if it is important on which pid the related records can be in cache_pages then you should use additional information gathered by ttnewscache.
Additional information gathering is turned on by:
tx_ttnewscache.bidirectionalRelationsCatMatch = 1
If you turn it on then in SINGLE view field: clearUids, (which normally has only uid of changed news), will also contain uids of related news that need to be cleared in that SINGLE view.
Examples of exported array¶
Example structure of produced array for LIST view.
Example structure of produced array for SINGLE view.