addLinkTranslation example


        $ids = array_unique($ids);

        $query = $this->connection->createQueryBuilder();
        $query->select($this->fieldHelper->getLinkFields());

        $query->from('s_articles_information', 'link')
            ->leftJoin('link', 's_articles_information_attributes', 'linkAttribute', 'linkAttribute.informationID = link.id')
            ->where('link.articleID IN (:ids)')
            ->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);

        $this->fieldHelper->addLinkTranslation($query$context);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);
        $links = [];
        foreach ($data as $row) {
            $key = $row['__link_articleID'];
            $links[$key][] = $this->linkHydrator->hydrate($row);
        }

        $result = [];
        foreach ($products as $product) {
            if (isset($links[$product->getId()])) {
                
Home | Imprint | This part of the site doesn't use cookies.