floriansemm / SolrBundle

Solr-Integration into Symfony and Doctrine2
http://floriansemm.github.io/SolrBundle
MIT License
123 stars 73 forks source link

Jkwakman - one to many relations #187

Closed jkwakman closed 6 years ago

jkwakman commented 6 years ago

Added @Solr\Fields implementation for indexing multiple fields. Commit includes code, docs and tests.

Example of annotation:

    /**
     * @var Tag[] $tag
     *
     * @ORM\OneToMany(targetEntity="Acme\DemoBundle\Entity\Tag", mappedBy="post", cascade={"persist"})
     * @Solr\Fields(getter="getTags", fields={
     *      @Solr\Field(type="integers", getter="getId", fieldAlias="id"),
     *      @Solr\Field(type="strings", getter="getName", fieldAlias="name")
     *      })
     */
    private $tags;