Created
March 11, 2013 19:44
-
-
Save Zauberfisch/5137067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return children from the stage site | |
* | |
* @param showAll Inlcude all of the elements, even those not shown in the menus. | |
* (only applicable when extension is applied to {@link SiteTree}). | |
* @return SS_List | |
*/ | |
public function stageChildren($showAll = false) { | |
$baseClass = ClassInfo::baseDataClass($this->owner->class); | |
$staged = $baseClass::get()->filter('ParentID', $this->owner->ID)->exclude('ID', $this->owner->ID); | |
if($this->owner->db('ShowInMenus') && !$showAll) { | |
$staged = $staged->filter('ShowInMenus', 1); | |
} | |
$this->owner->extend("augmentStageChildren", $staged, $showAll); | |
return $staged; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment