Code Duplication    Length = 7-8 lines in 3 locations

class/xoopstopic.php 1 location

@@ 83-89 (lines=7) @@
80
    /**
81
     * @param $topicid
82
     */
83
    public function getTopic($topicid)
84
    {
85
        $topicid = (int)$topicid;
86
        $sql     = 'SELECT * FROM ' . $this->table . ' WHERE topic_id=' . $topicid . '';
87
        $array   = $this->db->fetchArray($this->db->query($sql));
88
        $this->makeTopic($array);
89
    }
90
91
    /**
92
     * @param $array

class/class.sfiles.php 1 location

@@ 376-383 (lines=8) @@
373
     *
374
     * @return mixed
375
     */
376
    public function getCountbyStory($storyid)
377
    {
378
        $sql    = 'SELECT count(fileid) AS cnt FROM ' . $this->table . ' WHERE storyid=' . (int)$storyid . '';
379
        $result = $this->db->query($sql);
380
        $myrow  = $this->db->fetchArray($result);
381
382
        return $myrow['cnt'];
383
    }
384
385
    /**
386
     * @param $stories

class/xoopsstory.php 1 location

@@ 323-329 (lines=7) @@
320
    /**
321
     * @param $storyid
322
     */
323
    public function getStory($storyid)
324
    {
325
        $storyid = (int)$storyid;
326
        $sql     = 'SELECT * FROM ' . $this->table . ' WHERE storyid=' . $storyid . '';
327
        $array   = $this->db->fetchArray($this->db->query($sql));
328
        $this->makeStory($array);
329
    }
330
331
    /**
332
     * @param $array