<?php

/*
 * This file is part of the Sylius package.
 *
 * (c) Paweł Jędrzejewski
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sylius\Component\Taxonomy\Repository;

use Doctrine\Common\Collections\Collection;
use Sylius\Component\Taxonomy\Model\TaxonInterface;
use Sylius\Component\Taxonomy\Model\TaxonomyInterface;

interface TaxonRepositoryInterface
{
    /**
     * Get all taxons that belong to given taxonomy.
     *
     * @param $taxonomy TaxonomyInterface
     *
     * @return Collection|TaxonInterface[]
     */
    public function getTaxonsAsList(TaxonomyInterface $taxonomy);
}

<?php

/*
 * This file is part of the Sylius package.
 *
 * (c) Paweł Jędrzejewski
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Sylius\Component\Taxonomy\Repository;

use Doctrine\Common\Collections\Collection;
use Sylius\Component\Taxonomy\Model\TaxonInterface;
use Sylius\Component\Taxonomy\Model\TaxonomyInterface;

interface TaxonRepositoryInterface
{
    /**
     * Get all taxons that belong to given taxonomy.
     *
     * @param $taxonomy TaxonomyInterface
     *
     * @return Collection|TaxonInterface[]
     */
    public function getTaxonsAsList(TaxonomyInterface $taxonomy);

    /**
     * @return Collection|TaxonInterface[]
     */
    public function getNonRootTaxons();
}

Add scenarios about add,delete product with main taxon and add main taxon to existing product [CoreBundle] Add new fields: mainTaxon in ProductType,main_taxon_id in Product.orm.xml, add new spec for ProductType [ProductBundle] Add method for step from background for products.feature [TaxonomyBundle] Add method getNonRootTaxons in TaxonRepository, edit congifureOptions function in TaxonChoiceType, add spec for getNonRootTaxons, edit it_has_options in TaxonChoiceTypeSpec [WebBundle] Add messages for new fields MainTaxon in messages.en.yml, in background for product: _categorization.html.twig - add new row MainTaxon, show.hmtl.twig - add new row in general info table [Core] Add methods getMainTaxon, setMainTaxon in Product and ProductInerface, add specs for those methods
[features] Add scenarios about add,delete product with main taxon and add main taxon to existing product
[CoreBundle] Add new fields: mainTaxon in ProductType,main_taxon_id in Product.orm.xml, add new spec for ProductType
[ProductBundle] Add method for step from background for products.feature
[TaxonomyBundle] Add method getNonRootTaxons in TaxonRepository, edit congifureOptions function in TaxonChoiceType, add spec for getNonRootTaxons, edit it_has_options in TaxonChoiceTypeSpec
[WebBundle] Add messages for new fields MainTaxon in messages.en.yml, in background for product: _categorization.html.twig - add new row MainTaxon, show.hmtl.twig - add new row in general info table
[Core] Add methods getMainTaxon, setMainTaxon in Product and ProductInerface, add specs for those methods
