Code Duplication    Length = 13-13 lines in 3 locations

htdocs/class/xoopstopic.php 3 locations

@@ 284-296 (lines=13) @@
281
    /**
282
     * @return array
283
     */
284
    public function getFirstChildTopics()
285
    {
286
        $ret       = array();
287
        $xt        = new XoopsTree($this->table, 'topic_id', 'topic_pid');
288
        $topic_arr = $xt->getFirstChild($this->topic_id, 'topic_title');
289
        if (is_array($topic_arr) && count($topic_arr)) {
290
            foreach ($topic_arr as $topic) {
291
                $ret[] = new XoopsTopic($this->table, $topic);
292
            }
293
        }
294
295
        return $ret;
296
    }
297
298
    /**
299
     * @return array
@@ 301-313 (lines=13) @@
298
    /**
299
     * @return array
300
     */
301
    public function getAllChildTopics()
302
    {
303
        $ret       = array();
304
        $xt        = new XoopsTree($this->table, 'topic_id', 'topic_pid');
305
        $topic_arr = $xt->getAllChild($this->topic_id, 'topic_title');
306
        if (is_array($topic_arr) && count($topic_arr)) {
307
            foreach ($topic_arr as $topic) {
308
                $ret[] = new XoopsTopic($this->table, $topic);
309
            }
310
        }
311
312
        return $ret;
313
    }
314
315
    /**
316
     * @return array
@@ 318-330 (lines=13) @@
315
    /**
316
     * @return array
317
     */
318
    public function getChildTopicsTreeArray()
319
    {
320
        $ret       = array();
321
        $xt        = new XoopsTree($this->table, 'topic_id', 'topic_pid');
322
        $topic_arr = $xt->getChildTreeArray($this->topic_id, 'topic_title');
323
        if (is_array($topic_arr) && count($topic_arr)) {
324
            foreach ($topic_arr as $topic) {
325
                $ret[] = new XoopsTopic($this->table, $topic);
326
            }
327
        }
328
329
        return $ret;
330
    }
331
332
    /**
333
     * @param int    $none