Permalink
Browse files

BUGFIX Moved SiteTree?->ParentID property to Hierarchy extension (fixes

#5638) (from r105668)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105786 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 06f1848 commit 53b02f6d99f80c0147b8e5d7fd35227764422229 @chillu chillu committed May 27, 2010
Showing with 9 additions and 4 deletions.
  1. +9 −0 core/model/Hierarchy.php
  2. +0 −4 core/model/SiteTree.php
View
9 core/model/Hierarchy.php
@@ -24,6 +24,15 @@ function augmentDatabase() {
function augmentWrite(&$manipulation) {
}
+
+ function extraStatics($class = null) {
+ return array(
+ 'has_one' => array(
+ // TODO this method is called *both* statically and on an instance
+ "Parent" => ($class) ? $class : $this->owner->class
+ )
+ );
+ }
/**
* Returns the children of this DataObject as an XHTML UL. This will be called recursively on each child,
View
4 core/model/SiteTree.php
@@ -123,10 +123,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
"CanEditType" => "Inherit"
);
- static $has_one = array(
- "Parent" => "SiteTree"
- );
-
static $versioning = array(
"Stage", "Live"
);

0 comments on commit 53b02f6

Please sign in to comment.