services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  news.cache:
    class: TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
    # We can not use CacheManager, as it can not be
    # injected/instantiated during ext_localconf.php loading
    # factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache']
    # therefore we use the static Bootstrap::createCache factory instead.
    factory: ['TYPO3\CMS\Core\Core\Bootstrap', 'createCache']
    arguments: ['news']

  GeorgRinger\News\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'


  GeorgRinger\News\Utility\ClassCacheManager:
    arguments: ['@news.cache']
    public: true

  GeorgRinger\News\Utility\ClassLoader:
    arguments: ['@news.cache', '@GeorgRinger\News\Utility\ClassCacheManager']
    public: true

  GeorgRinger\News\Seo\HrefLangEvent:
    tags:
      - name: event.listener
        identifier: 'ext-news/modify-hreflang'
        after: 'typo3-seo/hreflangGenerator'
        event: TYPO3\CMS\Frontend\Event\ModifyHrefLangTagsEvent

  GeorgRinger\News\Hooks\NewsContentElementPreview:
    public: true

  GeorgRinger\News\DataProcessing\AddNewsToMenuProcessor:
    tags:
      - { name: 'data.processor', identifier: 'add-news-to-menu' }

  GeorgRinger\News\DataProcessing\DisableLanguageMenuProcessor:
    tags:
      - { name: 'data.processor', identifier: 'disable-language-menu' }

  GeorgRinger\News\Command\ProxyClassRebuildCommand:
    tags:
      - name: 'console.command'
        command: 'news:rebuildProxyClasses'
        schedulable: false
        description: 'Rebuild the proxy classes used to extend EXT:news'

  GeorgRinger\News\Event\Listener\ModifyFileReferenceControlsEventListener:
    tags:
      - name: event.listener
        identifier: 'ext-news/modify-inline-element-control'
        method: 'modifyControls'
        event: TYPO3\CMS\Backend\Form\Event\ModifyFileReferenceControlsEvent

  GeorgRinger\News\Event\Listener\ModifyDatabaseQueryForContentEventListener:
    tags:
      - name: event.listener
        identifier: 'ext-news/modify-database-query-for-content'
        method: 'modify'
        event: TYPO3\CMS\Backend\View\Event\ModifyDatabaseQueryForContentEvent

  GeorgRinger\News\Event\Listener\ModifyDatabaseQueryForRecordListingEventListener:
    tags:
      - name: event.listener
        identifier: 'ext-news/modify-database-query-for-list'
        method: 'modify'
        event: TYPO3\CMS\Backend\View\Event\ModifyDatabaseQueryForRecordListingEvent

  GeorgRinger\News\Event\Listener\ModifyResultItemInLiveSearchEventListener:
    tags:
      - name: event.listener
        identifier: 'ext-news/modify-result-item-in-live-search'
        event: TYPO3\CMS\Backend\Search\Event\ModifyResultItemInLiveSearchEvent

  GeorgRinger\News\Domain\Service\NewsImportService:
    public: true
