Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 3.32 KB

File metadata and controls

75 lines (60 loc) · 3.32 KB

Prerequisite

CleverAge/ProcessBundle must be installed.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Open a command console, enter your project directory and install it using composer:

composer require cleverage/doctrine-process-bundle

Remember to add the following line to config/bundles.php (not required if Symfony Flex is used)

CleverAge\DoctrineProcessBundle\CleverAgeDoctrineProcessBundle::class => ['all' => true],

This bundle relies on doctrine/doctrine-bundle and doctrine/orm, installed as dependencies: the bundle Doctrine\Bundle\DoctrineBundle\DoctrineBundle must be enabled as well.

Configuration

This bundle has no configuration of its own: its tasks use the Doctrine connections and entity managers configured in config/packages/doctrine.yaml.

# config/packages/doctrine.yaml
doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'
    orm:
        mappings:
            App:
                type: attribute
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
  • Database tasks (DatabaseReaderTask, DatabaseUpdaterTask) run raw SQL queries through Doctrine DBAL. Their connection option takes the name of a connection (a key under doctrine.dbal.connections); the default connection is used if it is not set.
  • EntityManager tasks work with Doctrine ORM entities. Except for the ClearEntityManagerTask, which takes the name of an entity manager (a key under doctrine.orm.entity_managers) in its entity_manager option, they use the entity manager that manages the class of the handled entity.

See the DoctrineBundle documentation for the configuration of multiple connections and entity managers.

Documentation