*/
var $depth;
+ private $volatile = false;
+
/**
* @var array
*/
function getTitle() {
return $this->title;
}
+
+ /**
+ * Set the volatile flag
+ *
+ * @param bool $flag
+ */
+ function setVolatile( $flag = true ) {
+ $this->volatile = $flag;
+ }
+
+ /**
+ * Get the volatile flag
+ *
+ * @return bool
+ */
+ function isVolatile() {
+ return $this->volatile;
+ }
}
/**
* @return string
*/
function cachedExpand( $key, $root, $flags = 0 ) {
- if ( !isset( $this->parent->childExpansionCache[$key] ) ) {
- $this->parent->childExpansionCache[$key] = $this->expand( $root, $flags );
+ if ( isset( $this->parent->childExpansionCache[$key] ) ) {
+ return $this->parent->childExpansionCache[$key];
}
- return $this->parent->childExpansionCache[$key];
+ $retval = $this->expand( $root, $flags );
+ if ( !$this->isVolatile() ) {
+ $this->parent->childExpansionCache[$key] = $retval;
+ }
+ return $retval;
}
/**
function isTemplate() {
return true;
}
+
+ function setVolatile( $flag = true ) {
+ parent::setVolatile( $flag );
+ $this->parent->setVolatile( $flag );
+ }
}
/**