parameters:
    icap.blog.manager.tag.class:     Icap\BlogBundle\Manager\TagManager
    icap.blog.type.tags.class:       Icap\BlogBundle\Form\TagsType
    icap.blog.twig.extension.class:  Icap\BlogBundle\Twig\IcapBlogExtension
    icap.blog.tag.class:             Icap\BlogBundle\Entity\Tag
    icap.blog.tag_repository.class:  Icap\BlogBundle\Repository\TagRepository
    icap.blog.post.class:            Icap\BlogBundle\Entity\Post
    icap.blog.post_repository.class: Icap\BlogBundle\Repository\PostRepository
    icap.blog.banner_upload_directory: "uploads/blogs"
    icap.blog.banner_directory:        "%claroline.param.web_directory%/%icap.blog.banner_upload_directory%"

services:
    icap.blog.tag_repository:
        class: "%icap.blog.tag_repository.class%"
        factory: ["@doctrine.orm.entity_manager", getRepository]
        arguments:
            - "%icap.blog.tag.class%"

    icap.blog.post_repository:
        class: "%icap.blog.post_repository.class%"
        factory: ["@doctrine.orm.entity_manager", getRepository]
        arguments:
            - "%icap.blog.post.class%"

    icap.blog.manager.tag:
        class: "%icap.blog.manager.tag.class%"
        arguments: [@icap.blog.tag_repository]

    icap.blog.type.tags:
        class: "%icap.blog.type.tags.class%"
        arguments: [@icap.blog.manager.tag]
        tags:
            - { name: form.type, alias: tags }

    icap.blog.twig.extension:
        class: "%icap.blog.twig.extension.class%"
        arguments: [@icap.blog.manager.tag, @icap.blog.post_repository, %icap.blog.banner_directory%, %icap.blog.banner_upload_directory%]
        tags:
            - { name: twig.extension }
