Code Duplication    Length = 13-13 lines in 2 locations

code/ImageGalleryPage.php 2 locations

@@ 101-113 (lines=13) @@
98
        $this->AutomaticallyIncludedFolderID = 0;
99
    }
100
101
    public function NextGallery()
102
    {
103
        $pages = ImageGalleryPage::get()
104
            ->exclude(array("ID" => $this->ID))
105
            ->where("TimeDiff(\"Created\",'".$this->Created."') > 0")
106
            ->sort("Created", "ASC")
107
            ->limit(1);
108
        if ($pages) {
109
            foreach ($pages as $page) {
110
                return $page;
111
            }
112
        }
113
    }
114
115
    public function PreviousGallery()
116
    {
@@ 115-127 (lines=13) @@
112
        }
113
    }
114
115
    public function PreviousGallery()
116
    {
117
        $pages = ImageGalleryPage::get()
118
            ->exclude(array("ID" => $this->ID))
119
            ->where("TimeDiff(\"Created\",'".$this->Created."') < 0")
120
            ->sort("Created", "DESC")
121
            ->limit(1);
122
        if ($pages) {
123
            foreach ($pages as $page) {
124
                return $page;
125
            }
126
        }
127
    }
128
}
129
130
class ImageGalleryPage_Controller extends Page_Controller