Code Duplication    Length = 14-15 lines in 2 locations

Components/Helper.php 1 location

@@ 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

Subscribers/Supplier.php 1 location

@@ 86-99 (lines=14) @@
83
     * @param array $supplierIds
84
     * @return array
85
     */
86
    protected function getConnectSuppliers($supplierIds)
87
    {
88
        /** @var \Doctrine\DBAL\Connection $conn */
89
        $builder = $this->connection->createQueryBuilder();
90
        $builder->select('supplierID')
91
            ->from('s_articles_supplier_attributes', 'sa')
92
            ->where('sa.supplierID IN (:supplierIds)')
93
            ->andWhere('sa.connect_is_remote = 1')
94
            ->setParameter('supplierIds', $supplierIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY);
95
96
        return array_map(function ($item) {
97
            return $item['supplierID'];
98
        }, $builder->execute()->fetchAll(\PDO::FETCH_ASSOC));
99
    }
100
}
101