Code Duplication    Length = 10-11 lines in 4 locations

class/answer.php 1 location

@@ 575-584 (lines=10) @@
572
        if (!$result) {
573
            return $ret;
574
        }
575
        while ($myrow = $this->db->fetchArray($result)) {
576
            $answer = new sfAnswer();
577
            $answer->assignVars($myrow);
578
            if (!$id_as_key) {
579
                $ret[] =& $answer;
580
            } else {
581
                $ret[$myrow['answerid']] =& $answer;
582
            }
583
            unset($answer);
584
        }
585
586
        return $ret;
587
    }

class/category.php 1 location

@@ 431-440 (lines=10) @@
428
            return $ret;
429
        }
430
431
        while ($myrow = $this->db->fetchArray($result)) {
432
            $category = new sfCategory();
433
            $category->assignVars($myrow);
434
            if (!$id_as_key) {
435
                $ret[] = $category;
436
            } else {
437
                $ret[$myrow['categoryid']] = $category;
438
            }
439
            unset($category);
440
        }
441
442
        return $ret;
443
    }

class/faq.php 2 locations

@@ 880-890 (lines=11) @@
877
            return false;
878
        }
879
880
        while ($myrow = $this->db->fetchArray($result)) {
881
            $faq = new sfFaq();
882
            $faq->assignVars($myrow);
883
884
            if (!$id_as_key) {
885
                $ret[] =& $faq;
886
            } else {
887
                $ret[$myrow['faqid']] =& $faq;
888
            }
889
            unset($faq);
890
        }
891
892
        return $ret;
893
    }
@@ 959-969 (lines=11) @@
956
            return false;
957
        }
958
959
        while ($myrow = $this->db->fetchArray($result)) {
960
            $faq = new sfFaq();
961
            $faq->assignVars($myrow);
962
963
            if (!$id_as_key) {
964
                $ret[] =& $faq;
965
            } else {
966
                $ret[$myrow['faqid']] =& $faq;
967
            }
968
            unset($faq);
969
        }
970
971
        return $ret;
972