Code Duplication    Length = 15-15 lines in 2 locations

src/Action.php 2 locations

@@ 265-279 (lines=15) @@
262
     * @param int $id
263
     * @return array
264
     */
265
    protected static function prepareIBlockElementArrayById($id)
266
    {
267
        $id = (int) $id;
268
        if (!$id) {
269
            return [];
270
        }
271
272
        if (empty(static::$iblockElementArray[$id])) {
273
            $connection = Application::getConnection();
274
            $el = $connection->query("SELECT ID, IBLOCK_ID FROM b_iblock_element WHERE ID = {$id}")->fetch();
275
            static::$iblockElementArray[$id] = $el ? $el : [];
276
        }
277
278
        return static::$iblockElementArray[$id];
279
    }
280
281
    /**
282
     * @param int $id
@@ 285-299 (lines=15) @@
282
     * @param int $id
283
     * @return array
284
     */
285
    protected static function prepareIBlockSectionArrayById($id)
286
    {
287
        $id = (int) $id;
288
        if (!$id) {
289
            return [];
290
        }
291
292
        if (empty(static::$iblockSectionArray[$id])) {
293
            $connection = Application::getConnection();
294
            $el = $connection->query("SELECT ID, IBLOCK_ID FROM b_iblock_section WHERE ID = {$id}")->fetch();
295
            static::$iblockSectionArray[$id] = $el ? $el : [];
296
        }
297
298
        return static::$iblockSectionArray[$id];
299
    }
300
}
301