services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false
    bind:
      $maskExtensionConfiguration: '@extensionconfiguration.mask'

  MASK\Mask\:
    resource: '../Classes/*'

  MASK\Mask\Loader\JsonLoader:
    tags:
      - name: mask.loader
        identifier: json

  MASK\Mask\Loader\JsonSplitLoader:
    tags:
      - name: mask.loader
        identifier: json-split

  MASK\Mask\Loader\LoaderInterface:
    factory:
      - '@MASK\Mask\Loader\LoaderRegistry'
      - 'getActivateLoader'

  MASK\Mask\Definition\TableDefinitionCollection:
    shared: false
    factory:
      - '@MASK\Mask\Loader\LoaderRegistry'
      - 'loadActiveDefinition'

  MASK\Mask\Migrations\MigrationManager:
    public: true
    arguments:
      - !tagged_iterator mask.migration

  extensionconfiguration.mask:
    class: 'array'
    factory:
      - '@TYPO3\CMS\Core\Configuration\ExtensionConfiguration'
      - 'get'
    arguments:
      - 'mask'

  querybuilder.backend_layout:
    class: 'TYPO3\CMS\Core\Database\Query\QueryBuilder'
    factory:
      - '@TYPO3\CMS\Core\Database\ConnectionPool'
      - 'getQueryBuilderForTable'
    arguments:
      - 'backend_layout'

  querybuilder.pages:
    class: 'TYPO3\CMS\Core\Database\Query\QueryBuilder'
    factory:
      - '@TYPO3\CMS\Core\Database\ConnectionPool'
      - 'getQueryBuilderForTable'
    arguments:
      - 'pages'

  MASK\Mask\Domain\Repository\BackendLayoutRepository:
    arguments:
      - '@querybuilder.backend_layout'
      - '@querybuilder.pages'

  MASK\Mask\Controller\MaskController:
    tags: [ 'backend.controller' ]

  MASK\Mask\Controller\AjaxController:
    tags: [ 'backend.controller' ]

  MASK\Mask\Controller\FieldsController:
    tags: [ 'backend.controller' ]

  MASK\Mask\CodeGenerator\TyposcriptCodeGenerator:
    public: true

  MASK\Mask\CodeGenerator\TcaCodeGenerator:
    public: true

  MASK\Mask\Helper\InlineHelper:
    public: true

  MASK\Mask\Imaging\IconProvider\ContentElementIconProvider:
    public: true

  MASK\Mask\Hooks\PageLayoutViewDrawItem:
    public: true

  MASK\Mask\Form\FormDataProvider\TcaTypesShowitemMaskBeLayoutFields:
    public: true

  MASK\Mask\ItemsProcFuncs\CTypeList:
    public: true

  MASK\Mask\DataProcessing\MaskProcessor:
    public: true

  MASK\Mask\Loader\LoaderRegistry:
    public: true

  MASK\Mask\Updates\FillTranslationSourceField:
    public: true

  MASK\Mask\CodeGenerator\SqlCodeGenerator:
    tags:
      - name: event.listener
        identifier: 'sql-code-generator'
        event: TYPO3\CMS\Core\Database\Event\AlterTableDefinitionStatementsEvent
        method: addDatabaseTablesDefinition

  MASK\Mask\Command\ConvertFormatCommand:
    tags:
      - name: 'console.command'
        command: 'mask:convert'
        description: 'Converts a Mask storage format into another.'
        schedulable: false
