Code Duplication    Length = 13-15 lines in 3 locations

Components/ProductStream/ProductStreamRepository.php 1 location

@@ 383-396 (lines=14) @@
380
    /**
381
     * @return array
382
     */
383
    public function fetchConnectStreamIds()
384
    {
385
        $builder = $this->manager->getConnection()->createQueryBuilder();
386
387
        $results = $builder->select('sa.streamID')
388
            ->from('s_product_streams_attributes', 'sa')
389
            ->where('sa.connect_is_remote = 1')
390
            ->execute()
391
            ->fetchAll();
392
393
        return array_map(function ($item) {
394
            return $item['streamID'];
395
        }, $results);
396
    }
397
398
    /**
399
     * @param int|array $streamId

Components/Helper.php 2 locations

@@ 175-189 (lines=15) @@
172
     * @param array $orderNumbers
173
     * @return array
174
     */
175
    public function getArticleIdsByNumber(array $orderNumbers)
176
    {
177
        $builder = $this->manager->getConnection()->createQueryBuilder();
178
179
        $rows = $builder->select('d.articleID as articleId')
180
            ->from('s_articles_details', 'd')
181
            ->where('d.ordernumber IN (:orderNumbers)')
182
            ->setParameter('orderNumbers', $orderNumbers, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
183
            ->execute()
184
            ->fetchAll();
185
186
        return array_map(function ($row) {
187
            return $row['articleId'];
188
        }, $rows);
189
    }
190
191
    /**
192
     * Returns article detail model by
@@ 793-805 (lines=13) @@
790
    /**
791
     * @return array
792
     */
793
    public function getAllNonConnectArticleIds()
794
    {
795
        $builder = $this->manager->getConnection()->createQueryBuilder();
796
        $builder->select('DISTINCT spci.article_id');
797
        $builder->from('s_plugin_connect_items', 'spci');
798
        $builder->where('spci.shop_id IS NULL');
799
800
        $result = $builder->execute()->fetchAll();
801
802
        return array_map(function ($row) {
803
            return $row['article_id'];
804
        }, $result);
805
    }
806
}
807