Code Duplication    Length = 13-13 lines in 3 locations

class/xoopstopic.php 3 locations

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