function PreviousGallery() { $pages = ImageGalleryPage::get()->exclude(array("ID" => $this->ID))->where("TimeDiff(\"Created\",'" . $this->Created . "') < 0")->sort("Created", "DESC")->limit(1); if ($pages) { foreach ($pages as $page) { return $page; } } }
function MyChildGalleries() { return ImageGalleryPage::get()->filter(array("ParentID" => $this->ID, "ShowInSearch" => 1)); }