Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Codeblock
languagephp
use Brandbox\Framework\Brandbox\ComplexQuery;

use Brandbox\ShopCore\Shop\Group;
use Brandbox\ShopCore\Shop\Article;

class GroupArticleBuilder
    extends ComplexQuery\BuilderAbstract
    implements ComplexQuery\BuilderInterface
{

    public function build(): void
    {
        $this
            ->select(
                CQDemoDemo\Lib\Dto\GroupArticle::class,
                [
                    'shopGroup.shopGroupName',
                    'shopArticle.shopArticleName'
                ]
            )
            ->from(Group\lib\entity\shopGroup::class)
            ->joinRelation(Group\lib\entity\shopGroup::class, Article\lib\entity\shopArticle::class)
            ->joinTranslation(
                Article\lib\entity\shopArticle::class,
                Article\lib\entity\translationShopArticle::class,
                $collationId = 2
            )
            ->andWhere('translationShopArticle.shopArticleName != \'\'')
            ->andWhere('shopArticle.shopArticleName LIKE :name')
            ->orderAsc('shopGroup.shopGroupName')
            ->orderDesc('shopArticle.shopArticleName')
            ->noCacheable()
            ->setFirstResult(0)
            ->setMaxResults(3)
            ->setParameter('name', '%Craft%')
        ;
    }
}

...