.. include:: ../Includes.rst.txt ====== Models ====== The Anthology extension is designed to be a generic tool for displaying records from any database table. To achieve this, you must explicitly tell the extension which model you want it to work with. The :doc:`../QuickStart/Index` guide provides a brief overview, whilst this guide explains the concepts in more detail. Making a model available involves three key parts: the TCA, the Extbase Repository, and the Extbase Model. The TCA File ============ At a minimum, you need a :samp:`ctrl` section in your `TCA file `_ with a :samp:`title`. This title is what will appear in the plugin's "Model name" selection box. Here is a minimal example for a hypothetical table named :samp:`tx_myextension_domain_model_item`: **Configuration/TCA/tx_myextension_domain_model_item.php** .. code-block:: php [ 'title' => 'My Extension Items', 'label' => 'title', 'tstamp' => 'tstamp', 'crdate' => 'crdate', // ... other necessary ctrl properties 'iconfile' => 'EXT:my_extension/Resources/Public/Icons/Item.svg', ], // ... rest of your TCA ... ]; The Repository ============== To fetch the data from your table, the Anthology extension needs a corresponding `Extbase repository `_. This repository **must** have the :php:`LiquidLight\\Anthology\\Attribute\\AsAnthologyRepository` attribute with the corresponding TCA/table name argument. **Classes/Domain/Repository/ItemRepository.php** .. code-block:: php `_, no additional configuration is required to use a model in Anthology **Classes/Domain/Model/Item.php** .. code-block:: php