src/DependencyInjection/SonataPageExtension.php
/**
     * NEXT_MAJOR: Remove this method.
     *
     * Registers doctrine mapping on concrete page entities.
     */
Remove this method.
Registers doctrine mapping on concrete page entities.
Remove this method . Registers doctrine mapping on concrete page entities .
public function registerDoctrineMapping(array $config)
    {
        @trigger_error(
            'Using SonataEasyExtendsBundle is deprecated since sonata-project/page-bundle 3.19. Please register SonataDoctrineBundle as a bundle instead.',
            \E_USER_DEPRECATED
        );
        if (!class_exists($config['class']['page'])) {
            return;
        }
        $collector = DeprecatedDoctrineCollector::getInstance();
        $collector->addAssociation($config['class']['page'], 'mapOneToMany', [
            'fieldName' => 'children',
            'targetEntity' => $config['class']['page'],
            'cascade' => [
                'persist',
             ],
            'mappedBy' => 'parent',
            'orphanRemoval' => false,
            'orderBy' => [
                'position' => 'ASC',
            ],
        ]);
        $collector->addAssociation($config['class']['page'], 'mapOneToMany', [
            'fieldName' => 'blocks',
            'targetEntity' => $config['class']['block'],
            'cascade' => [
                'remove',
                'persist',
                'refresh',
                'merge',
                'detach',
            ],
            'mappedBy' => 'page',
            'orphanRemoval' => false,
            'orderBy' => [
                'position' => 'ASC',
            ],
        ]);
        $collector->addAssociation($config['class']['page'], 'mapManyToOne', [
            'fieldName' => 'site',
            'targetEntity' => $config['class']['site'],
            'cascade' => [
                'persist',
            ],
            'mappedBy' => null,
            'inversedBy' => null,
            'joinColumns' => [
                [
                    'name' => 'site_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['page'], 'mapManyToOne', [
            'fieldName' => 'parent',
            'targetEntity' => $config['class']['page'],
            'cascade' => [
                 'persist',
            ],
            'mappedBy' => null,
            'inversedBy' => 'children',
            'joinColumns' => [
                [
                    'name' => 'parent_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['page'], 'mapOneToMany', [
             'fieldName' => 'sources',
             'targetEntity' => $config['class']['page'],
             'cascade' => [],
             'mappedBy' => 'target',
             'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['page'], 'mapManyToOne', [
            'fieldName' => 'target',
            'targetEntity' => $config['class']['page'],
            'cascade' => [
                'persist',
            ],
            'mappedBy' => null,
            'inversedBy' => 'sources',
            'joinColumns' => [
                [
                    'name' => 'target_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['block'], 'mapOneToMany', [
            'fieldName' => 'children',
            'targetEntity' => $config['class']['block'],
            'cascade' => [
                'remove',
                'persist',
            ],
            'mappedBy' => 'parent',
            'orphanRemoval' => true,
            'orderBy' => [
                'position' => 'ASC',
            ],
        ]);
        $collector->addAssociation($config['class']['block'], 'mapManyToOne', [
            'fieldName' => 'parent',
            'targetEntity' => $config['class']['block'],
            'cascade' => [
            ],
            'mappedBy' => null,
            'inversedBy' => 'children',
            'joinColumns' => [
                [
                    'name' => 'parent_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['block'], 'mapManyToOne', [
            'fieldName' => 'page',
            'targetEntity' => $config['class']['page'],
            'cascade' => [
                'persist',
            ],
            'mappedBy' => null,
            'inversedBy' => 'blocks',
            'joinColumns' => [
                [
                    'name' => 'page_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['snapshot'], 'mapManyToOne', [
            'fieldName' => 'site',
            'targetEntity' => $config['class']['site'],
            'cascade' => [
                'persist',
            ],
            'mappedBy' => null,
            'inversedBy' => null,
            'joinColumns' => [
                [
                    'name' => 'site_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addAssociation($config['class']['snapshot'], 'mapManyToOne', [
            'fieldName' => 'page',
            'targetEntity' => $config['class']['page'],
            'cascade' => [
                'persist',
            ],
            'mappedBy' => null,
            'inversedBy' => null,
            'joinColumns' => [
                [
                    'name' => 'page_id',
                    'referencedColumnName' => 'id',
                    'onDelete' => 'CASCADE',
                ],
            ],
            'orphanRemoval' => false,
        ]);
        $collector->addIndex($config['class']['snapshot'], 'idx_snapshot_dates_enabled', [
            'publication_date_start',
            'publication_date_end',
            'enabled',
        ]);
    }
public function registerDoctrineMapping ( array $ config ) { @ trigger_error ( 'Using SonataEasyExtendsBundle is deprecated since sonata-project/page-bundle 3.19. Please register SonataDoctrineBundle as a bundle instead.' , \ E_USER_DEPRECATED ) ; if ( ! class_exists ( $ config [ 'class' ] [ 'page' ] ) ) { return ; } $ collector = DeprecatedDoctrineCollector :: getInstance ( ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'page' ] , 'mapOneToMany' , [ 'fieldName' => 'children' , 'targetEntity' => $ config [ 'class' ] [ 'page' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => 'parent' , 'orphanRemoval' => false , 'orderBy' => [ 'position' => 'ASC' , ] , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'page' ] , 'mapOneToMany' , [ 'fieldName' => 'blocks' , 'targetEntity' => $ config [ 'class' ] [ 'block' ] , 'cascade' => [ 'remove' , 'persist' , 'refresh' , 'merge' , 'detach' , ] , 'mappedBy' => 'page' , 'orphanRemoval' => false , 'orderBy' => [ 'position' => 'ASC' , ] , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'page' ] , 'mapManyToOne' , [ 'fieldName' => 'site' , 'targetEntity' => $ config [ 'class' ] [ 'site' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => null , 'inversedBy' => null , 'joinColumns' => [ [ 'name' => 'site_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'page' ] , 'mapManyToOne' , [ 'fieldName' => 'parent' , 'targetEntity' => $ config [ 'class' ] [ 'page' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => null , 'inversedBy' => 'children' , 'joinColumns' => [ [ 'name' => 'parent_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'page' ] , 'mapOneToMany' , [ 'fieldName' => 'sources' , 'targetEntity' => $ config [ 'class' ] [ 'page' ] , 'cascade' => [ ] , 'mappedBy' => 'target' , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'page' ] , 'mapManyToOne' , [ 'fieldName' => 'target' , 'targetEntity' => $ config [ 'class' ] [ 'page' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => null , 'inversedBy' => 'sources' , 'joinColumns' => [ [ 'name' => 'target_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'block' ] , 'mapOneToMany' , [ 'fieldName' => 'children' , 'targetEntity' => $ config [ 'class' ] [ 'block' ] , 'cascade' => [ 'remove' , 'persist' , ] , 'mappedBy' => 'parent' , 'orphanRemoval' => true , 'orderBy' => [ 'position' => 'ASC' , ] , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'block' ] , 'mapManyToOne' , [ 'fieldName' => 'parent' , 'targetEntity' => $ config [ 'class' ] [ 'block' ] , 'cascade' => [ ] , 'mappedBy' => null , 'inversedBy' => 'children' , 'joinColumns' => [ [ 'name' => 'parent_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'block' ] , 'mapManyToOne' , [ 'fieldName' => 'page' , 'targetEntity' => $ config [ 'class' ] [ 'page' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => null , 'inversedBy' => 'blocks' , 'joinColumns' => [ [ 'name' => 'page_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'snapshot' ] , 'mapManyToOne' , [ 'fieldName' => 'site' , 'targetEntity' => $ config [ 'class' ] [ 'site' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => null , 'inversedBy' => null , 'joinColumns' => [ [ 'name' => 'site_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addAssociation ( $ config [ 'class' ] [ 'snapshot' ] , 'mapManyToOne' , [ 'fieldName' => 'page' , 'targetEntity' => $ config [ 'class' ] [ 'page' ] , 'cascade' => [ 'persist' , ] , 'mappedBy' => null , 'inversedBy' => null , 'joinColumns' => [ [ 'name' => 'page_id' , 'referencedColumnName' => 'id' , 'onDelete' => 'CASCADE' , ] , ] , 'orphanRemoval' => false , ] ) ; $ collector -> addIndex ( $ config [ 'class' ] [ 'snapshot' ] , 'idx_snapshot_dates_enabled' , [ 'publication_date_start' , 'publication_date_end' , 'enabled' , ] ) ; }
NEXT_MAJOR: Remove this method.
NEXT_MAJOR : Remove this method .