MINOR initializing local variables properly in Hierarchy

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70304 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-01-16 04:04:13 +00:00
parent d5339af47c
commit c67ef43f6c

View File

@ -387,9 +387,11 @@ class Hierarchy extends DataObjectDecorator {
* @return DataObjectSet
*/
public function doAllChildrenIncludingDeleted($context = null) {
$idxStageChildren = array();
$idxLiveChildren = array();
// Cache the allChildren data, so that future requests will return the references to the same
// object. This allows the mark..() system to work appropriately.
if(!$this->_cache_allChildrenIncludingDeleted) {
$baseClass = ClassInfo::baseDataClass($this->owner->class);
if($baseClass) {
@ -416,11 +418,11 @@ class Hierarchy extends DataObjectDecorator {
}
DataObject::disable_subclass_access();
if(isset($idxStageChildren)) {
if($idxStageChildren) {
$foundInLive = Versioned::get_by_stage( $baseClass, 'Live', "\"{$baseClass}\".\"ID\" IN (" . implode(",", array_keys($idxStageChildren)) . ")", "" );
}
if(isset($idxLiveChildren)) {
if($idxLiveChildren) {
$foundInStage = Versioned::get_by_stage( $baseClass, 'Stage', "\"{$baseClass}\".\"ID\" IN (" . implode(",", array_keys($idxLiveChildren)) . ")", "" );
}
DataObject::enable_subclass_access();