Document Listing setCondition by elements

Is that any way how to set conditions on Document\Listing by documents elements?

Hi @zachrdlapetr This might help you…

    $listing = new \Pimcore\Model\Document\Listing();
    $listing->setCondition("documents.type= 'page'");

    $listing->onCreateQuery(
            function (\Pimcore\Db\ZendCompatibility\QueryBuilder $select) use ($list) {
        $select->join(
                ['elements' => 'documents_elements'],
                "elements.documentId =  documents.id  and elements.name='heading1' and elements.data='Golf Sales' ",
                ''
        );
    }
    );
    $documents = $listing -> load();

Hello @neha, thank you for help. It’s helped me. I didn’t know how to do a JOIN operations in Pimcore. I searched something like setJoin :slight_smile: