src/Sulu/Component/Content/Repository/ContentRepository.php
private function appendMapping(QueryBuilder $queryBuilder, MappingInterface $mapping, $locale, $locales)
    {
        if ($mapping->onlyPublished()) {
            $queryBuilder->andWhere(
                $this->qomFactory->comparison(
                    $this->qomFactory->propertyValue(
                        'node',
                        $this->propertyEncoder->localizedSystemName('state', $locale)
                    ),
                    '=',
                    $this->qomFactory->literal(WorkflowStage::PUBLISHED)
                )
            );
        }

        $properties = $mapping->getProperties();
        foreach ($properties as $propertyName) {
            $this->appendSingleMapping($queryBuilder, $propertyName, $locales);
        }

        if ($mapping->resolveUrl()) {
            $this->appendUrlMapping($queryBuilder, $locales);
        }
    }
private function appendMapping(QueryBuilder $queryBuilder, MappingInterface $mapping, $locale, $locales)
    {
        if ($mapping->onlyPublished()) {
            $queryBuilder->andWhere(
                $this->qomFactory->comparison(
                    $this->qomFactory->propertyValue(
                        'node',
                        $this->propertyEncoder->localizedSystemName('state', $locale)
                    ),
                    '=',
                    $this->qomFactory->literal(WorkflowStage::PUBLISHED)
                )
            );
        }

        $properties = $mapping->getProperties();
        foreach ($properties as $propertyName) {
            $this->appendSingleMapping($queryBuilder, $propertyName, $locales);
        }

        if ($mapping->resolveUrl()) {
            $this->appendUrlMapping($queryBuilder, $locales);
        }
    }
private function appendMapping ( QueryBuilder $ queryBuilder , MappingInterface $ mapping , $ locale , $ locales ) { if ( $ mapping -> onlyPublished ( ) ) { $ queryBuilder -> andWhere ( $ this -> qomFactory -> comparison ( $ this -> qomFactory -> propertyValue ( 'node' , $ this -> propertyEncoder -> localizedSystemName ( 'state' , $ locale ) ) , '=' , $ this -> qomFactory -> literal ( WorkflowStage :: PUBLISHED ) ) ) ; } $ properties = $ mapping -> getProperties ( ) ; foreach ( $ properties as $ propertyName ) { $ this -> appendSingleMapping ( $ queryBuilder , $ propertyName , $ locales ) ; } if ( $ mapping -> resolveUrl ( ) ) { $ this -> appendUrlMapping ( $ queryBuilder , $ locales ) ; } }
Append mapping selects to given query-builder.

@param QueryBuilder $queryBuilder
@param MappingInterface $mapping Includes array of property names
@param string $locale
@param string[] $locales
Append mapping selects to given query - builder .