imports:
    - { resource: ./../config/config.yml }

doctrine:
    dbal:
        path: "%kernel.cache_dir%/db.sqlite"
        charset:  UTF8
    orm:
        auto_generate_proxy_classes: false
        auto_mapping: false

services:
    indexable_service:
        class: FOS\ElasticaBundle\Tests\Functional\app\ORM\IndexableService

fos_elastica:
    clients:
        default:
            url: http://localhost:9200
    indexes:
        fos_elastica_orm_test:
            types:
                type:
                    properties:
                        field1: ~
        index:
            index_name: "foselastica_orm_test_%kernel.environment%"
            types:
                type:
                    properties:
                        field1: ~
                        coll: ~
                    persistence:
                        driver: orm
                        model: FOS\ElasticaBundle\Tests\Functional\TypeObj
                        listener:
                            is_indexable_callback: 'object.isIndexable() && !object.isntIndexable()'
                        provider:
                            debug_logging: true
                type2:
                    properties:
                        field1: ~
                    persistence:
                        driver: orm
                        model: FOS\ElasticaBundle\Tests\Functional\TypeObj
                        listener:
                            is_indexable_callback: [ "@indexable_service", 'isIndexable' ]
                type3:
                    mappings:
                        field1: ~
                    persistence:
                        driver: orm
                        model: FOS\ElasticaBundle\Tests\Functional\TypeObj
                        finder: ~
                        provider: ~
                        listener:
                            is_indexable_callback: 'isntIndexable'
                type4:
                    mappings:
                        field1: ~
                    persistence:
                        driver: orm
                        model: FOS\ElasticaBundle\Tests\Functional\TypeObj
                        finder: ~
                        provider: ~
                        listener:
                            is_indexable_callback: [ 'FOS\ElasticaBundle\Tests\Functional\app\ORM\IndexableService', 'isntIndexable' ]
                property_paths_type:
                    persistence:
                        driver: orm
                        model: FOS\ElasticaBundle\Tests\Functional\TypeObj
                        provider: ~
                    properties:
                        field1:
                            property_path: field2
                        something:
                            property_path: coll
                        dynamic:
                            property_path: false
        second_index:
            index_name: foselastica_orm_test_second_%kernel.environment%
            types:
                type:
                    properties:
                        field1: ~
                        coll: ~
                    persistence:
                        driver: orm
                        model: FOS\ElasticaBundle\Tests\Functional\TypeObj
                        listener:
                            is_indexable_callback: 'object.isIndexable() && !object.isntIndexable()'
